mariadb/mysql-test/suite/rpl/r/rpl_perfschema_connect_config.result
Dmitry Shulga eeb00ceffd MDEV-35617: DROP USER should leave no active session for that user
Follow-up patch with adjustments of test files and updates of result
files for tests.

Some of tests were rewritten slighlty. Everywhere where common
pattern used:
-----
  CREATE USER userA;
  --connect con1 ... userA ...
   <sql statements...>
  --disconnect con1
  DROP USER userA;
-----
the DROP USER statement has been eclosed into the directive
--disable_warnings
--enable_warnings

This change is caused by the race conddition between --disconnect
and DROP USER since a number of currently running sessions
established on behalf the user being dropped is counted by
holding the rw_lock THD_list_iterator::lock that is not acquired on
execution the DROP USER statement but the lock is taken as the last
step on handling disconnection (when the client is already sending
the next statement). Therefore, for the cases where the command
 --disconnect precedes the DROP USER statement
we hide the possible warnings about presence of active sessions
for the user being deleted to make tests deterministic.
2025-06-09 18:24:28 +07:00

126 lines
5 KiB
Text

include/master-slave.inc
[connection master]
# Asserted this: On master, the table should return an empty set.
connection slave;
# Verify that SELECT works for every field and produces an output
# similar to the corresponding field in SHOW SLAVE STATUS(SSS).
include/assert.inc [Value returned by SSS and PS table for Host should be same.]
include/assert.inc [Value returned by SSS and PS table for Port should be same.]
include/assert.inc [Value returned by SSS and PS table for User should be same.]
include/assert.inc [Value returned by SSS and PS table for Using_Gtid should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Allowed should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_CA_File should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_CA_Path should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Certificate should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Cipher should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Key should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Verify_Server_Certificate should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Crl_File should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Crl_Path should be same.]
include/assert.inc [Value returned by SSS and PS table for Connection_Retry_Interval should be same.]
include/assert.inc [Value returned by PS table for Connection_Retry_Count should be 30.]
# Heartbeat_Interval is part of I_S and P_S. We will compare the
# two to make sure both match.
include/assert.inc [Value returned by IS and PS table for Heartbeat_Interval should be same.]
# Change configuration parameters and verify that these changes
# are shown correctly by SELECTs from PS table.
connection master;
create user replssl@localhost;
grant replication slave on *.* to replssl@localhost require ssl;
include/sync_slave_sql_with_master.inc
include/stop_slave.inc
change master to
master_user= 'replssl',
master_password= '',
master_ssl= 1,
master_ssl_ca= 'MYSQL_TEST_DIR/std_data/cacert.pem',
master_ssl_cert= 'MYSQL_TEST_DIR/std_data/client-cert.pem',
master_ssl_key= 'MYSQL_TEST_DIR/std_data/client-key.pem';
include/start_slave.inc
connection slave;
# Checking SSL parameters, they were empty in tests done in the
# previous section.
include/assert.inc [Value returned by SSS and PS table for SSL_Allowed should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_CA_File should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_CA_Path should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Certificate should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Cipher should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Key should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Verify_Server_Certificate should be same.]
connection master;
drop user replssl@localhost;
Warnings:
Note 4226 Dropped users ['replssl'@'localhost'] have active connections. Use KILL CONNECTION if they should not be used anymore.
connection slave;
include/stop_slave.inc
CHANGE MASTER TO
master_host= '127.0.0.1',
master_user= 'root',
master_password= '',
master_ssl_ca= '',
master_ssl_cert= '',
master_ssl_key= '',
master_ssl_verify_server_cert=0,
master_ssl=1,
master_use_gtid=no;
include/start_slave.inc
# Test with different MASTER_USE_GTID values
# 1) Test for MASTER_USE_GTID=NO
include/stop_slave.inc
change master to
master_user = 'root',
master_use_gtid = NO;
include/assert.inc [Value returned by SSS and PS table for Using_Gtid should be same.]
# 2) Test for Auto_position= CURRENT_POS.
change master to
master_user = 'root',
master_use_gtid= CURRENT_POS;
include/assert.inc [Value returned by SSS and PS table for Using_Gtid should be same.]
# 3) Test for Auto_position= SLAVE_POS
change master to
master_user = 'root',
master_use_gtid= SLAVE_POS;
include/assert.inc [Value returned by SSS and PS table for Using_Gtid should be same.]
# Test INOGRE_SERVER_IDS
# 1) Test for IGNORE_SERVER_IDS= (10, 100);
connection slave;
change master to IGNORE_SERVER_IDS= (10, 100);
include/assert.inc [Value returned by SSS and PS table for Ignore_server_ids should be same.]
CHANGE MASTER TO IGNORE_SERVER_IDS=();
# 2) Test for IGNORE_DOMAIN_IDS(2)
CHANGE MASTER TO IGNORE_DOMAIN_IDS=(2), MASTER_USE_GTID=slave_pos;
include/start_slave.inc
include/assert.inc [Value returned by SSS and PS table for Replicate_Ignore_Domain_Ids should be same.]
include/stop_slave.inc
# 3) Test for DO_DOMAIN_IDS(1)
CHANGE MASTER TO DO_DOMAIN_IDS=(1), IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
include/start_slave.inc
include/assert.inc [Value returned by SSS and PS table for Replicate_Do_Domain_Ids should be same.]
include/stop_slave.inc
CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
include/start_slave.inc
include/rpl_end.inc