]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
deep compare CTEs before considering them conflicting
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 5 Aug 2022 21:25:05 +0000 (17:25 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 5 Aug 2022 21:26:49 +0000 (17:26 -0400)
commit7914b6491b31e07d2aa0313a97a0ded27627da07
tree541d8247578af79dc69910cfa7df550914ea86f6
parentbb954d40a12c81b1867474d7c6fd300a31382ec2
deep compare CTEs before considering them conflicting

Fixed issue where referencing a CTE multiple times in conjunction with a
polymorphic SELECT could result in multiple "clones" of the same CTE being
constructed, which would then trigger these two CTEs as duplicates. To
resolve, the two CTEs are deep-compared when this occurs to ensure that
they are equivalent, then are treated as equivalent.

Fixes: #8357
Change-Id: I1f634a9cf7a6c4256912aac1a00506aecea3b0e2
(cherry picked from commit 85fa363c846f4ed287565c43c32e2cca29470e25)
doc/build/changelog/unreleased_14/8357.rst [new file with mode: 0644]
lib/sqlalchemy/sql/compiler.py
test/orm/inheritance/test_polymorphic_rel.py
test/sql/test_cte.py