commit-gnue
[Top][All Lists]
Advanced

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

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


From: johannes
Subject: [gnue] r7355 - trunk/gnue-common/src/datasources/drivers/DBSIG2
Date: Tue, 12 Apr 2005 08:42:18 -0500 (CDT)

Author: johannes
Date: 2005-04-12 08:42:17 -0500 (Tue, 12 Apr 2005)
New Revision: 7355

Modified:
   trunk/gnue-common/src/datasources/drivers/DBSIG2/ResultSet.py
Log:
Don't use fieldlist for broken query-count


Modified: trunk/gnue-common/src/datasources/drivers/DBSIG2/ResultSet.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/DBSIG2/ResultSet.py       
2005-04-12 13:05:31 UTC (rev 7354)
+++ trunk/gnue-common/src/datasources/drivers/DBSIG2/ResultSet.py       
2005-04-12 13:42:17 UTC (rev 7355)
@@ -68,9 +68,9 @@
   # Build the query string for the count
   # ---------------------------------------------------------------------------
 
-  def __buildQueryCount (self, table, what, where):
+  def __buildQueryCount (self, table, where):
 
-    query = 'SELECT COUNT (' + what + ') FROM ' + table
+    query = 'SELECT COUNT (*) FROM ' + table
 
     if where:
       query += ' WHERE ' + where
@@ -95,8 +95,11 @@
     self.__cursor = connection.makecursor (query, params)
 
     if connection._broken_rowcount:
-      query = self.__buildQueryCount (table, what, where)
-      self.__count = connection.sql1 (query, params)
+      if distinct:
+        self.__count = 0
+      else:
+        query = self.__buildQueryCount (table, where)
+        self.__count = connection.sql1 (query, params)
     else:
       self.__count = self.__cursor.rowcount
 





reply via email to

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