]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Fixed OurSQL dialect to use ansi-neutral
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 24 Jul 2011 16:50:14 +0000 (12:50 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 24 Jul 2011 16:50:14 +0000 (12:50 -0400)
quote symbol "'" for XA commands instead
of '"'.  [ticket:2186].  Also in 0.6.9.

CHANGES
lib/sqlalchemy/dialects/mysql/oursql.py

diff --git a/CHANGES b/CHANGES
index 24ce33f287da1f37d65ac6037a755de9db6a469e..15c530fe5d2189590406eb9f8d38f1ce116659be 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -168,6 +168,11 @@ CHANGES
     operator classes for indexed columns.
     [ticket:2198]  Courtesy Filip Zyzniewski.
 
+- mysql
+  - Fixed OurSQL dialect to use ansi-neutral 
+    quote symbol "'" for XA commands instead
+    of '"'.  [ticket:2186].  Also in 0.6.9.
+
 - mssql
   - Adjusted the pyodbc dialect such that bound
     values are passed as bytes and not unicode
index 4ea4f56bedcaf7c180cf5fd536f0a3a88a919f7d..2678d9dc92896b76ec5d0770b7fd59586588bc4b 100644 (file)
@@ -105,6 +105,7 @@ class MySQLDialect_oursql(MySQLDialect):
 # Py3K
 #        charset = self._connection_charset
 #        arg = connection.connection._escape_string(xid.encode(charset)).decode(charset)
+        arg = "'%s'" % arg
         connection.execution_options(_oursql_plain_query=True).execute(query % arg)
 
     # Because mysql is bad, these methods have to be 
@@ -113,23 +114,23 @@ class MySQLDialect_oursql(MySQLDialect):
     # the parameterized query API, or refuse to be parameterized
     # in the first place.
     def do_begin_twophase(self, connection, xid):
-        self._xa_query(connection, 'XA BEGIN "%s"', xid)
+        self._xa_query(connection, 'XA BEGIN %s', xid)
 
     def do_prepare_twophase(self, connection, xid):
-        self._xa_query(connection, 'XA END "%s"', xid)
-        self._xa_query(connection, 'XA PREPARE "%s"', xid)
+        self._xa_query(connection, 'XA END %s', xid)
+        self._xa_query(connection, 'XA PREPARE %s', xid)
 
     def do_rollback_twophase(self, connection, xid, is_prepared=True,
                              recover=False):
         if not is_prepared:
-            self._xa_query(connection, 'XA END "%s"', xid)
-        self._xa_query(connection, 'XA ROLLBACK "%s"', xid)
+            self._xa_query(connection, 'XA END %s', xid)
+        self._xa_query(connection, 'XA ROLLBACK %s', xid)
 
     def do_commit_twophase(self, connection, xid, is_prepared=True,
                            recover=False):
         if not is_prepared:
             self.do_prepare_twophase(connection, xid)
-        self._xa_query(connection, 'XA COMMIT "%s"', xid)
+        self._xa_query(connection, 'XA COMMIT %s', xid)
 
     # Q: why didn't we need all these "plain_query" overrides earlier ?
     # am i on a newer/older version of OurSQL ?