commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r7430 - trunk/gnue-common/src/datasources/drivers/DBSIG2


From: johannes
Subject: [gnue] r7430 - trunk/gnue-common/src/datasources/drivers/DBSIG2
Date: Wed, 20 Apr 2005 02:14:30 -0500 (CDT)

Author: johannes
Date: 2005-04-20 02:14:29 -0500 (Wed, 20 Apr 2005)
New Revision: 7430

Modified:
   trunk/gnue-common/src/datasources/drivers/DBSIG2/ResultSet.py
Log:
Change the order of queries for broken_rowcount


Modified: trunk/gnue-common/src/datasources/drivers/DBSIG2/ResultSet.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/DBSIG2/ResultSet.py       
2005-04-20 07:06:01 UTC (rev 7429)
+++ trunk/gnue-common/src/datasources/drivers/DBSIG2/ResultSet.py       
2005-04-20 07:14:29 UTC (rev 7430)
@@ -91,16 +91,20 @@
       what = 'DISTINCT ' + what
     where = condition.asSQL (params)
 
-    query = self.__buildQuery (table, what, where, sortorder)
-    self.__cursor = connection.makecursor (query, params)
-
+    # If the connection has a broken row count, query for the number of records
+    # first. This avoids conflicts with some drivers not supporting multiple
+    # open cursors (like adodbapi).
     if connection._broken_rowcount:
       if distinct:
         self.__count = 0
       else:
         query = self.__buildQueryCount (table, where)
         self.__count = connection.sql1 (query, params)
-    else:
+
+    query = self.__buildQuery (table, what, where, sortorder)
+    self.__cursor = connection.makecursor (query, params)
+
+    if not connection._broken_rowcount:
       self.__count = self.__cursor.rowcount
 
     self.__connection = connection





reply via email to

[Prev in Thread] Current Thread [Next in Thread]