Debian Codegraph @

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

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