diff options
author | Mike Bayer <classic@zzzcomputing.com> | 2014-05-12 11:38:24 -0400 |
---|---|---|
committer | Mike Bayer <classic@zzzcomputing.com> | 2014-05-12 11:38:24 -0400 |
commit | 0a08177b5993d47e8a21b26f3be8909432ab66b6 (patch) | |
tree | ffc1f4f01758d29efadd39529b9aa79ba73e7a6a | |
parent | 1abd53a3556b9593d9eba868d69c13bae3c3a7ab (diff) | |
parent | c5a95ea8e37bfc98d5c9593638dc0c0e32351c72 (diff) | |
download | sqlalchemy-0a08177b5993d47e8a21b26f3be8909432ab66b6.tar.gz |
Merged in WSMcG/sqlalchemy (pull request #15)
Added optional '=' to MySQL KEY_BLOCK_SIZE regex
-rw-r--r-- | lib/sqlalchemy/dialects/mysql/base.py | 2 | ||||
-rw-r--r-- | test/dialect/mysql/test_reflection.py | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py index ba6e7b625..85cbd6e22 100644 --- a/lib/sqlalchemy/dialects/mysql/base.py +++ b/lib/sqlalchemy/dialects/mysql/base.py @@ -2951,7 +2951,7 @@ class MySQLTableDefinitionParser(object): r'(?: +USING +(?P<using_pre>\S+))?' r' +\((?P<columns>.+?)\)' r'(?: +USING +(?P<using_post>\S+))?' - r'(?: +KEY_BLOCK_SIZE +(?P<keyblock>\S+))?' + r'(?: +KEY_BLOCK_SIZE *[ =]? *(?P<keyblock>\S+))?' r'(?: +WITH PARSER +(?P<parser>\S+))?' r',?$' % quotes diff --git a/test/dialect/mysql/test_reflection.py b/test/dialect/mysql/test_reflection.py index 7494eaf43..c8fdc9310 100644 --- a/test/dialect/mysql/test_reflection.py +++ b/test/dialect/mysql/test_reflection.py @@ -297,6 +297,10 @@ class RawReflectionTest(fixtures.TestBase): assert regex.match(' PRIMARY KEY (`id`)') assert regex.match(' PRIMARY KEY USING BTREE (`id`)') assert regex.match(' PRIMARY KEY (`id`) USING BTREE') + assert regex.match(' PRIMARY KEY (`id`) USING BTREE KEY_BLOCK_SIZE 16') + assert regex.match(' PRIMARY KEY (`id`) USING BTREE KEY_BLOCK_SIZE=16') + assert regex.match(' PRIMARY KEY (`id`) USING BTREE KEY_BLOCK_SIZE = 16') + assert not regex.match(' PRIMARY KEY (`id`) USING BTREE KEY_BLOCK_SIZE = = 16') def test_fk_reflection(self): regex = self.parser._re_constraint |