]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
don't count / gather INSERT bind names inside of a CTE
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 29 Jan 2023 00:50:25 +0000 (19:50 -0500)
committerFederico Caselli <cfederico87@gmail.com>
Mon, 30 Jan 2023 21:28:53 +0000 (22:28 +0100)
commitd23dcbaea2a8e000c5fa2ba443e1b683b3b79fa6
tree6b89a07b8bda5a469bf6c8dde165101315f571ed
parentb99b0c522ddb94468da27867ddfa1f7e2633c920
don't count / gather INSERT bind names inside of a CTE

Fixed regression related to the implementation for the new
"insertmanyvalues" feature where an internal ``TypeError`` would occur in
arrangements where a :func:`_sql.insert` would be referred towards inside
of another :func:`_sql.insert` via a CTE; made additional repairs for this
use case for positional dialects such as asyncpg when using
"insertmanyvalues".

at the core here is a change to positional insertmanyvalues
where we now get exactly the positions for the "manyvalues" within
the larger list, allowing non-"manyvalues" on the left and right
sides at the same time, not assuming anything about how RETURNING
renders etc., since CTEs are in the mix also.

Fixes: #9173
Change-Id: I5ff071fbef0d92a2d6046b9c4e609bb008438afd
doc/build/changelog/unreleased_20/9173.rst [new file with mode: 0644]
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/crud.py
test/sql/test_cte.py
test/sql/test_insert_exec.py