summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-10-19 10:19:29 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-10-19 13:13:15 -0400
commit3e49b8d0519aa024842206a2fb664a4ad83796d6 (patch)
tree9eb3cf01a68c42bb77a0bf76e99865d7c6370262 /lib/sqlalchemy/dialects/postgresql/base.py
parent296c84313ab29bf9599634f38caaf7dd092e4e23 (diff)
downloadsqlalchemy-3e49b8d0519aa024842206a2fb664a4ad83796d6.tar.gz
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
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py
index 44272b9d3..ea6921b2d 100644
--- a/lib/sqlalchemy/dialects/postgresql/base.py
+++ b/lib/sqlalchemy/dialects/postgresql/base.py
@@ -2101,7 +2101,7 @@ class PGCompiler(compiler.SQLCompiler):
"Additional column names not matching "
"any column keys in table '%s': %s"
% (
- self.statement.table.name,
+ self.current_executable.table.name,
(", ".join("'%s'" % c for c in set_parameters)),
)
)