]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
include InterfaceError for mariadb disconnect check
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 14 Dec 2021 21:46:50 +0000 (16:46 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 16 Dec 2021 14:17:29 +0000 (09:17 -0500)
commit52ae2230d46414b6c270b9c83c6004ab15fe01d9
tree70d992a9abcf6ed482ed3e81f0d4cafee8ac0043
parent4f0bf86eec0ea557b2df31cce28612d5f124a8a3
include InterfaceError for mariadb disconnect check

Corrected the error classes inspected for the "is_disconnect" check for the
``mariadbconnector`` dialect, which was failing for disconnects that
occurred due to common MySQL/MariaDB error codes such as 2006; the DBAPI
appears to currently use the ``mariadb.InterfaceError`` exception class for
disconnect errors such as error code 2006, which has been added to the list
of classes checked.

For the current "real reconnect test", shutting down the mariadb
connection from the client side produces
ProgrammingError("Connection isn't valid anymore") which we also
continue to intercept.

Fixes: #7457
Change-Id: I0b37cd7a73359a23ad756ff2af0a9333c841221b
(cherry picked from commit 3a33fa8b0acd9220ef4428ac6a56ebd8d40c3762)
doc/build/changelog/unreleased_14/7457.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mysql/base.py