has_table/drop/etc. not really checking the "quote" flag for an uppercase engine and it probably cant
Issue #2812
resolved
diff --git a/test/sql/test_quote.py b/test/sql/test_quote.py
index c92f1ac..78c1743 100644
--- a/test/sql/test_quote.py
+++ b/test/sql/test_quote.py
@@ -61,6 +61,48 @@ class QuoteTest(fixtures.TestBase, AssertsCompiledSQL):
assert 'MixedCase' in t2.c
+ @testing.provide_metadata
+ def test_has_table_case_sensitive(self):
+ # get it to work on oracle...
+ m = MetaData(testing.db)
+ Table("tab1", m).drop(checkfirst=True)
+ #Table("tab2", m).drop(checkfirst=True)
+ Table("tab2", m, quote=True).drop()
+ #######
+
+ if testing.db.dialect.requires_name_normalize:
+ testing.db.execute("CREATE TABLE TAB1 (id INTEGER)")
+ testing.db.execute('CREATE TABLE "tab2" (id INTEGER)')
+ testing.db.execute('CREATE TABLE "TAB3" (id INTEGER)')
+ testing.db.execute('CREATE TABLE "TAB4" (id INTEGER)')
+ else:
+ testing.db.execute("CREATE TABLE tab1 (id INTEGER)")
+ testing.db.execute('CREATE TABLE "tab2" (id INTEGER)')
+ testing.db.execute('CREATE TABLE "TAB3" (id INTEGER)')
+ testing.db.execute('CREATE TABLE "TAB4" (id INTEGER)')
+
+ t1 = Table('tab1', self.metadata,
+ Column('id', Integer, primary_key=True),
+ #quote=False
+ )
+ t2 = Table('tab2', self.metadata,
+ Column('id', Integer, primary_key=True),
+ quote=True
+ )
+ t3 = Table('TAB3', self.metadata,
+ Column('id', Integer, primary_key=True),
+ #quote=False
+ )
+ t4 = Table('TAB4', self.metadata,
+ Column('id', Integer, primary_key=True),
+ quote=True)
+
+ assert testing.db.has_table(t1.name)
+ assert testing.db.has_table(t2.name)
+ assert testing.db.has_table(t3.name)
+ assert testing.db.has_table(t4.name)
+
+
def test_basic(self):
table1.insert().execute(
{'lowercase': 1, 'UPPERCASE': 2, 'MixedCase': 3, 'a123': 4},
Comments (3)
-
reporter -
reporter the quoted_name workaround is possible to use in 0.8, so this doesn't need to be backported.
the primary merge is in 031ef0807838842a827135dbace760.
-
reporter - removed milestone
Removing milestone: 0.9.0 (automated comment)
- Log in to comment
here's a quick proof of concept that's making me wonder, do we just create a "case sensitive" string object right as we create Table, Sequence, Column, Index, and just leave it at that? we'd need to see how identifierpreparer and others feel about that. this allows PG and Oracle to work: