]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Ensure no compiler visit method tries to access .statement
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 19 Oct 2020 14:19:29 +0000 (10:19 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 19 Oct 2020 16:17:03 +0000 (12:17 -0400)
commit21ccdd0960ab6c928db24891398362b4d1037d23
treef20f18c39d81bdf2586bb04153c222b4850325a2
parent828073553ad7069ca6f9431c06c4e4a3a10fe6e0
Ensure no compiler visit method tries to access .statement

Fixed structural compiler issue where some constructs such as MySQL /
PostgreSQL "on conflict / on duplicate key" would rely upon the state of
the :class:`_sql.Compiler` object being fixed against their statement as
the top level statement, which would fail in cases where those statements
are branched from a different context, such as a DDL construct linked to a
SQL statement.

Fixes: #5656
Change-Id: I568bf40adc7edcf72ea6c7fd6eb9d07790de189e
(cherry picked from commit dfcd117afca36ea3f5f574f9bef6036dae609de8)
doc/build/changelog/unreleased_13/5656.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mysql/base.py
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/testing/assertions.py
test/sql/test_compiler.py