Mike Bayer avatar Mike Bayer committed bcda371

- Fixed OurSQL dialect to use ansi-neutral
quote symbol "'" for XA commands instead
of '"'. [ticket:2186]. Also in 0.6.9.

Comments (0)

Files changed (2)

     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

lib/sqlalchemy/dialects/mysql/oursql.py

 # 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 
     # 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 ?
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.