]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
For cases when mxODBC's cursor.execute can't do the job, raise a warning and fall...
authorBrad Allen <bradallen137@gmail.com>
Sun, 21 Mar 2010 04:00:51 +0000 (22:00 -0600)
committerBrad Allen <bradallen137@gmail.com>
Sun, 21 Mar 2010 04:00:51 +0000 (22:00 -0600)
lib/sqlalchemy/connectors/mxodbc.py

index ac7075209c1205fbc3f3fd006dff52f5a6905484..78a1719c109b97cb44dbf4a4d41239a087c095ee 100644 (file)
@@ -126,4 +126,11 @@ class MxODBCConnector(Connector):
                 version.append(n)
         return tuple(version)
 
-
+    def do_execute(self, cursor, statement, parameters, context=None):
+        # temporary workaround until a more comprehensive solution can
+        # be found for controlling when to use executedirect
+        try:
+            cursor.execute(statement, parameters)
+        except (InterfaceError, ProgrammingError), e:
+            warnings.warn("cursor.execute failed; falling back to executedirect")
+            cursor.executedirect(statement, parameters)