1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge trunk-bugfixing -> trunk-runtime

This commit is contained in:
Konstantin Osipov
2010-06-17 17:31:51 +04:00
388 changed files with 6327 additions and 11537 deletions

View File

@ -41,13 +41,10 @@ while ($1)
--enable_query_log
commit;
drop table t1;
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events in 'master-bin.000001' from 107;
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events in 'master-bin.000002' from 107;
--source include/show_binlog_events.inc
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--source include/show_binlog_events.inc
--let $binlog_file=
#
# Bug#22540 - Incorrect value in column End_log_pos of
@ -77,8 +74,7 @@ insert into t1 values (2);
insert into t1 values (3);
commit;
drop table t1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
show binlog events from 0;
--source include/show_binlog_events.inc
# now show that nothing breaks if we need to read from the cache more
# than once, resulting in split event-headers
@ -100,8 +96,7 @@ while ($1)
commit;
enable_query_log;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
show binlog events from 0;
--source include/show_binlog_events.inc
drop table t1;
@ -122,8 +117,7 @@ set @b= 14632475938453979136;
execute stmt using @a, @b;
deallocate prepare stmt;
drop table t1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
show binlog events from 0;
--source include/show_binlog_events.inc
#

View File

@ -127,12 +127,7 @@ select * from t1;
select * from t2;
select * from t3;
let $VERSION=`select version()`;
--replace_result $VERSION VERSION
--replace_column 2 # 4 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
--replace_regex /file_id=[0-9]+/file_id=#/
show binlog events;
--source include/show_binlog_events.inc
drop table t1,t2,t3;
@ -170,18 +165,21 @@ set autocommit=0;
start transaction;
insert into t1 values(1);
commit;
let $master_log_pos_1= query_get_value(SHOW MASTER STATUS, Position, 1);
start transaction;
insert into t1 values(2);
rollback;
let $master_log_pos_2= query_get_value(SHOW MASTER STATUS, Position, 1);
if (`SELECT $master_log_pos_2 <> $master_log_pos_1`)
{
echo $master_log_pos_1 $master_log_pos_2;
die Rollbacked transaction has been binlogged;
}
set autocommit=1;
let $VERSION=`select version()`;
--replace_result $VERSION VERSION
--replace_column 2 # 4 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
--replace_regex /file_id=[0-9]+/file_id=#/
show binlog events;
drop table if exists t1;
#

View File

@ -61,7 +61,7 @@ sync_with_master;
SELECT * FROM t1;
SELECT * FROM t3;
# Check that no error is reported
--source include/show_slave_status2.inc
source include/check_slave_is_running.inc;
--echo
# 2) Test lock wait timeout
@ -89,7 +89,7 @@ sync_with_master;
SELECT * FROM t1;
SELECT * FROM t3;
# Check that no error is reported
--source include/show_slave_status2.inc
source include/check_slave_is_running.inc;
--echo
# 3) Test lock wait timeout and purged relay log
@ -103,6 +103,7 @@ SET global max_relay_log_size=0;
--source include/stop_slave.inc
DELETE FROM t2;
# Set slave position to the BEGIN log event
--replace_result $master_pos_begin MASTER_POS_BEGIN
eval CHANGE MASTER TO MASTER_LOG_POS=$master_pos_begin;
BEGIN;
# Hold lock
@ -119,7 +120,7 @@ sync_with_master;
SELECT * FROM t1;
SELECT * FROM t3;
# Check that no error is reported
--source include/show_slave_status2.inc
source include/check_slave_is_running.inc;
--echo
# Clean up

View File

