]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
render WITH clause after INSERT for INSERT..SELECT on Oracle, MySQL
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 15 Jun 2018 02:17:00 +0000 (22:17 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 18 Jun 2018 13:13:03 +0000 (09:13 -0400)
commit6529c474af1a978771364092fbc6d2fbfe804067
tree7f8c157a23d0b226a2fbf8ae9388d4c6d9789555
parentbfe993161987a2c3de9321f3e8531901142a654b
render WITH clause after INSERT for INSERT..SELECT on Oracle, MySQL

Fixed INSERT FROM SELECT with CTEs for the Oracle and MySQL dialects, where
the CTE was being placed above the entire statement as is typical with
other databases, however Oracle and MariaDB 10.2 wants the CTE underneath
the "INSERT" segment. Note that the Oracle and MySQL dialects don't yet
work when a CTE is applied to a subquery inside of an UPDATE or DELETE
statement, as the CTE is still applied to the top rather than inside the
subquery.

Also adds test suite support CTEs against backends.

Change-Id: I8ac337104d5c546dd4f0cd305632ffb56ac8bf90
Fixes: #4275
Fixes: #4230
(cherry picked from commit 3619edcb8aa3ceef2a44925b85315fc0e90c5982)
12 files changed:
doc/build/changelog/unreleased_12/4275.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mysql/base.py
lib/sqlalchemy/dialects/oracle/base.py
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/testing/requirements.py
lib/sqlalchemy/testing/suite/__init__.py
lib/sqlalchemy/testing/suite/test_cte.py [new file with mode: 0644]
lib/sqlalchemy/testing/suite/test_select.py
test/requirements.py
test/sql/test_defaults.py
test/sql/test_insert.py