[CalendarServer-changes] [7131] CalendarServer/branches/users/glyph/oracle

source_changes at macosforge.org source_changes at macosforge.org
Mon Mar 7 19:03:06 PST 2011


Revision: 7131
          http://trac.macosforge.org/projects/calendarserver/changeset/7131
Author:   glyph at apple.com
Date:     2011-03-07 19:03:06 -0800 (Mon, 07 Mar 2011)
Log Message:
-----------
"Delete Using" isn't supported in oracle, so remove it.

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/oracle/twext/enterprise/dal/syntax.py
    CalendarServer/branches/users/glyph/oracle/twext/enterprise/dal/test/test_sqlsyntax.py
    CalendarServer/branches/users/glyph/oracle/txdav/common/datastore/sql_legacy.py

Modified: CalendarServer/branches/users/glyph/oracle/twext/enterprise/dal/syntax.py
===================================================================
--- CalendarServer/branches/users/glyph/oracle/twext/enterprise/dal/syntax.py	2011-03-08 03:02:54 UTC (rev 7130)
+++ CalendarServer/branches/users/glyph/oracle/twext/enterprise/dal/syntax.py	2011-03-08 03:03:06 UTC (rev 7131)
@@ -853,23 +853,17 @@
     'delete' statement.
     """
 
-    def __init__(self, From, Where, Return=None, Using=None):
+    def __init__(self, From, Where, Return=None):
         self.From = From
         self.Where = Where
         self.Return = Return
-        self.Using = Using
 
 
     def _toSQL(self, metadata):
         result = SQLFragment()
         allTables = self.From.tables()
-        if self.Using is not None:
-            allTables += self.Using.tables()
         result.text += 'delete from '
         result.append(self.From.subSQL(metadata, allTables))
-        if self.Using is not None:
-            result.text += ' using '
-            result.append(self.Using.subSQL(metadata, allTables))
         result.text += ' where '
         result.append(self.Where.subSQL(metadata, allTables))
         if self.Return is not None:

Modified: CalendarServer/branches/users/glyph/oracle/twext/enterprise/dal/test/test_sqlsyntax.py
===================================================================
--- CalendarServer/branches/users/glyph/oracle/twext/enterprise/dal/test/test_sqlsyntax.py	2011-03-08 03:02:54 UTC (rev 7130)
+++ CalendarServer/branches/users/glyph/oracle/twext/enterprise/dal/test/test_sqlsyntax.py	2011-03-08 03:03:06 UTC (rev 7131)
@@ -274,24 +274,6 @@
         )
 
 
-    def test_deleteUsing(self):
-        """
-        L{Delete}'s C{Using} parameter works similarly to the C{From} parameter
-        to L{Select}.
-        """
-        f = self.schema.FOO
-        o = self.schema.OTHER
-        self.assertEquals(
-            Delete(From=f, Using=o,
-                   Where=(f.BAR == o.BAR).And(o.FOO_BAR == 7)).toSQL(),
-            SQLFragment(
-                "delete from FOO using OTHER where FOO.BAR = OTHER.BAR and "
-                "FOO_BAR = ?",
-                [7]
-            )
-        )
-
-
     def test_columnSelection(self):
         """
         If a column is specified by the argument to L{Select}, those will be

Modified: CalendarServer/branches/users/glyph/oracle/txdav/common/datastore/sql_legacy.py
===================================================================
--- CalendarServer/branches/users/glyph/oracle/txdav/common/datastore/sql_legacy.py	2011-03-08 03:02:54 UTC (rev 7130)
+++ CalendarServer/branches/users/glyph/oracle/txdav/common/datastore/sql_legacy.py	2011-03-08 03:03:06 UTC (rev 7131)
@@ -365,9 +365,10 @@
     def _deleteOneBindQuery(cls, constraint):
         inv = schema.INVITE
         bind = cls._bindSchema
-        return Delete(From=bind, Using=inv, Where=constraint
-                      .And(bind.HOME_RESOURCE_ID == inv.HOME_RESOURCE_ID)
-                      .And(bind.RESOURCE_ID == inv.RESOURCE_ID))
+        return Delete(
+            From=bind, Where=(bind.HOME_RESOURCE_ID, bind.RESOURCE_ID) ==
+            Select([inv.HOME_RESOURCE_ID, inv.RESOURCE_ID],
+                   From=inv, Where=constraint))
 
 
     @classmethod
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110307/f961c016/attachment-0001.html>


More information about the calendarserver-changes mailing list