@ -146,12 +146,7 @@ SELECT COUNT(*) FROM t1;
--echo
SELECT * FROM t1 ORDER BY f3 LIMIT 20;
--echo
--echo * Show Slave Status *
--echo
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical show slave status;
--echo
--source include/check_slave_is_running.inc
### Altering table def scenario
--echo
@ -431,16 +426,14 @@ connection master;
delete from t4;
delete from t31;
--echo
--echo ** Check slave status **
--echo
#connection slave;
sync_slave_with_master;
select * from t31;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical show slave status;
--echo
--echo ** Check slave status **
--echo
--source include/check_slave_is_running.inc
#### Clean Up ####
@ -493,16 +486,15 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
--echo
--echo ********************************************
--echo *** Expect slave to fail with Error 1523 ***
--echo *** Expect slave to fail with Error 1677 ***
--echo ********************************************
--echo
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
# 1677 = ER_SLAVE_CONVERSION_FAILED
--let $slave_sql_errno= 1677
--let $slave_skip_counter= 2
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error_and_skip.inc
--echo
--echo *** Drop t10 ***
@ -550,16 +542,15 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
--echo
--echo ********************************************
--echo *** Expect slave to fail with Error 1523 ***
--echo *** Expect slave to fail with Error 1677 ***
--echo ********************************************
--echo
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
# 1677 = ER_SLAVE_CONVERSION_FAILED
--let $slave_sql_errno= 1677
--let $slave_skip_counter= 2
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error_and_skip.inc
--echo
--echo *** Drop t11 ***
@ -697,10 +688,10 @@ SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
# Remove below once fixed
#***************************
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
# 1091 = ER_CANT_DROP_FIELD_OR_KEY
--let $slave_sql_errno= 1091
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
#***************************
STOP SLAVE;
@ -763,10 +754,10 @@ SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
--echo ********************************************
--echo
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
# 1054 = ER_BAD_FIELD_ERROR
--let $slave_sql_errno= 1054
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
STOP SLAVE;
RESET SLAVE;
@ -840,10 +831,10 @@ SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
--echo *****************
--echo
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
# 1072 = ER_KEY_COLUMN_DOES_NOT_EXITS
--let $slave_sql_errno= 1072
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
STOP SLAVE;
RESET SLAVE;

View File

@ -101,9 +101,9 @@ SELECT * FROM t2 ORDER BY a;
--echo *** Start Slave ***
connection slave;
START SLAVE;
source include/wait_for_slave_sql_to_stop.inc;
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
--echo Slave failed with Error $errno
--let $slave_sql_errno= 1677
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
STOP SLAVE;
RESET SLAVE;
SELECT * FROM t2 ORDER BY a;
@ -153,11 +153,10 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TEST
--echo *** Expect slave to fail with Error 1677 ***
--echo ********************************************
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
--echo Slave failed with Error $errno
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
--let $slave_sql_errno= 1677
--let $slave_skip_counter= 2
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error_and_skip.inc
--echo *** Drop t3 ***
connection master;
@ -197,11 +196,10 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
--echo *** Expect slave to fail with Error 1677 ***
--echo ********************************************
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
--echo Slave failed with Error $errno
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
--let $slave_sql_errno= 1677
--let $slave_skip_counter= 2
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error_and_skip.inc
--echo *** Drop t4 ***
connection master;
@ -241,11 +239,10 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
--echo *** Expect slave to fail with Error 1677 ***
--echo ********************************************
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
--echo Slave failed with Error $errno
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
--let $slave_sql_errno= 1677
--let $slave_skip_counter= 2
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error_and_skip.inc
--echo *** Drop t5 ***
connection master;
@ -286,9 +283,9 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
--echo *** Expect slave to fail with Error 1677 ***
--echo ********************************************
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
--echo Slave failed with Error $errno
--let $slave_sql_errno= 1677
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
#START SLAVE;
@ -387,12 +384,10 @@ INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
### Uncomment once bug is fixed
#connection slave;
#wait_for_slave_to_stop;
#--replace_result $MASTER_MYPORT MASTER_PORT
#--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
#--query_vertical SHOW SLAVE STATUS
#SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
#START SLAVE;
#--let $slave_sql_errno= SOMETHING
#--let $slave_skip_counter= 2
#--let $show_slave_sql_error= 1
#--source include/wait_for_slave_sql_error_and_skip.inc
--echo *** Drop t8 ***
connection master;
@ -451,12 +446,10 @@ if (`SELECT $engine_type != 'NDB'`)
# todo: fix Bug #43992 slave sql thread can't tune own sql_mode ...
# and add/restore waiting for stop test
#--source include/wait_for_slave_sql_to_stop.inc
#--replace_result $MASTER_MYPORT MASTER_PORT
#--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
#--query_vertical SHOW SLAVE STATUS
#SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
#START SLAVE;
#--let $slave_sql_errno= SOMETHING
#--let $slave_skip_counter= 2
#--let $show_slave_sql_error= 1
#--source include/wait_for_slave_sql_error_and_skip.inc
}
#--echo *** Drop t9 ***
@ -494,11 +487,10 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
--echo *** Expect slave to fail with Error 1677 ***
--echo ********************************************
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
--echo Slave failed with Error $errno
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
--let $slave_sql_errno= 1677
--let $slave_skip_counter= 2
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error_and_skip.inc
--echo *** Drop t10 ***
connection master;
@ -537,11 +529,10 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
--echo *** Expect slave to fail with Error 1677 ***
--echo ********************************************
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
--echo Slave failed with Error $errno
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
--let $slave_sql_errno= 1677
--let $slave_skip_counter= 2
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error_and_skip.inc
--echo *** Drop t11 ***
connection master;
@ -808,11 +799,10 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
--echo *** Expect slave to fail with Error 1060 ***
--echo ********************************************
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
--echo Slave failed with Error $errno
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
--let $slave_sql_errno= 1060
--let $slave_skip_counter= 1
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error_and_skip.inc
--echo *** Try to insert in master ****
connection master;
@ -918,11 +908,10 @@ INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
--echo *** Expect slave to fail with Error 1677 ***
--echo ********************************************
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
--echo Slave failed with Error $errno
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
--let $slave_sql_errno= 1677
--let $slave_skip_counter= 2
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error_and_skip.inc
--echo ** DROP table t17 ***
connection master;

