]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
The cx_oracle dialect will no longer run the bind parameter names
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 8 Feb 2013 17:42:36 +0000 (12:42 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 8 Feb 2013 17:42:36 +0000 (12:42 -0500)
through ``encode()``, as this is not valid on Python 3, and prevented
statements from functioning correctly on Python 3.  We now
encode only if ``supports_unicode_binds`` is False, which is not
the case for cx_oracle when at least version 5 of cx_oracle is used.

doc/build/changelog/changelog_08.rst
lib/sqlalchemy/engine/default.py

index d3031e5e207273e88cd578375c162c2eb5688b4a..296141c79914ffdca3440a2977581d400317b599 100644 (file)
@@ -6,6 +6,15 @@
 .. changelog::
     :version: 0.8.0
 
+    .. change::
+        :tags: bug, oracle
+
+      The cx_oracle dialect will no longer run the bind parameter names
+      through ``encode()``, as this is not valid on Python 3, and prevented
+      statements from functioning correctly on Python 3.  We now
+      encode only if ``supports_unicode_binds`` is False, which is not
+      the case for cx_oracle when at least version 5 of cx_oracle is used.
+
     .. change::
         :tags: bug, orm
         :tickets: 2661
index 918b452137b7245e47aee208957c3d3d265d4e17..1db0f2ce4a69ce881ee7506d6aaf639379296d97 100644 (file)
@@ -744,7 +744,9 @@ class DefaultExecutionContext(interfaces.ExecutionContext):
                         (not exclude_types or dbtype not in exclude_types):
                     if translate:
                         key = translate.get(key, key)
-                    inputsizes[self.dialect._encoder(key)[0]] = dbtype
+                    if not self.dialect.supports_unicode_binds:
+                        key = self.dialect._encoder(key)[0]
+                    inputsizes[key] = dbtype
             try:
                 self.cursor.setinputsizes(**inputsizes)
             except Exception, e: