From 9de57843a3a98555df21b5c5585f8af699d8ec2e Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 7 Aug 2021 11:02:59 -0400 Subject: dont qualify literal_binds with literal_execute this appears to be unnecessary and prevents end-user literal_binds case from working. Fixed issue where the ``literal_binds`` compiler flag, as used externally to render bound parameters inline, would fail to work when used with a certain class of parameters known as "literal_execute", which covers things like LIMIT and OFFSET values for dialects where the drivers don't allow a bound parameter, such as SQL Server's "TOP" clause. The issue locally seemed to affect only the MSSQL dialect. Fixes: #6863 Change-Id: Ia74cff5b0107b129a11b9b965883552b2962e449 --- lib/sqlalchemy/sql/compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/sql/compiler.py') diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index a81507acb..af15de164 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -2297,7 +2297,7 @@ class SQLCompiler(Compiled): else: post_compile = False - if not literal_execute and (literal_binds): + if literal_binds: ret = self.render_literal_bindparam( bindparam, within_columns_clause=True, **kwargs ) -- cgit v1.2.1