[Sqlalchemy-tickets] [sqlalchemy] #2812: has_table/drop/etc. not really checking the "quote" flag f
Brought to you by:
zzzeek
From: sqlalchemy <mi...@zz...> - 2013-08-26 22:27:15
|
#2812: has_table/drop/etc. not really checking the "quote" flag for an uppercase engine and it probably cant --------------------+------------------------------------ Reporter: zzzeek | Owner: zzzeek Type: defect | Status: new Priority: high | Milestone: 0.8.xx Component: schema | Severity: major - 1-3 hours Keywords: | Progress State: in queue --------------------+------------------------------------ {{{ #!diff 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}, }}} -- Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2812> sqlalchemy <http://www.sqlalchemy.org/> The Database Toolkit for Python |