-
Notifications
You must be signed in to change notification settings - Fork 4k
/
Copy pathclient_session.test
52 lines (38 loc) · 1.81 KB
/
client_session.test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
## Check potential core dump on Client session pointer
## Preamble
--source include/xplugin_preamble.inc
## MTR precheck connection doesn't disconnects immediately. It might be present
# at the start of the test. Lets wait until its disconnected.
let $count_sessions= 1;
--source include/wait_until_count_sessions.inc
call mtr.add_suppression("Plugin mysqlx reported: .*Could not open internal MySQL session.");
call mtr.add_suppression("Plugin mysqlx reported: ..: Error initializing session for connection: Too many connections");
call mtr.add_suppression("Plugin mysqlx reported: .Kill client: 1040 Too many connections.");
## Test data
SET GLOBAL MAX_CONNECTIONS=3;
SET GLOBAL MYSQLX_MAX_CONNECTIONS=30;
CREATE USER xuser@localhost IDENTIFIED BY 'xuser_pwd';
SHOW GRANTS FOR xuser@localhost;
#verify following num_of_active_connection <= MIN(MAX_CONNECTIONS, MYSQLX_MAX_CONNECTIONS)
#mysqld permits MAX_CONNECTIONS+1 clients to connect; the extra connection
#is reserved for use by accounts that have the SUPER privilege
# 1x MTR connection (open as root/SUPER) + 1x mysqlx default session + 2x new session
## Test starts here
--write_file $MYSQL_TMP_DIR/clien_session.xpl
-->newsession second_session xuser xuser_pwd
-->newsession thrid_session xuser xuser_pwd
-->expecterror ER_CON_COUNT_ERROR,2006,2007
-->newsession fourth_session xuser xuser_pwd
-->expecterror ER_CON_COUNT_ERROR,2006,2007
-->newsession fifth_session xuser xuser_pwd
-->expecterror ER_CON_COUNT_ERROR,2006,2007
-->newsession sixth_session root
EOF
--exec $MYSQLXTEST -u xuser --password='xuser_pwd' -h127.0.0.1 --file=$MYSQL_TMP_DIR/clien_session.xpl 2>&1
##todo: without sleep it crashes
--sleep 0.1
## Cleanup
SET @@GLOBAL.MAX_CONNECTIONS= DEFAULT;
SET @@GLOBAL.MYSQLX_MAX_CONNECTIONS= DEFAULT;
DROP USER xuser@localhost;
--source ../include/xplugin_cleanup.inc