]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Added optional '=' to MySQL KEY_BLOCK_SIZE regex
authorW. Sean McGivern <WSMcGivern@gmail.com>
Sat, 19 Apr 2014 16:16:46 +0000 (12:16 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 12 May 2014 15:40:23 +0000 (11:40 -0400)
lib/sqlalchemy/dialects/mysql/base.py
test/dialect/mysql/test_reflection.py

index edc382bdce943bc99d824d3c62ac66bb23fcae9d..91a86087859a8bf2cb0f55f241ffd2d56df4a742 100644 (file)
@@ -2888,7 +2888,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
index b9e347d415ff5dd7ae2600cbce55afa8833c19f7..ccdf71c4c16fb14e34963be3148a2b6b2c522eb6 100644 (file)
@@ -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')