mariadb/mysql-test/include/wait_until_disconnected.inc
Monty 5932fa7890 Fixed "Packets out of order" warning message on stdout in clients,
compiled for debugging, when the server goes down

This happens in the following scenario:
- Server gets a shutdown message
- Servers sends error ER_CONNECTION_KILLED to the clients connection
- The client sends a query to the server, before the server has time to
  close the connection to the client
- Client reads the ER_CONNECTION_KILLED error message

In the above case, the packet number for the reply is one less than
what the client expected and the client prints "Packets out of order".

Fixed the following way:
- The client accepts now error packages with a packet number
  one less than expected.
- To ensure that this issue can be detected early in my_real_read(), error
  messages sent to the client are not compressed, even when compressed protocol is used.
2016-08-21 20:38:47 +03:00

26 lines
671 B
PHP

# Include this script after a shutdown to wait until the connection
# to the server has been lost or timeout occurs.
# When you change this file you may have to chance its cousin
# wait_until_connected_again.inc
--disable_result_log
--disable_query_log
let $counter= 600;
let $mysql_errno= 0;
while (!$mysql_errno)
{
# Strangely enough, the server might return "Too many connections"
# while being shutdown, thus 1040 is an "allowed" error.
# See BUG#36228.
--error 0,1040,1053,2002,2003,2005,2006,2013,1927
show status;
dec $counter;
if (!$counter)
{
--die Server failed to dissapear
}
--real_sleep 0.1
}
--enable_query_log
--enable_result_log