Skip to content

Commit 2220480

Browse files
committed
MDEV-7775 Wrong error message (Unknown error) when idle sessions are killed after wait_timeout
restore the error message that was removed by mistake in ec38c1b
1 parent a98ecc2 commit 2220480

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set global log_warnings=2;
2+
set @@wait_timeout=1;
3+
set global log_warnings=@@log_warnings;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
source include/not_windows.inc;
2+
3+
#
4+
# MDEV-7775 Wrong error message (Unknown error) when idle sessions are killed after wait_timeout
5+
#
6+
set global log_warnings=2;
7+
connect (foo,localhost,root);
8+
set @@wait_timeout=1;
9+
sleep 2;
10+
connection default;
11+
let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err;
12+
let SEARCH_RANGE= -50;
13+
let SEARCH_PATTERN= Aborted.*Got timeout reading communication packets;
14+
source include/search_pattern_in_file.inc;
15+
set global log_warnings=@@log_warnings;

sql/sql_connect.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,8 @@ void end_connection(THD *thd)
10921092
}
10931093

10941094
if (!thd->killed && (net->error && net->vio != 0))
1095-
thd->print_aborted_warning(1, ER(ER_UNKNOWN_ERROR));
1095+
thd->print_aborted_warning(1,
1096+
thd->stmt_da->is_error() ? thd->stmt_da->message() : ER(ER_UNKNOWN_ERROR));
10961097
}
10971098

10981099

0 commit comments

Comments
 (0)