Fixing the error regex to match numbers with the long suffix, like 1146L

This commit is contained in:
Brett Slatkin
2013-06-08 02:04:27 -07:00
parent 3472083ba9
commit c8f9831a66
+1 -1
View 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