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

53 lines
1.8 KiB
Plaintext

## 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: Could not open session.");
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.tmp
-->newsession second_session xuser xuser_pwd
-->newsession thrid_session xuser xuser_pwd
-->expecterror ER_X_SESSION,2006,2007
-->newsession fourth_session xuser xuser_pwd
-->expecterror ER_X_SESSION,2006,2007
-->newsession fifth_session xuser xuser_pwd
-->expecterror ER_X_SESSION,2006,2007
-->newsession sixth_session root
EOF
--exec $MYSQLXTEST -u xuser --password='xuser_pwd' -h127.0.0.1 --file=$MYSQL_TMP_DIR/clien_session.tmp 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;
--remove_file $MYSQL_TMP_DIR/clien_session.tmp