mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-06-13 12:14:23 -04:00
Fixing the error regex to match numbers with the long suffix, like 1146L
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user