From c8f9831a66728787d8cedf0e1d9d24bfbcb8a559 Mon Sep 17 00:00:00 2001 From: Brett Slatkin Date: Sat, 8 Jun 2013 02:04:27 -0700 Subject: [PATCH] Fixing the error regex to match numbers with the long suffix, like 1146L --- lib/sqlalchemy/dialects/mysql/gaerdbms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.47.3