Debian Codegraph @

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

raw
1 ## XPLUGIN: Test case for triggering read 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-read.xpl
11 -->sql
12 SELECT CONNECTION_TYPE from performance_schema.threads where processlist_command='Query';
13 SELECT USER();
14 SHOW STATUS LIKE 'Mysqlx_ssl_active';
15 -->endsql
16
17 # Cause read timeout
18 -->binparse %RAW_STMT_EXECUTE% Mysqlx.Sql.StmtExecute {
19 stmt: "select 1"
20 }
21 -->binsendoffset %RAW_STMT_EXECUTE% 0 4
22 -->recvtype Mysqlx.Notice.Frame
23 -->recvuntildisc show-received
24
25 EOF
26
27 ###################################################################
28
29 SET GLOBAL mysqlx_read_timeout = 5;
30
31 eval CREATE USER temp_user@localhost
32 IDENTIFIED WITH 'mysql_native_password' BY 'auth_string';
33
34 GRANT ALL ON *.* TO temp_user@localhost;
35
36 let $wait_condition=
37 SELECT 1 FROM performance_schema.global_status WHERE VARIABLE_NAME
38 like "Mysqlx_aborted_clients" and VARIABLE_VALUE=0;
39 --source include/wait_condition_or_abort.inc
40
41 --echo #
42 --echo # Run the test without SSL
43 --echo #
44 --replace_regex /(.*IO Read error:).*(read_timeout exceeded)/\1 \2/
45 exec $MYSQLXTEST
46 --user temp_user
47 --password='auth_string'
48 --file=$MYSQL_TMP_DIR/mysqlx-timeouting-read.xpl 2>&1;
49
50 let $wait_condition=
51 SELECT 1 FROM performance_schema.global_status WHERE VARIABLE_NAME
52 like "Mysqlx_aborted_clients" and VARIABLE_VALUE=1;
53 --source include/wait_condition_or_abort.inc
54
55 --echo #
56 --echo # Run the test with SSL
57 --echo #
58 --replace_regex /(.*IO Read error:).*(read_timeout exceeded)/\1 \2/
59 exec $MYSQLXTEST
60 --user temp_user
61 --password='auth_string'
62 --ssl-mode=REQUIRED
63 --file=$MYSQL_TMP_DIR/mysqlx-timeouting-read.xpl 2>&1;
64
65 let $wait_condition=
66 SELECT 1 FROM performance_schema.global_status WHERE VARIABLE_NAME
67 like "Mysqlx_aborted_clients" and VARIABLE_VALUE=2;
68 --source include/wait_condition_or_abort.inc
69
70
71 # Cleanup
72 SET GLOBAL mysqlx_read_timeout = DEFAULT;
73 --source ../include/xplugin_cleanup.inc
74
75 DROP USER temp_user@localhost;