[Neo-report] r2316 gregory - /trunk/neo/storage/database/mysqldb.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Sep 30 11:11:18 CEST 2010


Author: gregory
Date: Thu Sep 30 11:11:17 2010
New Revision: 2316

Log:
Fix r2306: Constraint on 'partition' must alway match.

Modified:
    trunk/neo/storage/database/mysqldb.py

Modified: trunk/neo/storage/database/mysqldb.py
==============================================================================
--- trunk/neo/storage/database/mysqldb.py [iso-8859-1] (original)
+++ trunk/neo/storage/database/mysqldb.py [iso-8859-1] Thu Sep 30 11:11:17 2010
@@ -603,11 +603,10 @@ class MySQLDatabaseManager(DatabaseManag
         min_serial = u64(min_serial)
         max_serial = u64(max_serial)
         r = q('SELECT oid, serial FROM obj '
-                'WHERE (partition=%(partition)s AND (oid = %(min_oid)d '
-                'AND serial >= %(min_serial)d) OR '
-                'oid > %(min_oid)d) AND '
-                'partition = %(partition)d AND '
-                'serial <= %(max_serial)d '
+                'WHERE (partition = %(partition)s '
+                'AND serial <= %(max_serial)d '
+                'AND ((oid = %(min_oid)d AND serial >= %(min_serial)d) '
+                'OR oid > %(min_oid)d) '
                 'ORDER BY oid ASC, serial ASC LIMIT %(length)d' % {
             'min_oid': min_oid,
             'min_serial': min_serial,





More information about the Neo-report mailing list