[Sqlalchemy-tickets] Issue #3867: MySQL table definition parser warns about valid key definition (z
Brought to you by:
zzzeek
From: Lele L. <iss...@bi...> - 2016-12-02 07:23:14
|
New issue 3867: MySQL table definition parser warns about valid key definition https://bitbucket.org/zzzeek/sqlalchemy/issues/3867/mysql-table-definition-parser-warns-about Lele Long: I am using mysql 5.6.16-log, and SA warns as following: ``` /local/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/reflection.py:56: SAWarning: Unknown schema content: u" KEY `tbl_idx_pk` (`zip_code`,`shop_code`) USING BTREE COMMENT '(null)'," util.warn("Unknown schema content: %r" % line) ``` Code below demonstrates the problem, I have also found no such test case in mysql/test_reflection.py RawReflectionTest test_key_reflection ``` >>> from sqlalchemy.dialects.mysql import reflection >>> from sqlalchemy.dialects.mysql import base as mysql >>> dialect = mysql.dialect() >>> parser = reflection.MySQLTableDefinitionParser(dialect, dialect.identifier_preparer) >>> regex = parser._re_key >>> assert regex.match(" PRIMARY KEY (`id`) USING BTREE KEY_BLOCK_SIZE 16,") >>> assert regex.match(" PRIMARY KEY (`id`) USING BTREE COMMENT '(null)',") Traceback (most recent call last): File "<stdin>", line 1, in <module> AssertionError >>> ``` I would suggest adding comment to the regexp for key definition(_re_key) . |