View File

@ -27,8 +27,8 @@ select * from t3;
# This FLUSH should go into the binlog to not confuse the slave.
flush tables;
# Check that it's in the binlog.
let $binlog_start= $rename_event_pos;
source include/show_binlog_events.inc;
let $wait_binlog_event= flush tables;
source include/wait_for_binlog_event.inc;
sync_slave_with_master;
# Check that the slave is not confused.

View File

@ -68,19 +68,15 @@ eval SET DEBUG_SYNC=$debug_sync_action;
# Show slave last IO errno
connection slave;
source include/wait_for_slave_io_error.inc;
let $last_io_errno= query_get_value("show slave status", Last_IO_Errno, 1);
--echo Check network error happened here
if (`SELECT '$last_io_errno' = '2013' || # CR_SERVER_LOST
'$last_io_errno' = '2003' || # CR_CONN_HOST_ERROR
'$last_io_errno' = '2002' || # CR_CONNECTION_ERROR
'$last_io_errno' = '2006' || # CR_SERVER_GONE_ERROR
'$last_io_errno' = '1040' || # ER_CON_COUNT_ERROR
'$last_io_errno' = '1053' # ER_SERVER_SHUTDOWN
`)
{
--echo NETWORK ERROR
}
# '2013' CR_SERVER_LOST
# '2003' CR_CONN_HOST_ERROR
# '2002' CR_CONNECTION_ERROR
# '2006' CR_SERVER_GONE_ERROR
# '1040' ER_CON_COUNT_ERROR
# '1053' ER_SERVER_SHUTDOWN
let $slave_io_errno= 1040, 1053, 2002, 2003, 2006, 2013;
source include/wait_for_slave_io_error.inc;
# deactivate the sync point of get_master_version_and_clock()
# now to avoid restarting IO-thread to re-enter it.

View File

