From: Brett Slatkin Date: Sat, 8 Jun 2013 09:04:27 +0000 (-0700) Subject: Fixing the error regex to match numbers with the long suffix, like 1146L X-Git-Tag: rel_0_9_0b1~282^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c8f9831a66728787d8cedf0e1d9d24bfbcb8a559;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Fixing the error regex to match numbers with the long suffix, like 1146L --- diff --git a/lib/sqlalchemy/dialects/mysql/gaerdbms.py b/lib/sqlalchemy/dialects/mysql/gaerdbms.py index 8dbb4b440b..c479e25e02 100644 --- a/lib/sqlalchemy/dialects/mysql/gaerdbms.py +++ b/lib/sqlalchemy/dialects/mysql/gaerdbms.py @@ -74,7 +74,7 @@ class MySQLDialect_gaerdbms(MySQLDialect_mysqldb): return [], opts def _extract_error_code(self, exception): - match = re.compile(r"^(\d+):|^\((\d+),").match(str(exception)) + match = re.compile(r"^(\d+)L?:|^\((\d+)L?,").match(str(exception)) # The rdbms api will wrap then re-raise some types of errors # making this regex return no matches. code = match.group(1) or match.group(2) if match else None