Debian Codegraph @

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

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