summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql/test_compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2016-11-07 21:41:11 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2016-11-07 22:03:16 -0500
commit942c2429c033255979b6a55de836b9b26370673e (patch)
tree6d0d97312a67814cda5d39cf23d09b1360b5884b /test/dialect/postgresql/test_compiler.py
parentc4a8afa4c6bf5e76c24e8ed0b5c11acc0c8904e3 (diff)
downloadsqlalchemy-942c2429c033255979b6a55de836b9b26370673e.tar.gz
Put include_table=True for DO UPDATE..WHERE, but not ON CONFLICT
Fixed regression caused by the fix in :ticket:`3807` (version 1.1.0) where we ensured that the tablename was qualified in the WHERE clause of the DO UPDATE portion of PostgreSQL's ON CONFLICT, however you *cannot* put the table name in the WHERE clause in the actual ON CONFLICT itself. This was an incorrect assumption, so that portion of the change in :ticket:`3807` is rolled back. Change-Id: I442d8629496a8e405b54711cfcf487761810ae8a Fixes: #3846 Fixes: #3807
Diffstat (limited to 'test/dialect/postgresql/test_compiler.py')
-rw-r--r--test/dialect/postgresql/test_compiler.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py
index 52dd699fc..3e7f584bf 100644
--- a/test/dialect/postgresql/test_compiler.py
+++ b/test/dialect/postgresql/test_compiler.py
@@ -1205,7 +1205,7 @@ class InsertOnConflictTest(fixtures.TestBase, AssertsCompiledSQL):
self.assert_compile(i,
'INSERT INTO mytable (name) VALUES '
"(%(name)s) ON CONFLICT (name) "
- "WHERE mytable.name > %(name_1)s "
+ "WHERE name > %(name_1)s "
'DO UPDATE SET name = excluded.name')
def test_do_update_index_elements_where_target_multivalues(self):
@@ -1223,7 +1223,7 @@ class InsertOnConflictTest(fixtures.TestBase, AssertsCompiledSQL):
"INSERT INTO mytable (name) "
"VALUES (%(name_m0)s), (%(name_m1)s), (%(name_m2)s) "
"ON CONFLICT (name) "
- "WHERE mytable.name > %(name_1)s "
+ "WHERE name > %(name_1)s "
"DO UPDATE SET name = excluded.name",
checkparams={
'name_1': 'm', 'name_m0': 'foo',
@@ -1246,7 +1246,7 @@ class InsertOnConflictTest(fixtures.TestBase, AssertsCompiledSQL):
self.assert_compile(i,
'INSERT INTO mytable (name) VALUES '
"(%(name)s) ON CONFLICT (name) "
- "WHERE mytable.name > %(name_1)s "
+ "WHERE name > %(name_1)s "
'DO UPDATE SET name = excluded.name')
def test_do_update_unnamed_exclude_constraint_target(self):
@@ -1259,7 +1259,7 @@ class InsertOnConflictTest(fixtures.TestBase, AssertsCompiledSQL):
self.assert_compile(i,
'INSERT INTO mytable (name) VALUES '
"(%(name)s) ON CONFLICT (name, description) "
- "WHERE mytable.description != %(description_1)s "
+ "WHERE description != %(description_1)s "
'DO UPDATE SET name = excluded.name')
def test_do_update_add_whereclause(self):
@@ -1275,7 +1275,7 @@ class InsertOnConflictTest(fixtures.TestBase, AssertsCompiledSQL):
self.assert_compile(i,
'INSERT INTO mytable (name) VALUES '
"(%(name)s) ON CONFLICT (name, description) "
- "WHERE mytable.description != %(description_1)s "
+ "WHERE description != %(description_1)s "
'DO UPDATE SET name = excluded.name '
"WHERE mytable.name != %(name_1)s "
"AND mytable.description != %(description_2)s")
@@ -1292,7 +1292,7 @@ class InsertOnConflictTest(fixtures.TestBase, AssertsCompiledSQL):
self.assert_compile(i,
'INSERT INTO mytable (name) VALUES '
"(%(name)s) ON CONFLICT (name, description) "
- "WHERE mytable.description != %(description_1)s "
+ "WHERE description != %(description_1)s "
'DO UPDATE SET name = excluded.name '
"WHERE mytable.name != excluded.name")