mssql dialect blows away keyname on schema

Issue #2607 resolved
Mike Bayer repo owner created an issue
diff -r b65736fdf65eeb08e724884f1f549c36acff6568 test/sql/test_query.py
--- a/test/sql/test_query.py    Mon Nov 12 16:36:20 2012 -0500
+++ b/test/sql/test_query.py    Tue Nov 13 23:25:21 2012 -0500
@@ -1569,6 +1569,13 @@
             Column('ctype', String(30), key="content_type")
         )

+        if testing.requires.schemas.enabled:
+            wschema = Table('wschema', metadata,
+                Column("a", CHAR(2), key="b"),
+                Column("c", CHAR(2), key="q"),
+                schema="test_schema"
+            )
+
     @classmethod
     def insert_data(cls):
         cls.tables.keyed1.insert().execute(dict(b="a1", q="c1"))
@@ -1577,6 +1584,20 @@
         cls.tables.keyed4.insert().execute(dict(b="b4", q="q4"))
         cls.tables.content.insert().execute(type="t1")

+        if testing.requires.schemas.enabled:
+            cls.tables['test_schema.wschema']('test_schema.wschema').insert().execute(dict(b="a1", q="c1"))
+
+    @testing.requires.schemas
+    def test_keyed_accessor_wschema(self):
+        keyed1 = self.tables['test_schema.wschema']('test_schema.wschema')
+        row = testing.db.execute(keyed1.select()).first()
+
+        eq_(row.b, "a1")
+        eq_(row.q, "c1")
+        eq_(row.a, "a1")
+        eq_(row.c, "c1")
+
+
     def test_keyed_accessor_single(self):
         keyed1 = self.tables.keyed1
         row = testing.db.execute(keyed1.select()).first()

Comments (2)

  1. Log in to comment