[CalendarServer-changes] [6529] CalendarServer/branches/users/glyph/sharedpool/txdav/base/datastore/ asyncsqlpool.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Nov 1 14:24:38 PDT 2010


Revision: 6529
          http://trac.macosforge.org/projects/calendarserver/changeset/6529
Author:   glyph at apple.com
Date:     2010-11-01 14:24:35 -0700 (Mon, 01 Nov 2010)
Log Message:
-----------
Working implementation of raiseOnZeroRowCount

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/sharedpool/txdav/base/datastore/asyncsqlpool.py

Modified: CalendarServer/branches/users/glyph/sharedpool/txdav/base/datastore/asyncsqlpool.py
===================================================================
--- CalendarServer/branches/users/glyph/sharedpool/txdav/base/datastore/asyncsqlpool.py	2010-11-01 21:24:15 UTC (rev 6528)
+++ CalendarServer/branches/users/glyph/sharedpool/txdav/base/datastore/asyncsqlpool.py	2010-11-01 21:24:35 UTC (rev 6529)
@@ -367,15 +367,14 @@
     @ExecSQL.responder
     @inlineCallbacks
     def receivedSQL(self, transactionID, queryID, sql, args):
-        norows = True
         try:
-            rows = yield self._txns[transactionID].execSQL(sql, args)
+            rows = yield self._txns[transactionID].execSQL(sql, args, _NoRows)
         except _NoRows:
-            pass
+            norows = True
         else:
+            norows = False
             if rows is not None:
                 for row in rows:
-                    norows = False
                     # Either this should be yielded or it should be
                     # requiresAnswer=False
                     self.callRemote(Row, queryID=queryID, row=row)
@@ -455,9 +454,9 @@
         """
         The query is complete.
 
-        @param norows: A boolean.  True if there were any rows.
+        @param norows: A boolean.  True if there were not any rows.
         """
-        if norows and self.raiseOnZeroRowCount is not None:
+        if norows and (self.raiseOnZeroRowCount is not None):
             exc = self.raiseOnZeroRowCount()
             self.deferred.errback(Failure(exc))
         else:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20101101/3a301033/attachment.html>


More information about the calendarserver-changes mailing list