403Webshell
Server IP : 172.67.216.182  /  Your IP : 172.68.164.148
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_different_index_master_slave.test
# =========== Purpose ===========
#
# To test that if different primary key is used on master and slave
# and if there is an  Unique key present on slave then that should be
# used for lookup replicated rows.
# Earlier in above cases a TABLE_SCAN was being performed which can be
# slower than INDEX_SCAN that will be performed after the bug fix.
#
# ========= Reference ==========
# Bug#26450129:DEAD BRANCH IN SEARCH_KEY_IN_TABLE()

# The status variable Slave_rows_last_search_algorithm_used is defined
# only in Debug mode, running this test in non-debug mode will cause
# assert failure.
--source include/have_debug.inc
--source include/have_binlog_format_row.inc
--let $rpl_skip_start_slave = 1
--source include/master-slave.inc

--echo ==== Initialize ====

--source include/rpl_connection_slave.inc
SET @old_slave_rows_search_algorithms = @@global.slave_rows_search_algorithms;
SET @@global.slave_rows_search_algorithms = 'INDEX_SCAN,TABLE_SCAN';
--source include/start_slave.inc

--source include/rpl_connection_master.inc
SET @@session.binlog_row_image = 'MINIMAL';

SET @@session.sql_log_bin = 0;
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(b));
SET @@session.sql_log_bin = 1;
--source include/rpl_connection_slave.inc
CREATE TABLE t1 (a INT, b INT NOT NULL, UNIQUE KEY(b), PRIMARY KEY(a));
--source include/rpl_connection_master.inc

--let $row_count = 100
--let $rows = (0, 0)
--let $i = 1
while ($i < $row_count) {
  --let $rows = $rows, ($i, $i)
  --inc $i
}
--disable_query_log
--echo INSERT INTO t1 VALUES [$row_count rows];
eval INSERT INTO t1 VALUES $rows;
--enable_query_log
--source include/sync_slave_sql_with_master.inc

--echo ==== Test ====

--source include/rpl_connection_master.inc

DELETE FROM t1 WHERE b != 0 ORDER BY b DESC;
--source include/sync_slave_sql_with_master.inc


--let $assert_cond = "[SHOW STATUS LIKE \"Slave_rows_last_search_algorithm_used\", Value, 1]" = "INDEX_SCAN"
--let $assert_text= The search algorithm used while deleting rows is INDEX_SCAN, in the code before this bug it was TABLE_SCAN
--source include/assert.inc

# Cleanup
--source include/rpl_connection_master.inc
DROP TABLE t1;
--source include/sync_slave_sql_with_master.inc
--source include/stop_slave.inc
SET @@global.slave_rows_search_algorithms = @old_slave_rows_search_algorithms;

--let $rpl_only_running_threads=1
--source include/rpl_end.inc

Youez - 2016 - github.com/yon3zu
LinuXploit