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_8_7~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41a334b3d8fa5557376d21f7bc254e4d043e0c8e;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 edc382bdce..91a8608785 100644 --- a/lib/sqlalchemy/dialects/mysql/base.py +++ b/lib/sqlalchemy/dialects/mysql/base.py @@ -2888,7 +2888,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 b9e347d415..ccdf71c4c1 100644 --- a/test/dialect/mysql/test_reflection.py +++ b/test/dialect/mysql/test_reflection.py @@ -297,4 +297,8 @@ 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')