server/sources/rql2sql.py
branchstable
changeset 6297 23c1e50ff97b
parent 6286 4d10e9895679
child 6491 ee9a10b6620e
--- a/server/sources/rql2sql.py	Wed Sep 22 10:34:20 2010 +0200
+++ b/server/sources/rql2sql.py	Wed Sep 22 10:35:34 2010 +0200
@@ -761,6 +761,8 @@
             restrictions.append(restriction)
         restriction = ' AND '.join(restrictions)
         if not restriction:
+            if tables:
+                return 'SELECT 1 FROM %s' % ', '.join(tables)
             return ''
         if not tables:
             # XXX could leave surrounding EXISTS() in this case no?