Server IP : 104.21.38.3 / Your IP : 162.158.190.98 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/server/mysql/src/mysql-test/suite/rpl/r/ |
Upload File : |
include/master-slave.inc Warnings: Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] CREATE TABLE IF NOT EXISTS t1 (a INT) ENGINE=InnoDB; CREATE TABLE t2 (a INT) ENGINE=MyISAM; # # Verify that XA transactions' gtids can be reported # from global.gtid_executed correctly. # INSERT INTO t2 VALUES(1); XA START '1'; INSERT INTO t2 VALUES(2); INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); XA END '1'; XA PREPARE '1'; XA COMMIT '1'; include/assert.inc [committed gtids MASTER_UUID:1-6] # # Verify that specified gtid for XA transaction can be reported # from global.gtid_executed correctly. # SET @@SESSION.GTID_NEXT= 'MASTER_UUID:16'; XA START '1'; INSERT INTO t1 VALUES(3); XA END '1'; XA PREPARE '1'; SET @@SESSION.GTID_NEXT= 'MASTER_UUID:17'; XA COMMIT '1'; include/assert.inc [committed gtids MASTER_UUID:1-6:16-17] # # Verify that we can store gtids MASTER_UUID:1-6:16 in gtid_executed # table for XA transactions on binlog rotation. # SET GTID_NEXT='AUTOMATIC'; FLUSH LOGS; SELECT * FROM mysql.gtid_executed; source_uuid interval_start interval_end MASTER_UUID 1 6 MASTER_UUID 16 17 include/sync_slave_sql_with_master.inc # # connection slave # call mtr.add_suppression("You need to use --log-bin to make --binlog-format work"); call mtr.add_suppression("Slave SQL for channel '': Error in Xid_log_event: Commit could not " "be completed, 'Got error -1 from storage engine', " "Error_code: 1030"); call mtr.add_suppression("Slave.*Got error -1 from storage engine.*Error_code: 1030"); call mtr.add_suppression("Slave: An error occured at storing the GTID value"); call mtr.add_suppression("The slave coordinator and worker threads are stopped"); include/assert.inc [committed gtids MASTER_UUID:1-6:16-17] # # Verify that the transaction is skiped if its specified gtid # is already in global.gtid_executed. # SET @@SESSION.GTID_NEXT= 'MASTER_UUID:4'; INSERT INTO t1 VALUES(11); include/assert.inc [Table t1 must not contain 11] # # Verify that the specified gtid to GTID_NEXT is stored into # global.gtid_executed and gtid_executed table. # SET @@SESSION.GTID_NEXT= 'MASTER_UUID:18'; COMMIT; include/assert.inc [committed gtids MASTER_UUID:1-6:16-18] # # Verify that we store gtid into gtid_executed table within # each transaction when binlog is disabled. # SELECT * FROM mysql.gtid_executed; source_uuid interval_start interval_end MASTER_UUID 1 1 MASTER_UUID 2 2 MASTER_UUID 3 3 MASTER_UUID 4 4 MASTER_UUID 5 5 MASTER_UUID 6 6 MASTER_UUID 16 16 MASTER_UUID 17 17 MASTER_UUID 18 18 # # Verify that the gtid_executed table is compressed. # SET @debug_save= @@GLOBAL.DEBUG; SET @@GLOBAL.DEBUG= '+d,compress_gtid_table'; SET @@SESSION.GTID_NEXT= 'MASTER_UUID:19'; COMMIT; SET DEBUG_SYNC='now WAIT_FOR complete_compression'; SET GLOBAL DEBUG= @debug_save; SELECT * FROM mysql.gtid_executed; source_uuid interval_start interval_end MASTER_UUID 1 6 MASTER_UUID 16 19 # # Verify that gtid_executed and gtid_purged are always same # when binlog is disabled. # include/assert.inc [gtid_executed and gtid_purged are always same when binlog is disabled] SET GTID_NEXT='AUTOMATIC'; # # Verify that no gtid is generated for transaction # when binlog is disabled # CREATE TABLE t3 (a INT); INSERT INTO t1 VALUES(12); DROP TABLE t3; # # Stored gtids MASTER_UUID:1-6:16-19 in gtid_executed table # on slave. SELECT * FROM mysql.gtid_executed; source_uuid interval_start interval_end MASTER_UUID 1 6 MASTER_UUID 16 19 SET @@SESSION.GTID_NEXT = 'automatic'; XA START 'xid_1'; INSERT INTO t1 VALUES(1); XA END 'xid_1'; XA PREPARE 'xid_1'; SET @@SESSION.GTID_NEXT = 'automatic'; XA COMMIT 'xid_1'; SET @@SESSION.GTID_NEXT = 'automatic'; SET @@SESSION.GTID_NEXT = 'automatic'; XA START 'xid_1'; INSERT INTO t1 VALUES(1); XA END 'xid_1'; XA PREPARE 'xid_1'; SET @@SESSION.GTID_NEXT = 'automatic'; XA ROLLBACK 'xid_1'; SET @@SESSION.GTID_NEXT = 'automatic'; SET @@SESSION.GTID_NEXT = 'automatic'; XA START 'xid_1'; INSERT INTO t1 VALUES(1); XA END 'xid_1'; XA PREPARE 'xid_1'; SET @@SESSION.GTID_NEXT = 'MASTER_UUID:20'; XA ROLLBACK 'xid_1'; SET @@SESSION.GTID_NEXT = 'automatic'; SET @@SESSION.GTID_NEXT = 'MASTER_UUID:21'; XA START 'xid_1'; INSERT INTO t1 VALUES(1); XA END 'xid_1'; XA PREPARE 'xid_1'; XA ROLLBACK 'xid_1'; ERROR HY000: When @@SESSION.GTID_NEXT is set to a GTID, you must explicitly set it to a different value after a COMMIT or ROLLBACK. Please check GTID_NEXT variable manual page for detailed explanation. Current @@SESSION.GTID_NEXT is 'MASTER_UUID:21'. SET @@SESSION.GTID_NEXT = 'automatic'; XA ROLLBACK 'xid_1'; SET @@SESSION.GTID_NEXT = 'automatic'; DROP TABLE t1, t2; include/sync_slave_sql_with_master.inc CREATE TABLE t3 (a INT); include/sync_slave_sql_with_master.inc # # Verify that transaction's gtid is not stored into gtid_executed table # and the transaction is rolled back if we encounter an error # when writing gtid into table when binlog is disabled and # gtid_mode is enabled. # SET @@GLOBAL.DEBUG= '+d,simulate_err_on_write_gtid_into_table'; INSERT INTO t3 VALUES(1); include/wait_for_slave_sql_error.inc [errno=1030] SET GLOBAL DEBUG= @debug_save; include/stop_slave_io.inc # # Stored gtids MASTER_UUID:1-14:16-21 in gtid_executed table on slave. # SELECT * FROM mysql.gtid_executed; source_uuid interval_start interval_end MASTER_UUID 1 6 MASTER_UUID 7 7 MASTER_UUID 8 8 MASTER_UUID 9 9 MASTER_UUID 10 10 MASTER_UUID 11 11 MASTER_UUID 12 12 MASTER_UUID 13 13 MASTER_UUID 14 14 MASTER_UUID 16 19 MASTER_UUID 20 20 MASTER_UUID 21 21 include/assert.inc [committed gtids MASTER_UUID:1-14:16-21] include/assert.inc [Table t3 must not contain 1] DROP TABLE t3; CALL mtr.add_suppression("Statement is unsafe because it is being used inside a XA transaction"); DROP TABLE t3; CALL mtr.add_suppression("Statement is unsafe because it is being used inside a XA transaction"); RESET SLAVE; include/rpl_end.inc