@ -91,7 +91,7 @@ connection master;
# Bug #29571: INSERT DELAYED IGNORE written to binary log on the master but
# on the slave
#
if (`SELECT @@global.binlog_format != 'ROW'`)
if (`SELECT @@global.binlog_format = 'STATEMENT'`)
{
#flush the logs before the test
connection slave;
@ -101,27 +101,42 @@ if (`SELECT @@global.binlog_format != 'ROW'`)
}
CREATE TABLE t1(a int, UNIQUE(a));
--let $_start= query_get_value(SHOW MASTER STATUS, Position, 1)
INSERT DELAYED IGNORE INTO t1 VALUES(1);
INSERT DELAYED IGNORE INTO t1 VALUES(1);
flush table t1; # to wait for INSERT DELAYED to be done
if (`SELECT @@global.binlog_format != 'ROW'`)
if (`SELECT @@global.binlog_format = 'STATEMENT'`)
{
#must show two INSERT DELAYED
--replace_column 1 x 2 x 3 x 4 x 5 x
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events in 'master-bin.000002' LIMIT 2,2;
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
# The first INSERT DELAYED
--let $stmt= query_get_value(SHOW BINLOG EVENTS IN '$binlog_file' FROM $_start, Info, 2)
--echo $stmt
# The second INSERT DELAYED statement is the 3 item if two INSERT DELAYED are
# handled together
--let $stmt= query_get_value(SHOW BINLOG EVENTS IN '$binlog_file' FROM $_start, Info, 3)
# The second INSERT DELAYED statement is the 5 item if two INSERT DELAYED are
# handled separately
if (`SELECT '$stmt' = 'COMMIT'`)
{
--let $stmt= query_get_value(SHOW BINLOG EVENTS IN '$binlog_file' FROM $_start, Info, 5)
}
--echo $stmt
}
select * from t1;
sync_slave_with_master;
echo On slave;
if (`SELECT @@global.binlog_format != 'ROW'`)
if (`SELECT @@global.binlog_format = 'STATEMENT'`)
{
#must show two INSERT DELAYED
--replace_column 1 x 2 x 3 x 4 x 5 x
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events in 'slave-bin.000002' LIMIT 2,2;
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--let $binlog_limit= 1,6
--source include/show_binlog_events.inc
}
select * from t1;

View File

@ -31,19 +31,17 @@ eval create table t1 (word char(20) not null)ENGINE=$engine_type;
--replace_result $LOAD_FILE LOAD_FILE
eval load data infile '$LOAD_FILE' into table t1 ignore 1 lines;
select count(*) from t1;
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events;
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events from 107 limit 1;
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events from 107 limit 2;
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events from 107 limit 1,4;
source include/show_binlog_events.inc;
let $binlog_limit= 1;
source include/show_binlog_events.inc;
let $binlog_limit= 2;
source include/show_binlog_events.inc;
let $binlog_limit= 1,4;
source include/show_binlog_events.inc;
let $binlog_limit=;
flush logs;
# We need an extra update before doing save_master_pos.
@ -84,27 +82,24 @@ connection master;
eval create table t2 (n int)ENGINE=$engine_type;
insert into t2 values (1);
source include/show_binlog_events.inc;
--replace_result $VERSION VERSION
--replace_regex /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /infile '.+'/infile 'words.dat'/
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events in 'master-bin.000002';
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
source include/show_binlog_events.inc;
--replace_column 2 #
show binary logs;
sync_slave_with_master;
--source include/wait_for_slave_to_start.inc
--replace_column 2 #
show binary logs;
--replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION
--replace_column 2 # 5 #
--replace_regex /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /INFILE '.+'/INFILE 'words.dat'/
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events in 'slave-bin.000001' from 4;
--replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events in 'slave-bin.000002' from 4;
source include/show_slave_status2.inc;
let $binlog_file=;
source include/show_binlog_events.inc;
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
source include/show_binlog_events.inc;
let $binlog_file=;
source include/check_slave_is_running.inc;
# Need to recode the following

View File

