Debian Codegraph @

mysql-test/suite/x/t/client_close_abort.test

raw
1 --source include/restart_mysqld.inc
2 --source include/xplugin_preamble.inc
3 --source include/xplugin_create_user.inc
4
5 ##Pipelining the message after closing the pipe leads to undefined behaviour hence is not suppoerted on Windows OS
6 --source include/not_windows.inc
7
8 call mtr.add_suppression('Message of size 4294967040 received, exceeding the limit of 1048576');
9 # wait a little to give time for internal temporary session to die out
10 select sleep(1);
11 --replace_regex /localhost[:0-9]*/localhost/ /Execute/Query/
12 SELECT `user`,`host`,`db`,`command`,`state`,`info` FROM INFORMATION_SCHEMA.PROCESSLIST WHERE `state` != 'cleaning up' ORDER BY `user`;
13
14 ## Test starts here
15 ## Due to Windows OS TCP stack characteristics, the client should not queue anything after the message that is closing the session.
16 ## This leads to undefined behavior (like errors from the server for the messages preceding session close) if the server runs on that OS.
17 ## That is why this test is disabled for Windows.
18 --write_file $MYSQL_TMP_DIR/client_close_abort.xpl
19
20 -->title -Close in a pipeline and try to do something after close
21 -->newsession sess x_root
22 Mysqlx.Sql.StmtExecute {
23 stmt: "select 4.1"
24 }
25 Mysqlx.Sql.StmtExecute {
26 stmt: "select 4.2"
27 }
28 Mysqlx.Session.Close {
29 }
30 Mysqlx.Sql.StmtExecute {
31 stmt: "select 'fail'"
32 }
33
34 -->recvresult
35 -->recvresult
36 -->recvok
37 -->recverror ER_X_BAD_MESSAGE
38
39 -->closesession abort
40
41
42 EOF
43
44 --exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/client_close_abort.xpl 2>&1
45
46 # sleep for a while to ensure clean up finished
47 select sleep(1);
48
49 show global status like 'mysqlx_sessions';
50 show global status like 'mysqlx_connections_%';
51 --replace_regex /localhost[:0-9]*/localhost/ /Execute/Query/
52 SELECT `user`,`host`,`db`,`command`,`state`,`info` FROM INFORMATION_SCHEMA.PROCESSLIST WHERE `state` != 'cleaning up' ORDER BY `user`;
53
54 ## Cleanup
55 --source ../include/xplugin_cleanup.inc