summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-04-05 16:32:14 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2021-04-05 19:30:19 -0400
commit279d185058ecf322b0c7a1fc8263dbf4da56e9b7 (patch)
tree3f2aea8c95ac3f8a825f974a9228a983af823ba4 /lib/sqlalchemy/sql/compiler.py
parent165c3a65dcb1ba3f42ecf2b5da7c298bdc259f9b (diff)
downloadsqlalchemy-279d185058ecf322b0c7a1fc8263dbf4da56e9b7.tar.gz
uniquify when popping literal_execute_params from param dict
Fixed further issues in the same area as that of :ticket:`6173` released in 1.4.5, where a "postcompile" parameter, again most typically those used for LIMIT/OFFSET rendering in Oracle and SQL Server, would fail to be processed correctly if the same parameter rendered in multiple places in the statement. Fixes: #6202 Change-Id: I95c355aa52a7546fe579ad67f9a8402a213cb79d
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 32530629b..61dfbeb07 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -1137,7 +1137,9 @@ class SQLCompiler(Compiled):
):
parameter = self.binds[name]
if parameter in self.literal_execute_params:
- value = parameters.pop(name)
+ if name not in replacement_expressions:
+ value = parameters.pop(name)
+
replacement_expressions[name] = self.render_literal_bindparam(
parameter, render_literal_value=value
)