]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fixing the error regex to match numbers with the long suffix, like 1146L
authorBrett Slatkin <brett@haxor.com>
Sat, 8 Jun 2013 09:04:27 +0000 (02:04 -0700)
committerBrett Slatkin <brett@haxor.com>
Sat, 8 Jun 2013 09:04:27 +0000 (02:04 -0700)
lib/sqlalchemy/dialects/mysql/gaerdbms.py

index 8dbb4b440bfb41d0b95a92b4eee6a9cb18d641ea..c479e25e026df01639545236727b5b1b4177d027 100644 (file)
@@ -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