summaryrefslogtreecommitdiff
path: root/test/dialect/test_mysql.py
diff options
context:
space:
mode:
authorJeff Dairiki <dairiki@dairiki.org>2012-04-06 21:55:39 -0700
committerJeff Dairiki <dairiki@dairiki.org>2012-04-06 21:55:39 -0700
commitb7abf86f72e62644846dfd540bcceae7959cd046 (patch)
tree83f56d53b498f9089b14b8eff1d37fbd7c18785d /test/dialect/test_mysql.py
parent4cb74452fe551c3d4f0dd305bee1e69dbdccd99a (diff)
downloadsqlalchemy-b7abf86f72e62644846dfd540bcceae7959cd046.tar.gz
Fix innodb autoinc constraint (double)quoting
Diffstat (limited to 'test/dialect/test_mysql.py')
-rw-r--r--test/dialect/test_mysql.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/dialect/test_mysql.py b/test/dialect/test_mysql.py
index 462267b46..613fac7c3 100644
--- a/test/dialect/test_mysql.py
+++ b/test/dialect/test_mysql.py
@@ -1411,7 +1411,7 @@ class SQLTest(fixtures.TestBase, AssertsCompiledSQL):
'CREATE TABLE sometable (assigned_id '
'INTEGER NOT NULL, id INTEGER NOT NULL '
'AUTO_INCREMENT, PRIMARY KEY (assigned_id, '
- 'id), KEY `idx_autoinc_id`(`id`))ENGINE=Inn'
+ 'id), KEY `idx_autoinc_id`(id))ENGINE=Inn'
'oDB')
t1 = Table('sometable', MetaData(), Column('assigned_id',
@@ -1424,6 +1424,22 @@ class SQLTest(fixtures.TestBase, AssertsCompiledSQL):
'INTEGER NOT NULL, PRIMARY KEY '
'(assigned_id, id))ENGINE=InnoDB')
+ def test_innodb_autoincrement_reserved_word_column_name(self):
+ t1 = Table(
+ 'sometable', MetaData(),
+ Column('id', Integer(), primary_key=True, autoincrement=False),
+ Column('order', Integer(), primary_key=True, autoincrement=True),
+ mysql_engine='InnoDB')
+ self.assert_compile(
+ schema.CreateTable(t1),
+ 'CREATE TABLE sometable ('
+ 'id INTEGER NOT NULL, '
+ '`order` INTEGER NOT NULL AUTO_INCREMENT, '
+ 'PRIMARY KEY (id, `order`), '
+ 'KEY `idx_autoinc_order`(`order`)'
+ ')ENGINE=InnoDB')
+
+
class SQLModeDetectionTest(fixtures.TestBase):
__only_on__ = 'mysql'