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.
  • Loading branch information
waltman authored and pali committed Aug 13, 2023
1 parent 9dc04ee commit 443ac20
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion t/rt85919-fetch-lost-connection.t
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,18 @@ 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');
fail("Should return error 2006 or 2013 or 4031 but returned $DBI::err");
}
eval { $sth->finish(); } if defined $sth;
eval { $dbh->disconnect(); } if defined $dbh;
Expand Down

0 comments on commit 443ac20

Please sign in to comment.