From 919763b43ce334be621f29a4b9fd3edd7e6c6927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Wed, 23 Jun 2021 10:00:43 -0400 Subject: Don't require space after MySQL pk comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made a small adjustment in the table reflection feature of the MySQL dialect to accommodate for alternate MySQL-oriented databases such as TiDB which include their own "comment" directives at the end of a constraint directive within "CREATE TABLE" where the format doesn't have the additional space character after the comment, in this case the TiDB "clustered index" feature. Pull request courtesy Daniƫl van Eeden. Fixes: #6659 Closes: #6660 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6660 Pull-request-sha: 98791a441b2e3d26aa7cef9d3e2907fac113e30f Change-Id: I20d206e0cdb809e4c6997b87159edf41249f7cd9 --- lib/sqlalchemy/dialects/mysql/reflection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/dialects/mysql/reflection.py') diff --git a/lib/sqlalchemy/dialects/mysql/reflection.py b/lib/sqlalchemy/dialects/mysql/reflection.py index b78034de2..a1ad3adfe 100644 --- a/lib/sqlalchemy/dialects/mysql/reflection.py +++ b/lib/sqlalchemy/dialects/mysql/reflection.py @@ -416,7 +416,7 @@ class MySQLTableDefinitionParser(object): r"(?: +KEY_BLOCK_SIZE *[ =]? *(?P\S+))?" r"(?: +WITH PARSER +(?P\S+))?" r"(?: +COMMENT +(?P(\x27\x27|\x27([^\x27])*?\x27)+))?" - r"(?: +/\*(?P.+)\*/ +)?" + r"(?: +/\*(?P.+)\*/ *)?" r",?$" % quotes ) -- cgit v1.2.1