⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.124
Server IP:
50.28.103.30
Server:
Linux host.jcukjv-lwsites.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
Server Software:
nginx/1.28.0
PHP Version:
8.3.12
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
server
/
mysql
/
mysql-test
/
extra
/
rpl_tests
/
View File Name :
gtid_disconnect_drop_temporary_table.test
# ==== Purpose ==== # # When a client disconnects, temporary tables created by the client # are dropped. This test verifies that this works regardless of what # GTID_NEXT has been set to. # # The following are tested: # # - GTID_NEXT is set and no transaction started. # - GTID_NEXT is set and transaction started but not ended. # - GTID_NEXT is set and transaction committed. # - GTID_NEXT is set and transaction rolled back. # # The test is run both with gtid_mode=on and gtid_mode=off. If # gtid_mode=on, it sets gtid_next='UUID:NUMBER'. If gtid_mode=off, it # sets gtid_next='ANONYMOUS'. # # ==== Implementation ==== # # The core of the logic is: Create a connection. Create a temporary # table on the connection. Set GTID_NEXT. Disconnect. # # The test does this four times, each time doing something different # between set gtid_next and disconnect. # # The test uses include/set_gtid_next_gtid_mode_agnostic.inc to set # gtid_next to 'UUID:NUMBER' if gtid_mode=on and 'ANONYMOUS' if # gtid_mode=off. --source include/not_group_replication_plugin.inc --let $rpl_gtid_utils= 1 --source include/master-slave.inc --let $i= 1 CREATE TABLE t (a INT); while ($i <= 4) { if ($i == 1) { --echo ---- 1. Disconnect after SET GTID_NEXT ---- } if ($i == 2) { --echo ---- 2. Disconnect in the middle of transaction ---- } if ($i == 3) { --echo ---- 3. Disconnect after COMMIT ---- } if ($i == 4) { --echo ---- 4. Disconnect after ROLLBACK ---- } # Create con1. --let $rpl_connection_name= con1 --let $rpl_server_number= 1 --source include/rpl_connect.inc --let $rpl_connection_name= con1 --source include/rpl_connection.inc # Create temp table. CREATE TEMPORARY TABLE tt (a INT); # Set gtid_next --source include/set_gtid_next_gtid_mode_agnostic.inc # Execute (partial) transaction if ($i >= 2) { BEGIN; INSERT INTO t VALUES (1); if ($i == 3) { COMMIT; } if ($i == 4) { ROLLBACK; } } --connection master --source include/save_binlog_position.inc --source include/gtid_step_reset.inc # Disconnect --echo # Disconnecting. --disconnect con1 if (`SELECT @@GLOBAL.binlog_format != 'ROW'`) { # Verify that the binlog contains the expected events. --let $event_sequence= (Anonymous_)?Gtid # !Q(DROP.*TEMPORARY.*) --let $wait_for_binlog_events= 1 --source include/assert_binlog_events.inc } # Sync with slave and assert slave has dropped the temp table. --source include/sync_slave_sql_with_master.inc --let $assert_text= Slave should not have any open temporary tables. --let $assert_cond= VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = "SLAVE_OPEN_TEMP_TABLES" --source include/assert.inc # Verify that one gtid was added if gtid_mode=on --connection master --let $gtid_step_gtid_mode_agnostic= 1 --let $gtid_step_count= 0 if (`SELECT @@GLOBAL.binlog_format != 'ROW'`) { --let $gtid_step_count= 1 } --source include/gtid_step_assert.inc --inc $i } --echo ---- Clean up ---- DROP TABLE t; --source include/sync_slave_sql_with_master.inc --source include/rpl_end.inc