From 7b056709c0f8a37744d18f37d40f94fa30c50c71 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 15 Mar 2017 10:15:12 -0400 Subject: Consult compiled paramstyle on execute_compiled Fixed bug where in the unusual case of passing a :class:`.Compiled` object directly to :meth:`.Connection.execute`, the dialect with which the :class:`.Compiled` object were generated was not consulted for the paramstyle of the string statement, instead assuming it would match the dialect-level paramstyle, causing mismatches to occur. Change-Id: I114e4db2183fbb75bb7c0b0641f5a161855696ee Fixes: #3938 --- lib/sqlalchemy/engine/default.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/engine/default.py') diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py index b8c2d2845..3968663fb 100644 --- a/lib/sqlalchemy/engine/default.py +++ b/lib/sqlalchemy/engine/default.py @@ -627,7 +627,7 @@ class DefaultExecutionContext(interfaces.ExecutionContext): # into a dict or list to be sent to the DBAPI's # execute() or executemany() method. parameters = [] - if dialect.positional: + if compiled.positional: for compiled_params in self.compiled_parameters: param = [] for key in self.compiled.positiontup: -- cgit v1.2.1