mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 14:02:32 +01:00
d430e2474f
- Detect that connection to server has been broken in "net_clear". Since net_clear is always called before we send command to server, we can be sure that server has not received the command. mysql-test/r/wait_timeout.result: Update test result mysql-test/t/wait_timeout-master.opt: Decrease wait_timeout value to avoid unneccessary sleeps mysql-test/t/wait_timeout.test: Test that same error message is returned when disconnected regardless of connection is socket or TCP Decrease sleep times sql/net_serv.cc: Make "net_clear" detect if connection with server has been broken by performing a select. If the select returns that there are data to read but no data can be read, that means the connection is broken. Signal disconnected to "write" functions by setting error to 2.
27 lines
699 B
Text
27 lines
699 B
Text
#
|
|
# Bug #8731: wait_timeout does not work on Mac OS X
|
|
#
|
|
--disable_reconnect
|
|
select 1;
|
|
# wait_timeout is 1, so we should get disconnected now
|
|
--sleep 2
|
|
# When the connection is closed in this way, the error code should
|
|
# be consistent see bug#2845 for an explanation
|
|
--error 2006
|
|
select 2;
|
|
--enable_reconnect
|
|
select 3;
|
|
|
|
# Do the same test as above on a TCP connection
|
|
connect (con1,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
|
--disable_reconnect
|
|
select 1;
|
|
# wait_timeout is 1, so we should get disconnected now
|
|
--sleep 2
|
|
# When the connection is closed in this way, the error code should
|
|
# be consistent see bug#2845 for an explanation
|
|
--error 2006
|
|
select 2;
|
|
--enable_reconnect
|
|
select 3;
|
|
disconnect con1;
|