From e5f1a3fb7dc1888ed187fdeae8171e4ff322dab6 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 11 Feb 2016 12:12:19 -0500 Subject: - CTE functionality has been expanded to support all DML, allowing INSERT, UPDATE, and DELETE statements to both specify their own WITH clause, as well as for these statements themselves to be CTE expressions when they include a RETURNING clause. fixes #2551 --- test/sql/test_insert.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test/sql/test_insert.py') diff --git a/test/sql/test_insert.py b/test/sql/test_insert.py index ea4de032c..513757d5b 100644 --- a/test/sql/test_insert.py +++ b/test/sql/test_insert.py @@ -188,9 +188,10 @@ class InsertTest(_InsertTestBase, fixtures.TablesTest, AssertsCompiledSQL): from_select(("otherid", "othername"), sel) self.assert_compile( ins, - "INSERT INTO myothertable (otherid, othername) WITH anon_1 AS " + "WITH anon_1 AS " "(SELECT mytable.name AS name FROM mytable " "WHERE mytable.name = :name_1) " + "INSERT INTO myothertable (otherid, othername) " "SELECT mytable.myid, mytable.name FROM mytable, anon_1 " "WHERE mytable.name = anon_1.name", checkparams={"name_1": "bar"} @@ -205,9 +206,9 @@ class InsertTest(_InsertTestBase, fixtures.TablesTest, AssertsCompiledSQL): self.assert_compile( ins, - "INSERT INTO mytable (myid, name, description) " "WITH c AS (SELECT mytable.myid AS myid, mytable.name AS name, " "mytable.description AS description FROM mytable) " + "INSERT INTO mytable (myid, name, description) " "SELECT c.myid, c.name, c.description FROM c" ) -- cgit v1.2.1