diff options
author | W. Sean McGivern <WSMcGivern@gmail.com> | 2014-04-19 12:16:46 -0400 |
---|---|---|
committer | W. Sean McGivern <WSMcGivern@gmail.com> | 2014-04-19 12:16:46 -0400 |
commit | c5a95ea8e37bfc98d5c9593638dc0c0e32351c72 (patch) | |
tree | 1d8b90ac41b0d354c2070484b7ddaad3dafd84a8 | |
parent | 1fb4ad75a38ce84d0e7b170927025500b73b5519 (diff) | |
download | sqlalchemy-c5a95ea8e37bfc98d5c9593638dc0c0e32351c72.tar.gz |
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 |