fixed bug introduced with commit: df4d8a5238

This commit is contained in:
niphlod
2013-08-02 21:14:00 +02:00
parent eb2c0e6ca1
commit c0600a9e2e
+1 -1
View File
@@ -1676,7 +1676,7 @@ class BaseAdapter(ConnectionPool):
sql_o += ' ORDER BY %s' % self.RANDOM() sql_o += ' ORDER BY %s' % self.RANDOM()
else: else:
sql_o += ' ORDER BY %s' % self.expand(orderby) sql_o += ' ORDER BY %s' % self.expand(orderby)
if (limitby and not groupby and tablenames and orderby_on_limitby): if (limitby and not groupby and tablenames and orderby_on_limitby and not orderby):
sql_o += ' ORDER BY %s' % ', '.join(['%s.%s'%(t,x) for t in tablenames for x in (hasattr(self.db[t],'_primarykey') and self.db[t]._primarykey or [self.db[t]._id.name])]) sql_o += ' ORDER BY %s' % ', '.join(['%s.%s'%(t,x) for t in tablenames for x in (hasattr(self.db[t],'_primarykey') and self.db[t]._primarykey or [self.db[t]._id.name])])
# oracle does not support limitby # oracle does not support limitby
sql = self.select_limitby(sql_s, sql_f, sql_t, sql_w, sql_o, limitby) sql = self.select_limitby(sql_s, sql_f, sql_t, sql_w, sql_o, limitby)