diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-03-22 11:56:04 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-03-22 11:56:04 -0400 |
| commit | d856f640b5803d52fa702a750e504990e80d8724 (patch) | |
| tree | 0a53facf650c521086333dbf380d6f59a4aae777 /lib/sqlalchemy/testing | |
| parent | ce4e1770f01a6c19d3a55621529e3f98607d7824 (diff) | |
| download | sqlalchemy-d856f640b5803d52fa702a750e504990e80d8724.tar.gz | |
use clone, not constructor, in BindParameter.render_literal_execute()
Fixed issue where the :meth:`_sql.BindParameter.render_literal_execute`
method would fail when called on a parameter that also had ORM annotations
associated with it. In practice, this would be observed as a failure of SQL
compilation when using some combinations of a dialect that uses "FETCH
FIRST" such as Oracle along with a :class:`_sql.Select` construct that uses
:meth:`_sql.Select.limit`, within some ORM contexts, including if the
statement were embedded within a relationship primaryjoin expression.
Fixes: #9526
Change-Id: I2f512b6760a90293d274e60b06a891f10b276ecc
Diffstat (limited to 'lib/sqlalchemy/testing')
| -rw-r--r-- | lib/sqlalchemy/testing/assertions.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/assertions.py b/lib/sqlalchemy/testing/assertions.py index c66ba71c3..a51d831a9 100644 --- a/lib/sqlalchemy/testing/assertions.py +++ b/lib/sqlalchemy/testing/assertions.py @@ -498,6 +498,7 @@ class AssertsCompiledSQL: default_schema_name=None, from_linting=False, check_param_order=True, + use_literal_execute_for_simple_int=False, ): if use_default_dialect: dialect = default.DefaultDialect() @@ -541,6 +542,9 @@ class AssertsCompiledSQL: if render_postcompile: compile_kwargs["render_postcompile"] = True + if use_literal_execute_for_simple_int: + compile_kwargs["use_literal_execute_for_simple_int"] = True + if for_executemany: kw["for_executemany"] = True |
