From: W. Sean McGivern Date: Sat, 19 Apr 2014 16:16:46 +0000 (-0400) Subject: Added optional '=' to MySQL KEY_BLOCK_SIZE regex X-Git-Tag: rel_0_9_5~60^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c5a95ea8e37bfc98d5c9593638dc0c0e32351c72;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Added optional '=' to MySQL KEY_BLOCK_SIZE regex --- diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py index ba6e7b6258..85cbd6e223 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\S+))?' r' +\((?P.+?)\)' r'(?: +USING +(?P\S+))?' - r'(?: +KEY_BLOCK_SIZE +(?P\S+))?' + r'(?: +KEY_BLOCK_SIZE *[ =]? *(?P\S+))?' r'(?: +WITH PARSER +(?P\S+))?' r',?$' % quotes diff --git a/test/dialect/mysql/test_reflection.py b/test/dialect/mysql/test_reflection.py index 7494eaf431..c8fdc9310b 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