Debian Codegraph @

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

raw
1 ## XPLUGIN: Test case for triggering wait timeout while using a SSL connection
2
3 --echo Preamble
4 --source include/not_windows.inc
5 --source ../include/have_performance_schema_threads.inc
6 --source include/xplugin_preamble.inc
7
8 ###################################################################
9
10 ###################################################################
11
12 --write_file $MYSQL_TMP_DIR/mysqlx-timeouting-wait.xpl
13 -->import assert_variable.macro
14
15 -->callmacro Assert_session_variable mysqlx_wait_timeout 5
16 -->callmacro Assert_global_variable mysqlx_wait_timeout 5
17
18 -->sql
19 SHOW SESSION VARIABLES LIKE 'mysqlx_wait_timeout';
20 SELECT CONNECTION_TYPE from performance_schema.threads where processlist_command='Query';
21 SELECT USER();
22 SHOW STATUS LIKE 'Mysqlx_ssl_active';
23 -->endsql
24
25 -->echo # Hanging 'receive' command will cause wait_timeout
26 -->recvtype Mysqlx.Notice.Frame
27 -->echo # We do no expect any message to be received here,
28 -->echo # verification is done by comparing with 'result' file.
29 -->recvuntildisc show-received
30 EOF
31
32 ###################################################################
33
34 SET GLOBAL mysqlx_wait_timeout = 5;
35 SET GLOBAL mysqlx_interactive_timeout = 10;
36
37 eval CREATE USER temp_user@localhost
38 IDENTIFIED WITH 'mysql_native_password' BY 'auth_string';
39
40 GRANT ALL ON *.* TO temp_user@localhost;
41
42 let $wait_condition=
43 SELECT 1 FROM performance_schema.global_status WHERE VARIABLE_NAME
44 like "Mysqlx_aborted_clients" and VARIABLE_VALUE=0;
45 --source include/wait_condition_or_abort.inc
46
47 --echo #
48 --echo # Run the test without SSL
49 --echo #
50 --replace_regex /(.*IO Read error:).*(read_timeout exceeded)/\1 \2/
51 exec $MYSQLXTEST
52 --user temp_user
53 --password='auth_string'
54 --file=$MYSQL_TMP_DIR/mysqlx-timeouting-wait.xpl 2>&1;
55
56 let $wait_condition=
57 SELECT 1 FROM performance_schema.global_status WHERE VARIABLE_NAME
58 like "Mysqlx_aborted_clients" and VARIABLE_VALUE=1;
59 --source include/wait_condition_or_abort.inc
60
61 --echo #
62 --echo # Run the test with SSL
63 --echo #
64 --replace_regex /(.*IO Read error:).*(read_timeout exceeded)/\1 \2/
65 exec $MYSQLXTEST
66 --user temp_user
67 --password='auth_string'
68 --ssl-mode=REQUIRED
69 --file=$MYSQL_TMP_DIR/mysqlx-timeouting-wait.xpl 2>&1;
70
71 let $wait_condition=
72 SELECT 1 FROM performance_schema.global_status WHERE VARIABLE_NAME
73 like "Mysqlx_aborted_clients" and VARIABLE_VALUE=2;
74 --source include/wait_condition_or_abort.inc
75
76
77 # Cleanup
78 SET GLOBAL mysqlx_wait_timeout = DEFAULT;
79 SET GLOBAL mysqlx_interactive_timeout = DEFAULT;
80 --source ../include/xplugin_cleanup.inc
81
82 DROP USER temp_user@localhost;