]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Include new MySQL error code 4031 for MySQL disconnect check 8037/head
authorvalievkarim <valievkarim@gmail.com>
Wed, 18 May 2022 15:54:57 +0000 (17:54 +0200)
committervalievkarim <valievkarim@gmail.com>
Wed, 18 May 2022 19:35:37 +0000 (22:35 +0300)
commit7ab605c2d25c3cd83af41e3250c97c623220cc7a
tree5eb21bc6ed63a3071d31262ec7faafd233598c9e
parent9e7bed9df601ead02fd96bf2fc787b23b536d2d6
Include new MySQL error code 4031 for MySQL disconnect check

When using pool_pre_ping=True with MySQL version 8.0.28 and a stale
connection, SQLAlchemy raises the following error instead of
reconnecting:

MySQLdb._exceptions.OperationalError: (4031, 'The client was disconnected by the server because of inactivity. See wait_timeout and interactive_timeout for configuring this behavior.')

4031 (ER_CLIENT_INTERACTION_TIMEOUT) is a new error code added in
MySQL version 8.0.24:
https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html#error_er_client_interaction_timeout

This commit adds 4031 to the error codes list checked in MySQL dialect
"is_disconnect" check.

Fixes: #8036
doc/build/changelog/unreleased_14/8036.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mysql/base.py
test/dialect/mysql/test_dialect.py