@ -43,7 +43,7 @@ set global max_relay_log_size=8192-1; # mapped to 4096
select @@global.max_relay_log_size;
start slave;
sync_with_master;
source include/show_slave_status2.inc;
--source include/check_slave_is_running.inc
--echo #
--echo # Test 2
@ -55,7 +55,7 @@ set global max_relay_log_size=(5*4096);
query_vertical select @@global.max_relay_log_size;
start slave;
sync_with_master;
source include/show_slave_status2.inc;
--source include/check_slave_is_running.inc
--echo #
--echo # Test 3: max_relay_log_size = 0
@ -67,7 +67,7 @@ set global max_relay_log_size=0;
query_vertical select @@global.max_relay_log_size;
start slave;
sync_with_master;
source include/show_slave_status2.inc;
--source include/check_slave_is_running.inc
--echo #
--echo # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
@ -78,7 +78,6 @@ reset slave;
# test of relay log rotation when the slave is stopped
# (to make sure it does not crash).
flush logs;
source include/show_slave_status2.inc;
--echo #
--echo # Test 5
@ -93,10 +92,8 @@ flush logs;
# log we just closed. But a trick to achieve this is do an update on the master.
connection master;
create table t1 (a int);
save_master_pos;
connection slave;
sync_with_master;
source include/show_slave_status2.inc;
sync_slave_with_master;
--source include/check_slave_is_running.inc
--echo #
--echo # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
@ -105,10 +102,8 @@ source include/show_slave_status2.inc;
flush logs;
connection master;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;
source include/show_slave_status2.inc;
sync_slave_with_master;
--source include/check_slave_is_running.inc
connection master;
# test that the absence of relay logs does not make a master crash

View File

@ -56,24 +56,23 @@ connection master;
--echo # since insert is done with transactional engine, expect a BEGIN
--echo # at <start_pos>
--echo
--replace_result $start_pos <start_pos>
--replace_column 5 #
--eval show binlog events from $start_pos limit 1
--let $binlog_start= $start_pos
--let $binlog_limit= 1
--source include/show_binlog_events.inc
--echo
--echo # Now the insert, one step after
--echo
--replace_result $start_pos <start_pos>
--replace_column 2 # 5 #
--eval show binlog events from $start_pos limit 1,1
--let $binlog_start= $start_pos
--let $binlog_limit= 1,1
--source include/show_binlog_events.inc
--echo
--echo # and the COMMIT should be at <end_pos>
--echo
--replace_result $start_pos <start_pos> $end_pos <end_pos>
--replace_column 2 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
--eval show binlog events from $start_pos limit 2,1
--let $binlog_start= $start_pos
--let $binlog_limit= 2,1
--source include/show_binlog_events.inc
--echo
@ -89,18 +88,17 @@ commit;
--source include/select_ndb_apply_status.inc
connection master;
--replace_result $start_pos <start_pos>
--replace_column 5 #
--eval show binlog events from $start_pos limit 1
--let $binlog_start= $start_pos
--let $binlog_limit= 1
--source include/show_binlog_events.inc
--echo
--replace_result $start_pos <start_pos>
--replace_column 2 # 4 # 5 #
--eval show binlog events from $start_pos limit 1,2
--let $binlog_start= $start_pos
--let $binlog_limit= 1,2
--source include/show_binlog_events.inc
--echo
--replace_result $start_pos <start_pos> $end_pos <end_pos>
--replace_column 2 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
--eval show binlog events from $start_pos limit 3,1
--let $binlog_start= $start_pos
--let $binlog_limit= 3,1
--source include/show_binlog_events.inc
--echo

View File

