summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Johnston <paj@pajhome.org.uk>2008-02-08 16:48:37 +0000
committerPaul Johnston <paj@pajhome.org.uk>2008-02-08 16:48:37 +0000
commit21c29768706ff47631ffae7a59858cf802fa3286 (patch)
tree7e524819746b9f25bf04574ea3f2de3cfca06451 /test
parent2999ea9554b0664b5c0c9670920abe7d3b2f7e0e (diff)
downloadsqlalchemy-21c29768706ff47631ffae7a59858cf802fa3286.tar.gz
Fix: deletes with schemas on MSSQL 2000 [ticket:967]
Diffstat (limited to 'test')
-rwxr-xr-xtest/dialect/mssql.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/dialect/mssql.py b/test/dialect/mssql.py
index 046fede10..5a7707052 100755
--- a/test/dialect/mssql.py
+++ b/test/dialect/mssql.py
@@ -56,6 +56,11 @@ class CompileTest(SQLCompileTest):
self.assert_compile(table1.join(table4, table1.c.myid==table4.c.rem_id).select(), "SELECT mytable.myid, mytable.name, mytable.description, remotetable_1.rem_id, remotetable_1.datatype_id, remotetable_1.value FROM mytable JOIN remote_owner.remotetable AS remotetable_1 ON remotetable_1.rem_id = mytable.myid")
+ def test_delete_schema(self):
+ metadata = MetaData()
+ tbl = Table('test', metadata, Column('id', Integer, primary_key=True), schema='paj')
+ self.assert_compile(tbl.delete(tbl.c.id == 1), "DELETE FROM paj.test WHERE paj.test.id = :test_id_1")
+
def test_union(self):
t1 = table('t1',
column('col1'),
@@ -149,6 +154,19 @@ class QueryTest(PersistTest):
tbl.drop()
con.execute('drop schema paj')
+ def test_delete_schema(self):
+ meta = MetaData(testing.db)
+ con = testing.db.connect()
+ con.execute('create schema paj')
+ tbl = Table('test', meta, Column('id', Integer, primary_key=True), schema='paj')
+ tbl.create()
+ try:
+ tbl.insert().execute({'id':1})
+ tbl.delete(tbl.c.id == 1).execute()
+ finally:
+ tbl.drop()
+ con.execute('drop schema paj')
+
def test_insertid_reserved(self):
meta = MetaData(testing.db)
table = Table(