diff roundup/backends/rdbms_common.py @ 2536:70ede89e8056

handle postgresql bug in SQL generation [SF#984591]
author Richard Jones <richard@users.sourceforge.net>
date Sat, 03 Jul 2004 23:05:15 +0000
parents a182c536b72d
children 92510df07670
line wrap: on
line diff
--- a/roundup/backends/rdbms_common.py	Sat Jul 03 22:46:30 2004 +0000
+++ b/roundup/backends/rdbms_common.py	Sat Jul 03 23:05:15 2004 +0000
@@ -1,4 +1,4 @@
-# $Id: rdbms_common.py,v 1.118 2004-07-03 16:51:52 a1s Exp $
+# $Id: rdbms_common.py,v 1.119 2004-07-03 23:05:15 richard Exp $
 ''' Relational database (SQL) backend common code.
 
 Basics:
@@ -1992,7 +1992,7 @@
         timezone = self.db.getUserTimezone()
 
         # vars to hold the components of the SQL statement
-        frum = ['_'+cn] # FROM clauses
+        frum = [] # FROM clauses
         loj = []        # LEFT OUTER JOIN clauses
         where = []      # WHERE clauses
         args = []       # *any* positional arguments
@@ -2164,6 +2164,7 @@
                 orderby.append(o)
 
         # construct the SQL
+        frum.append('_'+cn)
         frum = ','.join(frum)
         if where:
             where = ' where ' + (' and '.join(where))
@@ -2183,6 +2184,7 @@
         cols = ','.join(cols)
         loj = ' '.join(loj)
         sql = 'select %s from %s %s %s%s'%(cols, frum, loj, where, order)
+        print sql
         args = tuple(args)
         __traceback_info__ = (sql, args)
         self.db.sql(sql, args)

Roundup Issue Tracker: http://roundup-tracker.org/