mysql dialect is_disconnect incorrectly classifies COMMANDS_OUT_OF_SYNC
Issue #3101
resolved
In 0.9.7 (and going back to at least 0.7, I think) mysql/base's is_disconnect catches OperationalError and, if the error is on the whitelist, reports it as a disconnect. One of the items on the list, error 2014 (COMMANDS_OUT_OF_SYNC), is actually a ProgrammingError, not an OperationalError (See mysqldb source and constants list).
One potential easy fix is attached.
Comments (6)
-
repo owner -
repo owner - changed status to resolved
- MySQL error 2014 "commands out of sync" appears to be raised as a
ProgrammingError, not OperationalError, in modern MySQL-Python versions;
all MySQL error codes that are tested for "is disconnect" are now
checked within OperationalError and ProgrammingError regardless.
fixes
#3101
→ <<cset 3ea154fbf5db>>
-
repo owner - MySQL error 2014 "commands out of sync" appears to be raised as a
ProgrammingError, not OperationalError, in modern MySQL-Python versions;
all MySQL error codes that are tested for "is disconnect" are now
checked within OperationalError and ProgrammingError regardless.
fixes
#3101
→ <<cset 9b86d7ce70b0>>
- MySQL error 2014 "commands out of sync" appears to be raised as a
ProgrammingError, not OperationalError, in modern MySQL-Python versions;
all MySQL error codes that are tested for "is disconnect" are now
checked within OperationalError and ProgrammingError regardless.
fixes
-
repo owner - MySQL error 2014 "commands out of sync" appears to be raised as a
ProgrammingError, not OperationalError, in modern MySQL-Python versions;
all MySQL error codes that are tested for "is disconnect" are now
checked within OperationalError and ProgrammingError regardless.
fixes
#3101
→ <<cset 034912c1d869>>
- MySQL error 2014 "commands out of sync" appears to be raised as a
ProgrammingError, not OperationalError, in modern MySQL-Python versions;
all MySQL error codes that are tested for "is disconnect" are now
checked within OperationalError and ProgrammingError regardless.
fixes
-
repo owner - changed milestone to 0.9.8
-
repo owner - changed milestone to 0.9.7
- Log in to comment
works for me, thanks!