1. Michael Bayer
  2. sqlalchemy
  3. Issues

Issues

Issue #3101 resolved

mysql dialect is_disconnect incorrectly classifies COMMANDS_OUT_OF_SYNC

Mike Lundy
created an issue

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)

  1. Michael Bayer 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 3ea154fbf5db>>

  2. Michael Bayer 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>>

  3. Michael Bayer 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>>

  4. Log in to comment