From c8f9831a66728787d8cedf0e1d9d24bfbcb8a559 Mon Sep 17 00:00:00 2001 From: Brett Slatkin Date: Sat, 8 Jun 2013 02:04:27 -0700 Subject: 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(-) (limited to 'lib/sqlalchemy') diff --git a/lib/sqlalchemy/dialects/mysql/gaerdbms.py b/lib/sqlalchemy/dialects/mysql/gaerdbms.py index 8dbb4b440..c479e25e0 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 -- cgit v1.2.1