Skip to content

Commit

Permalink
accept 4031 as a valid return code when connection closed
Browse files Browse the repository at this point in the history
As of 8.0.24 MySQL writes the reason the connection was closed before
closing it, so 4031 (ER_CLIENT_INTERACTION_TIMEOUT) is now an valid
return code. See

https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-24.html#mysqld-8-0-24-connection-management

for more information.

This addresses the issue reported in perl5-dbi#329
  • Loading branch information
waltman authored and dveeden committed Jun 11, 2021
1 parent b36b122 commit 7117e4c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions t/rt85919-fetch-lost-connection.t
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,16 @@ if (not $ok) {
# if we're connected via a local socket we receive error 2006
# (CR_SERVER_GONE_ERROR) but if we're connected using TCP/IP we get
# 2013 (CR_SERVER_LOST)
#
# as of 8.0.24 MySQL writes the reason the connection was closed
# before closing it, so 4031 (ER_CLIENT_INTERACTION_TIMEOUT) is
# now an valid return code
if ($DBI::err == 2006) {
pass("received error 2006 (CR_SERVER_GONE_ERROR)");
} elsif ($DBI::err == 2013) {
pass("received error 2013 (CR_SERVER_LOST)");
} elsif ($DBI::err == 4031) {
pass("received error 4031 (ER_CLIENT_INTERACTION_TIMEOUT)");
} else {
fail('Should return error 2006 or 2013');
}
Expand Down

0 comments on commit 7117e4c

Please sign in to comment.