diff options
Diffstat (limited to 'test/dialect/mssql/test_compiler.py')
-rw-r--r-- | test/dialect/mssql/test_compiler.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/dialect/mssql/test_compiler.py b/test/dialect/mssql/test_compiler.py index 1f4a4da4b..d62753b9d 100644 --- a/test/dialect/mssql/test_compiler.py +++ b/test/dialect/mssql/test_compiler.py @@ -139,6 +139,23 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): "sometable.somecolumn = :somecolumn_1" ) + def test_delete_extra_froms(self): + t1 = table('t1', column('c1')) + t2 = table('t2', column('c1')) + q = sql.delete(t1).where(t1.c.c1 == t2.c.c1) + self.assert_compile( + q, "DELETE FROM t1 FROM t1, t2 WHERE t1.c1 = t2.c1" + ) + + def test_delete_extra_froms_alias(self): + a1 = table('t1', column('c1')).alias('a1') + t2 = table('t2', column('c1')) + q = sql.delete(a1).where(a1.c.c1 == t2.c.c1) + self.assert_compile( + q, "DELETE FROM a1 FROM t1 AS a1, t2 WHERE a1.c1 = t2.c1" + ) + self.assert_compile(sql.delete(a1), "DELETE FROM t1 AS a1") + def test_update_from_hint(self): t = table('sometable', column('somecolumn')) t2 = table('othertable', column('somecolumn')) |