summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-10-06 18:51:08 -0400
committermike bayer <mike_mp@zzzcomputing.com>2021-10-08 17:09:33 +0000
commitb7226379ac06c9a1a78e783deaa60c701b1b7e88 (patch)
treeea76576d3d9c58684e7bbcc65627a5f99021d636 /lib/sqlalchemy/sql/compiler.py
parent64e6da307c79981119cbd6f95957ead310e3456f (diff)
downloadsqlalchemy-b7226379ac06c9a1a78e783deaa60c701b1b7e88.tar.gz
fixes for usage of the null() and similar constants
Adjusted the "column disambiguation" logic that's new in 1.4, where the same expression repeated gets an "extra anonymous" label, so that the logic more aggressively deduplicates those labels when the repeated element is the same Python expression object each time, as occurs in cases like when using "singleton" values like :func:`_sql.null`. This is based on the observation that at least some databases (e.g. MySQL, but not SQLite) will raise an error if the same label is repeated inside of a subquery. Related to :ticket:`7153`, fixed an issue where result column lookups would fail for "adapted" SELECT statements that selected for "constant" value expressions most typically the NULL expression, as would occur in such places as joined eager loading in conjunction with limit/offset. This was overall a regression due to issue :ticket:`6259` which removed all "adaption" for constants like NULL, "true", and "false", but this broke the case where the same adaption logic were used to match the constant to a labeled expression referring to the constant in a subquery. Fixes: #7153 Fixes: #7154 Change-Id: I43823343721b9e70524ea3f5e8f39dd543a3e92b
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
0 files changed, 0 insertions, 0 deletions