@ -9,37 +9,33 @@
# RESET SLAVE.
-- source include/master-slave.inc
connection master;
save_master_pos;
connection slave;
sync_with_master;
source include/show_slave_status2.inc;
sync_slave_with_master;
let $status_items= Master_User, Master_Host;
source include/show_slave_status.inc;
stop slave;
source include/stop_slave.inc;
change master to master_user='test';
source include/show_slave_status2.inc;
source include/show_slave_status.inc;
reset slave;
source include/show_slave_status2.inc;
source include/show_slave_status.inc;
change master to master_user='root';
start slave;
source include/start_slave.inc;
sync_with_master;
source include/show_slave_status2.inc;
source include/show_slave_status.inc;
# test of crash with temp tables & RESET SLAVE
# (test to see if RESET SLAVE clears temp tables in memory and disk)
stop slave;
source include/stop_slave.inc;
reset slave;
start slave;
source include/start_slave.inc;
connection master;
create temporary table t1 (a int);
save_master_pos;
connection slave;
sync_with_master;
stop slave;
sync_slave_with_master;
source include/stop_slave.inc;
reset slave;
start slave;
source include/start_slave.inc;
sync_with_master;
show status like 'slave_open_temp_tables';
@ -48,10 +44,9 @@ show status like 'slave_open_temp_tables';
#
# clearing the status
stop slave;
source include/stop_slave.inc;
reset slave;
let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
echo *** errno must be zero: $last_io_errno ***;
source include/check_slave_no_error.inc;
#
# verifying start slave resets Last_IO_Error and Last_IO_Errno.
@ -59,40 +54,24 @@ echo *** errno must be zero: $last_io_errno ***;
change master to master_user='impossible_user_name';
start slave;
let $slave_io_errno= 1045;
source include/wait_for_slave_io_error.inc;
let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
--disable_query_log
eval SELECT $last_io_errno > 0 as ONE;
--enable_query_log
source include/stop_slave.inc;
stop slave;
change master to master_user='root';
source include/start_slave.inc;
let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
--echo *** last errno must be zero: $last_io_errno ***
--echo *** last error must be blank: $last_io_error ***
source include/check_slave_no_error.inc;
#
# verifying reset slave resets Last_{IO,SQL}_Err{or,no}
#
source include/stop_slave.inc;
stop slave;
change master to master_user='impossible_user_name';
start slave;
let $slave_io_errno= 1045;
source include/wait_for_slave_io_error.inc;
let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
--disable_query_log
eval SELECT $last_io_errno > 0 as ONE;
--enable_query_log
source include/stop_slave.inc;
stop slave;
reset slave;
let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
let $last_sql_errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
let $last_sql_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
--echo *** io last errno must be zero: $last_io_errno ***
--echo *** io last error must be blank: $last_io_error ***
--echo *** sql last errno must be zero: $last_sql_errno ***
--echo *** sql last error must be blank: $last_sql_error ***
source include/check_slave_no_error.inc;

View File

@ -270,10 +270,7 @@ DELETE FROM t1;
query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
sync_slave_with_master;
set @@global.slave_exec_mode= default;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
source include/check_slave_is_running.inc;
query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
# BUG#37076: TIMESTAMP/DATETIME values are not replicated correctly
@ -412,11 +409,10 @@ INSERT INTO t5 VALUES (1, "", 1);
INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
# 1677 = ER_SLAVE_CONVERSION_FAILED
--let $slave_sql_errno= 1677
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
connection master;
RESET MASTER;
connection slave;
@ -431,11 +427,10 @@ INSERT INTO t6 VALUES (1, "", 1);
INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
# 1677 = ER_SLAVE_CONVERSION_FAILED
--let $slave_sql_errno= 1677
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
connection master;
RESET MASTER;
connection slave;

View File

@ -138,9 +138,7 @@ SELECT * FROM t2;
sync_slave_with_master;
--echo **** On Slave ****
SELECT * FROM t2;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS
--source include/check_slave_is_running.inc
connection master;
INSERT INTO t9 VALUES (4);
@ -149,12 +147,10 @@ sync_slave_with_master;
connection master;
INSERT INTO t4 VALUES (4);
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
--let $slave_skip_counter= 2
--let $slave_sql_errno= 1677
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error_and_skip.inc
connection master;
INSERT INTO t9 VALUES (5);
@ -163,12 +159,10 @@ sync_slave_with_master;
connection master;
INSERT INTO t5 VALUES (5,10,25);
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
--let $slave_skip_counter= 2
--let $slave_sql_errno= 1677
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error_and_skip.inc
connection master;
INSERT INTO t9 VALUES (6);
@ -177,19 +171,15 @@ sync_slave_with_master;
connection master;
INSERT INTO t6 VALUES (6,12,36);
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
--let $slave_skip_counter= 2
--let $slave_sql_errno= 1677
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error_and_skip.inc
connection master;
INSERT INTO t9 VALUES (6);
sync_slave_with_master;
--replace_result $SLAVE_MYPORT SLAVE_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS
--source include/check_slave_is_running.inc
# Testing some tables extra field that can be null and cannot be null
# (but have default values)

View File

