]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Changed bind parameters to be passed as a tuple. Some drivers don't like to receive...
authorMichael Trier <mtrier@gmail.com>
Fri, 26 Feb 2010 19:05:00 +0000 (19:05 +0000)
committerMichael Trier <mtrier@gmail.com>
Fri, 26 Feb 2010 19:05:00 +0000 (19:05 +0000)
lib/sqlalchemy/engine/default.py
test/engine/test_execute.py

index 5499b34e75b1caeb000d02ed60b82ec4876e45dc..74562a70e3f8944516fabe9d9db051e7592141e8 100644 (file)
@@ -419,7 +419,7 @@ class DefaultExecutionContext(base.ExecutionContext):
                         param.append(processors[key](compiled_params[key]))
                     else:
                         param.append(compiled_params[key])
-                parameters.append(param)
+                parameters.append(tuple(param))
         else:
             encode = not self.dialect.supports_unicode_statements
             for compiled_params in compiled_parameters:
@@ -438,7 +438,7 @@ class DefaultExecutionContext(base.ExecutionContext):
                         else:
                             param[key] = compiled_params[key]
                 parameters.append(param)
-        return parameters
+        return tuple(parameters)
 
     def should_autocommit_text(self, statement):
         return AUTOCOMMIT_REGEXP.match(statement)
index a498508d7e0f8d6210cfad23882877055e5af1a4..4a45fceb311ca82bec6c70b9693dd71d32e99f56 100644 (file)
@@ -151,20 +151,20 @@ class ProxyConnectionTest(TestBase):
             if not testing.against('oracle+zxjdbc'): # or engine.dialect.preexecute_pk_sequences:
                 cursor = [
                     ("CREATE TABLE t1", {}, ()),
-                    ("INSERT INTO t1 (c1, c2)", {'c2': 'some data', 'c1': 5}, [5, 'some data']),
-                    ("SELECT lower", {'lower_2':'Foo'}, ['Foo']),
-                    ("INSERT INTO t1 (c1, c2)", {'c2': 'foo', 'c1': 6}, [6, 'foo']),
+                    ("INSERT INTO t1 (c1, c2)", {'c2': 'some data', 'c1': 5}, (5, 'some data')),
+                    ("SELECT lower", {'lower_2':'Foo'}, ('Foo',)),
+                    ("INSERT INTO t1 (c1, c2)", {'c2': 'foo', 'c1': 6}, (6, 'foo')),
                     ("select * from t1", {}, ()),
                     ("DROP TABLE t1", {}, ())
                 ]
             else:
-                insert2_params = [6, 'Foo']
+                insert2_params = (6, 'Foo')
                 if testing.against('oracle+zxjdbc'):
                     from sqlalchemy.dialects.oracle.zxjdbc import ReturningParam
                     insert2_params.append(ReturningParam(12))
                 cursor = [
                     ("CREATE TABLE t1", {}, ()),
-                    ("INSERT INTO t1 (c1, c2)", {'c2': 'some data', 'c1': 5}, [5, 'some data']),
+                    ("INSERT INTO t1 (c1, c2)", {'c2': 'some data', 'c1': 5}, (5, 'some data')),
                     ("INSERT INTO t1 (c1, c2)", {'c1': 6, "lower_2":"Foo"}, insert2_params),  # bind param name 'lower_2' might be incorrect
                     ("select * from t1", {}, ()),
                     ("DROP TABLE t1", {}, ())