diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-11-16 12:45:54 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-11-22 14:06:09 -0500 |
commit | ab84559ca0f4cce1638a00f48295085e18ecaf45 (patch) | |
tree | 7672f7c16e85d3a6d82052d2cc48eec04bb7d70d /lib/sqlalchemy/orm/persistence.py | |
parent | 3fc6c40ea77c971d3067dab0fdf57a5b5313b69b (diff) | |
download | sqlalchemy-ab84559ca0f4cce1638a00f48295085e18ecaf45.tar.gz |
ensure implicit_returning is checked on a Table instance
Fixed regression where flushing a mapped class that's mapped against a
subquery, such as a direct mapping or some forms of concrete table
inheritance, would fail if the :paramref:`_orm.Mapper.eager_defaults`
parameter were used.
mapper.local_table can still be a non-table instance.
correct the check first added in 466ed5b53a3.
Fixes: #8812
Change-Id: I1bb2b83c31b910fbd96fcd3ac43e789b657aebf7
Diffstat (limited to 'lib/sqlalchemy/orm/persistence.py')
-rw-r--r-- | lib/sqlalchemy/orm/persistence.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/persistence.py b/lib/sqlalchemy/orm/persistence.py index dfb61c28a..7fddf7e69 100644 --- a/lib/sqlalchemy/orm/persistence.py +++ b/lib/sqlalchemy/orm/persistence.py @@ -992,7 +992,7 @@ def _emit_insert_statements( or ( has_all_defaults or not base_mapper.eager_defaults - or not base_mapper.local_table.implicit_returning + or not table.implicit_returning or not connection.dialect.insert_returning ) ) |