call mtr.add_suppression("Plugin mysqlx reported: 'Unhandled network error: Bad file descriptor'"); create user sslcon@localhost identified by 'sslcon'; grant all on *.* to sslcon@localhost; RUN create user abc@localhost identified by 'abc', xplugin@localhost identified by 'xplugin', process@localhost identified by 'process', expire@localhost identified by 'expire' 0 rows affected RUN grant all on *.* to xplugin@localhost, expire@localhost 0 rows affected RUN grant process on *.* to process@localhost 0 rows affected RUN alter user expire@localhost password expire 0 rows affected RUN select sleep(1) sleep(1) 0 0 rows affected Test data client_id user host sql_session 1 x_root localhost $SESSION command ok expect Mysqlx_stmt_list_clients=1 and Mysqlx_stmt_kill_client=0 Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 0] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 1] Verify [Status variable "Mysqlx_sessions" needs to have a value of 1] create and activate new session connecting... active session is now 'aux' client_id user host 1 x_root localhost 2 x_root localhost command ok expect Mysqlx_stmt_list_clients=1 and Mysqlx_stmt_kill_client=0 even with another new x_root session Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 0] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 1] Verify [Status variable "Mysqlx_sessions" needs to have a value of 2] switch back to default session switched to session default client_id user host 1 x_root localhost 2 x_root localhost command ok expect Mysqlx_stmt_list_clients=2 and Mysqlx_stmt_kill_client=0 with default x_root session where list_clients already executed Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 0] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 2] Verify [Status variable "Mysqlx_sessions" needs to have a value of 2] WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 2] command ok Verify [Status variable "Mysqlx_sessions" needs to have a value of 1] client_id user host 1 x_root localhost command ok expect Mysqlx_stmt_list_clients=3 and Mysqlx_stmt_kill_client=1 with default x_root session where list_clients executed 3 times and kill_client once Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 1] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 3] Verify [Status variable "Mysqlx_sessions" needs to have a value of 1] create and activate new session abc expect only abc user session id connecting... active session is now 'abc' client_id user host 3 abc localhost command ok killing x_root user session with unprivileged user 'abc' which should be unsuccessful RUN [stmtadmin kill_client 1] Got expected error: You are not owner of thread (code 1095) expect Mysqlx_stmt_list_clients=1 and Mysqlx_stmt_kill_client=1 with session abc where list_clients and kill_client executed once Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 1] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 1] Verify [Status variable "Mysqlx_sessions" needs to have a value of 2] RUN select user(),current_user() user() current_user() abc@localhost abc@localhost 0 rows affected RUN show grants Grants for abc@localhost GRANT USAGE ON *.* TO `abc`@`localhost` 0 rows affected open another session of abc user and kill first session of abc user,which should be successful connecting... active session is now 'abc1' client_id user host 3 abc localhost 4 abc localhost command ok WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 3] command ok Verify [Status variable "Mysqlx_sessions" needs to have a value of 2] client_id user host 4 abc localhost command ok expect Mysqlx_stmt_list_clients=2 and Mysqlx_stmt_kill_client=1 with new session abc where list_clients executed twice and kill_client executed once Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 1] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 2] Verify [Status variable "Mysqlx_sessions" needs to have a value of 2] RUN select user(),current_user() user() current_user() abc@localhost abc@localhost 0 rows affected RUN show grants Grants for abc@localhost GRANT USAGE ON *.* TO `abc`@`localhost` 0 rows affected killing abc user session with its own session 'abc' which should be successful expect right error instead of End of File Server disconnected closing session abc1 switched to session default Verify [Status variable "Mysqlx_sessions" needs to have a value of 1] switch back to default session switched to session default client_id user host 1 x_root localhost command ok expect Mysqlx_stmt_list_clients=4 and Mysqlx_stmt_kill_client=1 with default x_root session where list_clients executed 4 times and kill_client once Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 1] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 4] Verify [Status variable "Mysqlx_sessions" needs to have a value of 1] RUN select user(),current_user() user() current_user() x_root@localhost x_root@localhost 0 rows affected RUN show grants Grants for x_root@localhost GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, CREATE ROLE, DROP ROLE ON *.* TO `x_root`@`localhost` WITH GRANT OPTION GRANT APPLICATION_PASSWORD_ADMIN,AUDIT_ABORT_EXEMPT,AUDIT_ADMIN,AUTHENTICATION_POLICY_ADMIN,BACKUP_ADMIN,BINLOG_ADMIN,BINLOG_ENCRYPTION_ADMIN,CLONE_ADMIN,CONNECTION_ADMIN,ENCRYPTION_KEY_ADMIN,FIREWALL_EXEMPT,FLUSH_OPTIMIZER_COSTS,FLUSH_STATUS,FLUSH_TABLES,FLUSH_USER_RESOURCES,GROUP_REPLICATION_ADMIN,GROUP_REPLICATION_STREAM,INNODB_REDO_LOG_ARCHIVE,INNODB_REDO_LOG_ENABLE,PASSWORDLESS_USER_ADMIN,PERSIST_RO_VARIABLES_ADMIN,REPLICATION_APPLIER,REPLICATION_SLAVE_ADMIN,RESOURCE_GROUP_ADMIN,RESOURCE_GROUP_USER,ROLE_ADMIN,SENSITIVE_VARIABLES_OBSERVER,SERVICE_CONNECTION_ADMIN,SESSION_VARIABLES_ADMIN,SET_USER_ID,SHOW_ROUTINE,SYSTEM_USER,SYSTEM_VARIABLES_ADMIN,TABLE_ENCRYPTION_ADMIN,TELEMETRY_LOG_ADMIN,XA_RECOVER_ADMIN ON *.* TO `x_root`@`localhost` WITH GRANT OPTION 0 rows affected open process only privileged user seession and kill x_root user session,expect error "You are not owner of thread" connecting... active session is now 'process' client_id user host 5 process localhost command ok RUN [stmtadmin kill_client 1] Got expected error: You are not owner of thread (code 1095) Verify [Status variable "Mysqlx_sessions" needs to have a value of 2] checking list of clients after x_root user session killed by xplugin user client_id user host 5 process localhost command ok expect Mysqlx_stmt_list_clients=2 and Mysqlx_stmt_kill_client=1 with process user where list_clients executed 2 times and kill_client once RUN show status like 'Mysqlx_stmt%client%' Variable_name Value Mysqlx_stmt_kill_client 1 Mysqlx_stmt_list_clients 2 0 rows affected RUN select user(),current_user() user() current_user() process@localhost process@localhost 0 rows affected RUN show grants Grants for process@localhost GRANT PROCESS ON *.* TO `process`@`localhost` 0 rows affected open privileged user seession and kill x_root user session,expect success connecting... active session is now 'xplugin' client_id user host 1 x_root localhost 5 process localhost 6 xplugin localhost command ok WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 1] command ok Verify [Status variable "Mysqlx_sessions" needs to have a value of 2] checking list of clients after x_root user session killed by xplugin user client_id user host 5 process localhost 6 xplugin localhost command ok expect Mysqlx_stmt_list_clients=2 and Mysqlx_stmt_kill_client=1 with xplugin user where list_clients executed 2 times and kill_client once RUN show status like 'Mysqlx_stmt%client%' Variable_name Value Mysqlx_stmt_kill_client 1 Mysqlx_stmt_list_clients 2 0 rows affected RUN select user(),current_user() user() current_user() xplugin@localhost xplugin@localhost 0 rows affected RUN show grants Grants for xplugin@localhost GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, CREATE ROLE, DROP ROLE ON *.* TO `xplugin`@`localhost` GRANT APPLICATION_PASSWORD_ADMIN,AUDIT_ABORT_EXEMPT,AUDIT_ADMIN,AUTHENTICATION_POLICY_ADMIN,BACKUP_ADMIN,BINLOG_ADMIN,BINLOG_ENCRYPTION_ADMIN,CLONE_ADMIN,CONNECTION_ADMIN,ENCRYPTION_KEY_ADMIN,FIREWALL_EXEMPT,FLUSH_OPTIMIZER_COSTS,FLUSH_STATUS,FLUSH_TABLES,FLUSH_USER_RESOURCES,GROUP_REPLICATION_ADMIN,GROUP_REPLICATION_STREAM,INNODB_REDO_LOG_ARCHIVE,INNODB_REDO_LOG_ENABLE,PASSWORDLESS_USER_ADMIN,PERSIST_RO_VARIABLES_ADMIN,REPLICATION_APPLIER,REPLICATION_SLAVE_ADMIN,RESOURCE_GROUP_ADMIN,RESOURCE_GROUP_USER,ROLE_ADMIN,SENSITIVE_VARIABLES_OBSERVER,SERVICE_CONNECTION_ADMIN,SESSION_VARIABLES_ADMIN,SET_USER_ID,SHOW_ROUTINE,SYSTEM_USER,SYSTEM_VARIABLES_ADMIN,TABLE_ENCRYPTION_ADMIN,TELEMETRY_LOG_ADMIN,XA_RECOVER_ADMIN ON *.* TO `xplugin`@`localhost` 0 rows affected Cleanup RUN drop schema if exists xtest 0 rows affected closing session xplugin Mysqlx.Ok { msg: "bye!" } ok client_id user host 7 x_root localhost command ok expect error while killing client with data type other than usinged int try killing xprotocol session with valid sql_session id once xprotocol connetion opened with kill_client,expect error RUN [stmtadmin kill_client 11] Got expected error: Unknown MySQLx client id 11 (code 1094) Got expected error: Invalid value for argument 'id' (code 5017) Got expected error: Invalid value for argument 'id' (code 5017) Got expected error: Invalid value for argument 'id' (code 5017) Got expected error: Invalid value for argument 'id' (code 5017) Got expected error: Invalid value for argument 'id' (code 5017) Got expected error: Invalid value for argument 'id' (code 5017) expect Mysqlx_stmt_list_clients=1 and Mysqlx_stmt_kill_client=11 with x_root user even though kill_client returns errors Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 7] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 1] Verify [Status variable "Mysqlx_sessions" needs to have a value of 1] Mysqlx.Ok { msg: "bye!" } ok NOTICE: Account password expired expect error if list_clients and kill_client executed from password expired user session RUN show processlist While executing show processlist: Got expected error: You must reset your password using ALTER USER statement before executing this statement. (code 1820) Got expected error: You must reset your password using ALTER USER statement before executing this statement. (code 1820) RUN [stmtadmin kill_client 8] Got expected error: You must reset your password using ALTER USER statement before executing this statement. (code 1820) Mysqlx.Ok { msg: "bye!" } ok checking list_clients and kill_client with mixed case, expect success as these commands are case insensitive client_id user host 9 x_root localhost command ok Got expected error: Unknown MySQLx client id 998 (code 1094) expect Mysqlx_stmt_list_clients=1 and Mysqlx_stmt_kill_client=1 with x_root user when these commads executed with mixed case Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 1] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 1] Verify [Status variable "Mysqlx_sessions" needs to have a value of 1] Mysqlx.Ok { msg: "bye!" } ok checking list_clients and kill_client with default 50 connections, expect success for both list and kill RUN set @@global.mysqlx_max_connections=60 0 rows affected RUN create user xconnection1@localhost identified by 'xconnection1', xconnection2@localhost identified by 'xconnection2', xconnection3@localhost identified by 'xconnection3', xconnection4@localhost identified by 'xconnection4', xconnection5@localhost identified by 'xconnection5', xconnection6@localhost identified by 'xconnection6', xconnection7@localhost identified by 'xconnection7', xconnection8@localhost identified by 'xconnection8', xconnection9@localhost identified by 'xconnection9', xconnection10@localhost identified by 'xconnection10', xconnection11@localhost identified by 'xconnection11', xconnection12@localhost identified by 'xconnection12', xconnection13@localhost identified by 'xconnection13', xconnection14@localhost identified by 'xconnection14', xconnection15@localhost identified by 'xconnection15', xconnection16@localhost identified by 'xconnection16', xconnection17@localhost identified by 'xconnection17', xconnection18@localhost identified by 'xconnection18', xconnection19@localhost identified by 'xconnection19', xconnection20@localhost identified by 'xconnection20', xconnection21@localhost identified by 'xconnection21', xconnection22@localhost identified by 'xconnection22', xconnection23@localhost identified by 'xconnection23', xconnection24@localhost identified by 'xconnection24', xconnection25@localhost identified by 'xconnection25', xconnection26@localhost identified by 'xconnection26', xconnection27@localhost identified by 'xconnection27', xconnection28@localhost identified by 'xconnection28', xconnection29@localhost identified by 'xconnection29', xconnection30@localhost identified by 'xconnection30', xconnection31@localhost identified by 'xconnection31', xconnection32@localhost identified by 'xconnection32', xconnection33@localhost identified by 'xconnection33', xconnection34@localhost identified by 'xconnection34', xconnection35@localhost identified by 'xconnection35', xconnection36@localhost identified by 'xconnection36', xconnection37@localhost identified by 'xconnection37', xconnection38@localhost identified by 'xconnection38', xconnection39@localhost identified by 'xconnection39', xconnection40@localhost identified by 'xconnection40', xconnection41@localhost identified by 'xconnection41', xconnection42@localhost identified by 'xconnection42', xconnection43@localhost identified by 'xconnection43', xconnection44@localhost identified by 'xconnection44', xconnection45@localhost identified by 'xconnection45', xconnection46@localhost identified by 'xconnection46', xconnection47@localhost identified by 'xconnection47', xconnection48@localhost identified by 'xconnection48', xconnection49@localhost identified by 'xconnection49', xconnection50@localhost identified by 'xconnection50' 0 rows affected Test data client_id user host sql_session 10 x_root localhost $SESSION command ok expect Mysqlx_stmt_list_clients=1 and Mysqlx_stmt_kill_client=0 RUN show status like 'Mysqlx_stmt%client%' Variable_name Value Mysqlx_stmt_kill_client 0 Mysqlx_stmt_list_clients 1 0 rows affected create and activate new session xconnection1 connecting... active session is now 'xconnection1' connecting... active session is now 'xconnection2' connecting... active session is now 'xconnection3' connecting... active session is now 'xconnection4' connecting... active session is now 'xconnection5' connecting... active session is now 'xconnection6' connecting... active session is now 'xconnection7' connecting... active session is now 'xconnection8' connecting... active session is now 'xconnection9' connecting... active session is now 'xconnection10' connecting... active session is now 'xconnection11' connecting... active session is now 'xconnection12' connecting... active session is now 'xconnection13' connecting... active session is now 'xconnection14' connecting... active session is now 'xconnection15' connecting... active session is now 'xconnection16' connecting... active session is now 'xconnection17' connecting... active session is now 'xconnection18' connecting... active session is now 'xconnection19' connecting... active session is now 'xconnection20' connecting... active session is now 'xconnection21' connecting... active session is now 'xconnection22' connecting... active session is now 'xconnection23' connecting... active session is now 'xconnection24' connecting... active session is now 'xconnection25' connecting... active session is now 'xconnection26' connecting... active session is now 'xconnection27' connecting... active session is now 'xconnection28' connecting... active session is now 'xconnection29' connecting... active session is now 'xconnection30' connecting... active session is now 'xconnection31' connecting... active session is now 'xconnection32' connecting... active session is now 'xconnection33' connecting... active session is now 'xconnection34' connecting... active session is now 'xconnection35' connecting... active session is now 'xconnection36' connecting... active session is now 'xconnection37' connecting... active session is now 'xconnection38' connecting... active session is now 'xconnection39' connecting... active session is now 'xconnection40' connecting... active session is now 'xconnection41' connecting... active session is now 'xconnection42' connecting... active session is now 'xconnection43' connecting... active session is now 'xconnection44' connecting... active session is now 'xconnection45' connecting... active session is now 'xconnection46' connecting... active session is now 'xconnection47' connecting... active session is now 'xconnection48' connecting... active session is now 'xconnection49' connecting... active session is now 'xconnection50' client_id user host 60 xconnection50 localhost command ok switched to session default list all connected clients client_id user host 10 x_root localhost 11 xconnection1 localhost 12 xconnection2 localhost 13 xconnection3 localhost 14 xconnection4 localhost 15 xconnection5 localhost 16 xconnection6 localhost 17 xconnection7 localhost 18 xconnection8 localhost 19 xconnection9 localhost 20 xconnection10 localhost 21 xconnection11 localhost 22 xconnection12 localhost 23 xconnection13 localhost 24 xconnection14 localhost 25 xconnection15 localhost 26 xconnection16 localhost 27 xconnection17 localhost 28 xconnection18 localhost 29 xconnection19 localhost 30 xconnection20 localhost 31 xconnection21 localhost 32 xconnection22 localhost 33 xconnection23 localhost 34 xconnection24 localhost 35 xconnection25 localhost 36 xconnection26 localhost 37 xconnection27 localhost 38 xconnection28 localhost 39 xconnection29 localhost 40 xconnection30 localhost 41 xconnection31 localhost 42 xconnection32 localhost 43 xconnection33 localhost 44 xconnection34 localhost 45 xconnection35 localhost 46 xconnection36 localhost 47 xconnection37 localhost 48 xconnection38 localhost 49 xconnection39 localhost 50 xconnection40 localhost 51 xconnection41 localhost 52 xconnection42 localhost 53 xconnection43 localhost 54 xconnection44 localhost 55 xconnection45 localhost 56 xconnection46 localhost 57 xconnection47 localhost 58 xconnection48 localhost 59 xconnection49 localhost 60 xconnection50 localhost command ok expect Mysqlx_stmt_list_clients=2 and Mysqlx_stmt_kill_client=0 Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 0] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 2] Verify [Global status variable "Mysqlx_sessions" needs to have a value of 51] killing all newly connected clients except x_root,one by one WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 11] command ok switched to session xconnection1 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection1 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 12] command ok switched to session xconnection2 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection2 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 13] command ok switched to session xconnection3 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection3 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 14] command ok switched to session xconnection4 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection4 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 15] command ok switched to session xconnection5 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection5 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 16] command ok switched to session xconnection6 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection6 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 17] command ok switched to session xconnection7 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection7 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 18] command ok switched to session xconnection8 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection8 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 19] command ok switched to session xconnection9 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection9 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 20] command ok switched to session xconnection10 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection10 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 21] command ok switched to session xconnection11 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection11 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 22] command ok switched to session xconnection12 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection12 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 23] command ok switched to session xconnection13 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection13 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 24] command ok switched to session xconnection14 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection14 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 25] command ok switched to session xconnection15 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection15 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 26] command ok switched to session xconnection16 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection16 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 27] command ok switched to session xconnection17 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection17 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 28] command ok switched to session xconnection18 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection18 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 29] command ok switched to session xconnection19 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection19 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 30] command ok switched to session xconnection20 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection20 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 31] command ok switched to session xconnection21 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection21 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 32] command ok switched to session xconnection22 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection22 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 33] command ok switched to session xconnection23 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection23 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 34] command ok switched to session xconnection24 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection24 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 35] command ok switched to session xconnection25 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection25 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 36] command ok switched to session xconnection26 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection26 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 37] command ok switched to session xconnection27 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection27 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 38] command ok switched to session xconnection28 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection28 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 39] command ok switched to session xconnection29 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection29 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 40] command ok switched to session xconnection30 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection30 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 41] command ok switched to session xconnection31 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection31 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 42] command ok switched to session xconnection32 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection32 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 43] command ok switched to session xconnection33 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection33 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 44] command ok switched to session xconnection34 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection34 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 45] command ok switched to session xconnection35 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection35 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 46] command ok switched to session xconnection36 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection36 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 47] command ok switched to session xconnection37 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection37 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 48] command ok switched to session xconnection38 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection38 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 49] command ok switched to session xconnection39 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection39 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 50] command ok switched to session xconnection40 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection40 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 51] command ok switched to session xconnection41 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection41 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 52] command ok switched to session xconnection42 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection42 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 53] command ok switched to session xconnection43 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection43 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 54] command ok switched to session xconnection44 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection44 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 55] command ok switched to session xconnection45 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection45 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 56] command ok switched to session xconnection46 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection46 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 57] command ok switched to session xconnection47 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection47 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 58] command ok switched to session xconnection48 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection48 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 59] command ok switched to session xconnection49 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection49 switched to session default WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 60] command ok switched to session xconnection50 [ASSERT notice warning - ERROR, 3169] Server disconnected closing session xconnection50 switched to session default Verify [Status variable "Mysqlx_sessions" needs to have a value of 1] client_id user host 10 x_root localhost command ok expect Mysqlx_stmt_list_clients=3 and Mysqlx_stmt_kill_client=50 Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 50] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 3] Verify [Status variable "Mysqlx_sessions" needs to have a value of 1] Verify [Status variable "Mysqlx_sessions_accepted" needs to have a value of 60] Verify [Status variable "Mysqlx_sessions_closed" needs to have a value of 59] Verify [Status variable "Mysqlx_sessions_fatal_error" needs to have a value of 0] Verify [Status variable "Mysqlx_sessions_killed" needs to have a value of 54] Verify [Status variable "Mysqlx_sessions_rejected" needs to have a value of 0] RUN drop user xconnection1@localhost, xconnection2@localhost, xconnection3@localhost, xconnection4@localhost, xconnection5@localhost, xconnection6@localhost, xconnection7@localhost, xconnection8@localhost, xconnection9@localhost, xconnection10@localhost, xconnection11@localhost, xconnection12@localhost, xconnection13@localhost, xconnection14@localhost, xconnection15@localhost, xconnection16@localhost, xconnection17@localhost, xconnection18@localhost, xconnection19@localhost, xconnection20@localhost, xconnection21@localhost, xconnection22@localhost, xconnection23@localhost, xconnection24@localhost, xconnection25@localhost, xconnection26@localhost, xconnection27@localhost, xconnection28@localhost, xconnection29@localhost, xconnection30@localhost, xconnection31@localhost, xconnection32@localhost, xconnection33@localhost, xconnection34@localhost, xconnection35@localhost, xconnection36@localhost, xconnection37@localhost, xconnection38@localhost, xconnection39@localhost, xconnection40@localhost, xconnection41@localhost, xconnection42@localhost, xconnection43@localhost, xconnection44@localhost, xconnection45@localhost, xconnection46@localhost, xconnection47@localhost, xconnection48@localhost, xconnection49@localhost, xconnection50@localhost 0 rows affected Mysqlx.Ok { msg: "bye!" } ok execute list_clients,kill_client with sql namespace,expect error change result file once error messages are fixed send Mysqlx.Sql.StmtExecute { stmt: "list_clients" namespace: "sql" } expect Mysqlx.Sql.StmtExecuteOk Got expected error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'list_clients' at line 1 (code 1064) send Mysqlx.Sql.StmtExecute { stmt: "kill_client" args { type: SCALAR scalar { type: V_UINT v_unsigned_int: 11 } } namespace: "sql" } expect Mysqlx.Sql.StmtExecuteOk Got expected error: Too many arguments (code 5015) send Mysqlx.Sql.StmtExecute { stmt: "kill_client" args { type: SCALAR scalar { type: V_UINT v_unsigned_int: 11 } } namespace: "" } expect Mysqlx.Sql.StmtExecuteOk Got expected error: Unknown namespace (code 5162) send Mysqlx.Sql.StmtExecute { stmt: "kill_client" args { type: SCALAR scalar { type: V_UINT v_unsigned_int: 11 } } namespace: "invalid" } expect Mysqlx.Sql.StmtExecuteOk Got expected error: Unknown namespace invalid (code 5162) expect Mysqlx_stmt_list_clients=0 and Mysqlx_stmt_kill_client=0 as these are not executed on right namespace in main, line 62:ERROR: Undefined macro Assert_status_variable in main, line 63:ERROR: Undefined macro Assert_status_variable in main, line 64:ERROR: Undefined macro Assert_status_variable Mysqlx.Ok { msg: "bye!" } ok open xconnection with ssl and kill,expect success RUN create user con1@localhost identified by 'con1', con2@localhost identified by 'con2' 0 rows affected RUN set @@global.mysqlx_max_connections=3 0 rows affected Test data client_id user host 62 sslcon localhost command ok expect Mysqlx_stmt_list_clients=1 and Mysqlx_stmt_kill_client=0 Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 0] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 1] Verify [Status variable "Mysqlx_sessions" needs to have a value of 1] create and activate new session con1 connecting... active session is now 'con1' client_id user host 63 con1 localhost command ok expect Mysqlx_stmt_list_clients=1 and Mysqlx_stmt_kill_client=0 Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 0] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 1] Verify [Status variable "Mysqlx_sessions" needs to have a value of 2] open 3rd xprotocol connection where 2 sessions already opened connecting... active session is now 'con2' expect Mysqlx_stmt_list_clients=0 and Mysqlx_stmt_kill_client=0 Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 0] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 0] Verify [Status variable "Mysqlx_sessions" needs to have a value of 3] switched to session default client_id user host 62 sslcon localhost 63 con1 localhost 64 con2 localhost command ok WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 63] command ok WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 64] command ok Verify [Status variable "Mysqlx_sessions" needs to have a value of 1] client_id user host 62 sslcon localhost command ok expect Mysqlx_stmt_list_clients=3 and Mysqlx_stmt_kill_client=2 RUN drop user con1@localhost, con2@localhost 0 rows affected Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 2] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 3] Verify [Status variable "Mysqlx_sessions" needs to have a value of 1] Mysqlx.Ok { msg: "bye!" } ok open xconnection with ssl x_root user kill,expect success RUN create user con1@localhost identified by 'con1', con2@localhost identified by 'con2' 0 rows affected RUN set @@global.mysqlx_max_connections=3 0 rows affected Test data client_id user host 65 x_root localhost command ok create and activate new session con1 connecting... active session is now 'con1 con1 con1' client_id user host 65 x_root localhost 66 x_root localhost command ok open 3rd xprotocol connection where 2 sessions already opened connecting... active session is now 'con2 con2 con2' switched to session default client_id user host 65 x_root localhost 66 x_root localhost 67 x_root localhost command ok WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 66] command ok WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 67] command ok Verify [Status variable "Mysqlx_sessions" needs to have a value of 1] client_id user host 65 x_root localhost command ok RUN drop user con1@localhost, con2@localhost 0 rows affected Mysqlx.Ok { msg: "bye!" } ok show status like 'Mysqlx_stmt%client%'; Variable_name Value Mysqlx_stmt_kill_client 68 Mysqlx_stmt_list_clients 26 # restart: drop user abc@localhost, xplugin@localhost, process@localhost, expire@localhost; set @@global.mysqlx_max_connections=100; show status like 'Mysqlx_stmt%client%'; Variable_name Value Mysqlx_stmt_kill_client 0 Mysqlx_stmt_list_clients 0 select sleep(0.5); sleep(0.5) 0 RUN create user abc@localhost identified by 'abc', xplugin@localhost identified by 'xplugin', process@localhost identified by 'process', expire@localhost identified by 'expire' 0 rows affected RUN grant all on *.* to xplugin@localhost, expire@localhost 0 rows affected RUN grant process on *.* to process@localhost 0 rows affected RUN alter user expire@localhost password expire 0 rows affected Test data client_id user host 1 x_root localhost command ok expect Mysqlx_stmt_list_clients=1 and Mysqlx_stmt_kill_client=0 Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 0] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 1] Verify [Status variable "Mysqlx_sessions" needs to have a value of 1] create and activate new session connecting... active session is now 'aux' client_id user host 1 x_root localhost 2 x_root localhost command ok expect Mysqlx_stmt_list_clients=1 and Mysqlx_stmt_kill_client=0 even with another new x_root session Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 0] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 1] Verify [Status variable "Mysqlx_sessions" needs to have a value of 2] switch back to default session switched to session default client_id user host 1 x_root localhost 2 x_root localhost command ok expect Mysqlx_stmt_list_clients=2 and Mysqlx_stmt_kill_client=0 with default x_root session where list_clients already executed Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 0] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 2] Verify [Status variable "Mysqlx_sessions" needs to have a value of 2] WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 2] command ok Verify [Status variable "Mysqlx_sessions" needs to have a value of 1] client_id user host 1 x_root localhost command ok expect Mysqlx_stmt_list_clients=3 and Mysqlx_stmt_kill_client=1 with default x_root session where list_clients executed 3 times and kill_client once Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 1] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 3] Verify [Status variable "Mysqlx_sessions" needs to have a value of 1] create and activate new session abc expect only abc user session id connecting... active session is now 'abc' client_id user host 3 abc localhost command ok killing x_root user session with unprivileged user 'abc' which should be unsuccessful RUN [stmtadmin kill_client 1] Got expected error: You are not owner of thread (code 1095) expect ERROR: SELECT command denied to user 'abc'@'localhost' for table 'session_status' (code 1142) for show status command Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 1] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 1] Verify [Status variable "Mysqlx_sessions" needs to have a value of 2] open another session of abc user and kill first session of abc user,which should be successful connecting... active session is now 'abc1' client_id user host 3 abc localhost 4 abc localhost command ok WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 3] command ok Verify [Status variable "Mysqlx_sessions" needs to have a value of 2] client_id user host 4 abc localhost command ok expect ERROR: SELECT command denied to user 'abc'@'localhost' for table 'session_status' (code 1142) for show status command Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 1] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 2] Verify [Status variable "Mysqlx_sessions" needs to have a value of 2] killing abc user session with its own session 'abc' which should be successful expect right error instead of End of File switch back to default session Server disconnected closing session abc1 switched to session default Verify [Status variable "Mysqlx_sessions" needs to have a value of 1] client_id user host 1 x_root localhost command ok expect Mysqlx_stmt_list_clients=4 and Mysqlx_stmt_kill_client=1 with default x_root session where list_clients executed 4 times and kill_client once Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 1] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 4] Verify [Status variable "Mysqlx_sessions" needs to have a value of 1] open process only privileged user seession and kill x_root user session,expect error "You are not owner of thread" connecting... active session is now 'process' client_id user host 5 process localhost command ok RUN [stmtadmin kill_client 1] Got expected error: You are not owner of thread (code 1095) Verify [Status variable "Mysqlx_sessions" needs to have a value of 2] checking list of clients after x_root user session killed by xplugin user client_id user host 5 process localhost command ok expect ERROR: SELECT command denied to user 'process'@'localhost' for table 'session_status' (code 1142) for show command Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 1] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 2] Verify [Status variable "Mysqlx_sessions" needs to have a value of 2] open privileged user seession and kill x_root user session,expect success connecting... active session is now 'xplugin' client_id user host 1 x_root localhost 5 process localhost 6 xplugin localhost command ok WAIT [count(*) information_schema.PROCESSLIST == 1 - only current process can be active] RUN [stmtadmin kill_client 1] command ok Verify [Status variable "Mysqlx_sessions" needs to have a value of 2] checking list of clients after x_root user session killed by xplugin user client_id user host 5 process localhost 6 xplugin localhost command ok expect Mysqlx_stmt_list_clients=2 and Mysqlx_stmt_kill_client=1 with xplugin user where list_clients executed 2 times and kill_client once Verify [Status variable "Mysqlx_stmt_kill_client" needs to have a value of 1] Verify [Status variable "Mysqlx_stmt_list_clients" needs to have a value of 2] Verify [Status variable "Mysqlx_sessions" needs to have a value of 2] Cleanup RUN drop schema if exists xtest 0 rows affected closing session xplugin Mysqlx.Ok { msg: "bye!" } ok show status like 'Mysqlx_stmt%client%'; Variable_name Value Mysqlx_stmt_kill_client 6 Mysqlx_stmt_list_clients 12 drop user abc@localhost, xplugin@localhost, process@localhost, expire@localhost, sslcon@localhost;