Debian Codegraph @

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

raw
1 ################################################################################
2 #
3 # WL#14166 - xproto: notify on connection close
4 #
5 ## Verify that MySQL Server send notice on X Protocol connections
6 ## when clients on read timeout
7
8 --source include/xplugin_preamble.inc
9 --source include/xplugin_create_user.inc
10
11 ## Test starts here
12 --let $xtest1_file= $MYSQL_TMP_DIR/check_notice_on_io_read_timeout_connections.xpl
13 --let $xtest2_file= $MYSQL_TMP_DIR/check_no_close_notice_for_not_authenticted_connections.xpl
14
15 ## Test case description:
16 --echo ## I. Validate that X Plugin sends IO Read notice on read timeout for authenticted connections
17 --echo #
18 --echo ## II. Validate that X Plugin sends only ServerHello notice on read timeout for not authenticted connections
19 --echo #
20 --echo
21
22
23 --write_file $xtest1_file
24 import assert_notices.macro;
25
26 echo;
27 echo #;
28 echo # I;
29
30 -->binparse %RAW_STMT_EXECUTE% Mysqlx.Sql.StmtExecute {
31 stmt: "select 1"
32 }
33
34 echo;
35 echo #;
36 echo # Creating sessions;
37
38 repeat 10 %SESSION_ID%;
39 newsession session_%SESSION_ID% x_root;
40 binsendoffset %RAW_STMT_EXECUTE% 0 4;
41 endrepeat;
42
43 echo;
44 echo #;
45 echo # Reciving close notices;
46
47 varlet %ER_IO_READ_ERROR% 1810;
48
49 repeat 10 %SESSION_ID%;
50 setsession session_%SESSION_ID%;
51 callmacro Assert_notice_warning ERROR %ER_IO_READ_ERROR%;
52 recvuntildisc show-received;
53 endrepeat;
54
55 EOF
56
57
58
59 --write_file $xtest2_file
60 echo;
61 echo #;
62 echo # II;
63
64 echo;
65 echo #;
66 echo # Creating sessions;
67
68 repeat 10 %SESSION_ID%;
69 newsession session_%SESSION_ID% -;
70 # reciving ServerHello notice
71 recvtype Mysqlx.Notice.Frame type 5;
72 endrepeat;
73
74
75 echo;
76 echo #;
77 echo # Closing connection;
78 repeat 10 %SESSION_ID%;
79 setsession session_%SESSION_ID%;
80 recvuntildisc show-received;
81 endrepeat;
82
83 EOF
84
85
86 SET GLOBAL mysqlx_read_timeout=5;
87
88 --exec $MYSQLXTEST -ux_root --password='' --file=$xtest1_file 2>&1
89 --exec $MYSQLXTEST -ux_root --password='' --file=$xtest2_file 2>&1
90
91
92 ## Cleanup
93 SET GLOBAL mysqlx_read_timeout= DEFAULT;
94 --source ../include/xplugin_cleanup.inc