@ -9,113 +9,96 @@ INSERT INTO t1 VALUES (5);
INSERT INTO t1 VALUES (6);
-- echo [MASTER] ********* SOW BINLOG EVENTS IN ... *********
let $binary_log_file= master-bin.000001;
-- source include/show_binlog_events.inc
-- echo [MASTER] ********* SOW BINLOG EVENTS *********
let $binary_log_file= ;
let $binlog_file= ;
-- source include/show_binlog_events.inc
-- echo [MASTER] ********* SOW BINLOG EVENTS ... LIMIT rows *********
let $binary_log_file= ;
let $binary_log_limit_row= 3;
let $binlog_limit= 3;
-- source include/show_binlog_events.inc
-- echo [MASTER] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
let $binary_log_file= ;
let $binary_log_limit_row= 4;
let $binary_log_limit_offset= 1;
let $binlog_limit= 1,4;
-- source include/show_binlog_events.inc
# clear show_binlog_event/show_relaylog_events parameters
let $binary_log_file= ;
let $binary_log_limit_row= ;
let $binary_log_limit_offset= ;
let $binlog_limit= ;
-- sync_slave_with_master
-- echo [SLAVE] ********* SOW BINLOG EVENTS IN ... *********
let $binary_log_file= slave-bin.000001;
-- source include/show_binlog_events.inc
-- echo [SLAVE] ********* SOW BINLOG EVENTS *********
let $binary_log_file= ;
let $binlog_file= ;
-- source include/show_binlog_events.inc
-- echo [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT rows *********
let $binary_log_file= ;
let $binary_log_limit_row= 3;
let $binlog_limit= 3;
-- source include/show_binlog_events.inc
-- echo [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
let $binary_log_file= ;
let $binary_log_limit_row= 4;
let $binary_log_limit_offset= 1;
let $binlog_limit= 1,4;
-- source include/show_binlog_events.inc
# clear show_binlog_event/show_relaylog_events parameters
let $binary_log_file= ;
let $binary_log_limit_row= ;
let $binary_log_limit_offset= ;
let $binlog_limit= ;
-- echo [SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
let $binary_log_file= slave-relay-bin.000003;
let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
-- source include/show_relaylog_events.inc
-- echo [SLAVE] ********* SOW RELAYLOG EVENTS *********
let $binary_log_file= ;
let $binlog_file= ;
-- source include/show_relaylog_events.inc
-- echo [MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT rows *********
let $binary_log_file= slave-relay-bin.000003;
let $binary_log_limit_row= 3;
let $binary_log_limit_offset= ;
let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
let $binlog_limit= 3;
-- source include/show_relaylog_events.inc
-- echo [MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT offset,rows *********
let $binary_log_file= slave-relay-bin.000003;
let $binary_log_limit_offset= 1;
let $binary_log_limit_row= 3;
let $binlog_limit= 1,3;
-- source include/show_relaylog_events.inc
FLUSH LOGS;
let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
-- connection master
FLUSH LOGS;
DROP TABLE t1;
# clear show_binlog_event/show_relaylog_events parameters
let $binary_log_file= ;
let $binary_log_limit_row= ;
let $binary_log_limit_offset= ;
let $binlog_file= ;
let $binlog_limit= ;
-- echo [MASTER] ********* SOW BINLOG EVENTS IN ... *********
let $binary_log_file= master-bin.000002;
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
-- source include/show_binlog_events.inc
-- echo [MASTER] ********* SOW BINLOG EVENTS *********
let $binary_log_file= ;
let $binlog_file= ;
-- source include/show_binlog_events.inc
-- sync_slave_with_master
-- echo [SLAVE] ********* SOW BINLOG EVENTS IN ... *********
let $binary_log_file= slave-bin.000002;
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
-- source include/show_binlog_events.inc
-- echo [SLAVE] ********* SOW BINLOG EVENTS *********
let $binary_log_file= ;
let $binlog_file= ;
-- source include/show_binlog_events.inc
-- echo [SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
let $binary_log_file= slave-relay-bin.000005;
-- source include/show_relaylog_events.inc
-- echo [SLAVE] ********* SOW RELAYLOG EVENTS *********
let $binary_log_file= ;
let $binlog_file= ;
-- source include/show_relaylog_events.inc
# clear show_binlog_event/show_relaylog_events parameters
let $binary_log_name= ;
let $binary_log_limit_row= ;
let $binary_log_limit_offset= ;
let $binlog_file= ;
let $binlog_limit= ;