diff roundup/backends/rdbms_common.py @ 1539:800b5896e14a

fixed rdbms export - getnodeids in particular with NULL values
author Richard Jones <richard@users.sourceforge.net>
date Fri, 21 Mar 2003 04:02:13 +0000
parents 96cd422532ef
children a53a7e197360
line wrap: on
line diff
--- a/roundup/backends/rdbms_common.py	Thu Mar 20 04:02:52 2003 +0000
+++ b/roundup/backends/rdbms_common.py	Fri Mar 21 04:02:13 2003 +0000
@@ -1,4 +1,4 @@
-# $Id: rdbms_common.py,v 1.46 2003-03-18 00:50:24 richard Exp $
+# $Id: rdbms_common.py,v 1.47 2003-03-21 04:02:13 richard Exp $
 ''' Relational database (SQL) backend common code.
 
 Basics:
@@ -1740,12 +1740,17 @@
         # flip the sense of the flag if we don't want all of them
         if retired is not None:
             retired = not retired
-        sql = 'select id from _%s where __retired__ <> %s'%(self.classname,
-            self.db.arg)
+            args = (retired, )
+            sql = 'select id from _%s where __retired__ <> %s'%(self.classname,
+                self.db.arg)
+        else:
+            args = ()
+            sql = 'select id from _%s'%self.classname
         if __debug__:
             print >>hyperdb.DEBUG, 'getnodeids', (self, sql, retired)
-        self.db.cursor.execute(sql, (retired,))
-        return [x[0] for x in self.db.cursor.fetchall()]
+        self.db.cursor.execute(sql, args)
+        ids = [x[0] for x in self.db.cursor.fetchall()]
+        return ids
 
     def filter(self, search_matches, filterspec, sort=(None,None),
             group=(None,None)):

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