mysql-5.5.31 merge

This commit is contained in:
Sergei Golubchik 2013-05-07 13:05:09 +02:00
commit b381cf843c
264 changed files with 3750 additions and 1720 deletions

View file

@ -23,6 +23,18 @@ let $keep_connection= 1;
--source include/rpl_init.inc
--echo
#set auto inc variables at each server
--let $_rpl_server= $rpl_server_count
while ($_rpl_server)
{
--let $rpl_connection_name= server_$_rpl_server
--source include/rpl_connection.inc
eval SET auto_increment_increment= $rpl_server_count;
eval SET auto_increment_offset= $_rpl_server;
--dec $_rpl_server
}
# Preparing data.
--echo *** Preparing data ***
--connection server_1

View file

@ -2,7 +2,13 @@
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
# Note: The test is dependent on binlog positions
##############################################################################
# The test is dependent on binlog positions. The test is divided into two
# sections. The first section checks START SLAVE UNTIL MASTER_LOG_FILE =
# 'log_name', MASTER_LOG_POS = log_pos followed by a couple of failure
# scenarios. The second section checks START SLAVE UNTIL RELAY_LOG_FILE =
# 'log_name', RELAY_LOG_POS = log_pos.
##############################################################################
# Create some events on master
connection master;
@ -24,13 +30,6 @@ CREATE TABLE t2(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
INSERT INTO t2 VALUES (1),(2);
# Save master log position for query INSERT INTO t2 VALUES (1),(2);
let $master_pos_insert1_t2= query_get_value(SHOW MASTER STATUS, Position, 1);
sync_slave_with_master;
#show binlog events;
# Save relay log position for query INSERT INTO t2 VALUES (1),(2);
let $relay_pos_insert1_t2= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1);
connection master;
INSERT INTO t2 VALUES (3),(4);
DROP TABLE t2;
# Save master log position for query DROP TABLE t2;
@ -71,18 +70,6 @@ SELECT * FROM t1;
--let $slave_param_value= $master_pos_drop_t1
--source include/check_slave_param.inc
# Try replicate all up to and not including the second insert to t2;
echo START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=relay_pos_insert1_t2;
--disable_query_log
eval START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=$relay_pos_insert1_t2;
--enable_query_log
--source include/wait_for_slave_sql_to_stop.inc
SELECT * FROM t2;
--let $slave_param= Exec_Master_Log_Pos
--let $slave_param_value= $master_pos_insert1_t2
--source include/check_slave_param.inc
# clean up
START SLAVE;
--source include/wait_for_slave_to_start.inc
@ -118,14 +105,54 @@ START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000009';
--replace_result 561 MASTER_LOG_POS
--error 1277
START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=561;
# Warning should be given for second command
START SLAVE;
--replace_result 740 MASTER_LOG_POS
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=740;
--source include/stop_slave.inc
# Clear slave IO error.
RESET SLAVE;
--source include/start_slave.inc
--let $rpl_only_running_threads= 1
##############################################################################
# The second section - checks START SLAVE UNTIL RELAY_LOG_FILE =# 'log_name',
# RELAY_LOG_POS = log_pos. This section of the test does the following:
# 1) At master, create a table and inserts a value. Let slave replicate this.
# 2) Stop slave sql thread.
# 3) Insert some more values at master. Note that io thread copies this insert
# 4) Use start slave until to start the sql thread and check if it
# stops at the correct position.
##############################################################################
--source include/rpl_reset.inc
--connection master
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
--sync_slave_with_master
--source include/stop_slave_sql.inc
--connection master
INSERT INTO t1 VALUES (2);
--let $master_log_pos= query_get_value(SHOW MASTER STATUS, Position, 1)
INSERT INTO t1 VALUES (3);
--source include/sync_slave_io_with_master.inc
--let $relay_log_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File,1)
--source include/get_relay_log_pos.inc
--disable_query_log
--eval start slave until relay_log_file='$relay_log_file', relay_log_pos=$relay_log_pos
--enable_query_log
--source include/wait_for_slave_sql_to_stop.inc
--let $assert_cond= COUNT(*) = 2 FROM t1
--let $assert_text= table t1 should have two rows.
--source include/assert.inc
#cleanup
--source include/start_slave.inc
--connection master
DROP TABLE t1;
--sync_slave_with_master
--source include/rpl_end.inc

View file

@ -260,5 +260,27 @@ SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creato
sync_slave_with_master;
#
# Bug#16056537: MYSQLD CRASHES IN ITEM_FUNC_GET_USER_VAR::FIX_LENGTH_AND_DEC()
#
set names utf8;
--delimiter |
CREATE FUNCTION f() RETURNS timestamp DETERMINISTIC
BEGIN RETURN '2012-12-21 12:12:12'; END |
CREATE PROCEDURE p(t timestamp)
BEGIN
SET @t = t;
PREPARE stmt FROM "
UPDATE t1 SET a = @t WHERE '2012-12-31 08:00:00' < f() ";
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
END |
--delimiter ;
create table t1 (a timestamp);
call p('2012-12-31 08:00:00');
drop table t1;
drop procedure p;
drop function f;
--echo end of the tests
--source include/rpl_end.inc

View file

@ -23,6 +23,8 @@
# Test is dependent on binlog positions
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
# prepare version for substitutions
let $VERSION=`select version()`;
@ -187,47 +189,6 @@ connection slave;
start slave;
sync_with_master;
# Bug #47142 "slave start until" stops 1 event too late in 4.1 to 5.0 replication
#
# testing fixes that refine the start position of prior-5.0 master's event
# and by that provide correct execution of
# START SLAVE UNTIL ... master_log_pos= x;
# Keep the test at the end of the file because it manipulates with binlog files
# to substitute the genuine one with a prepared on 4.1 server.
#
--source include/rpl_reset.inc
connection master;
--disable_warnings
drop table if exists t1; # there is create table t1 in bug47142_master-bin.000001
--enable_warnings
sync_slave_with_master;
connection slave;
stop slave;
connection master;
flush logs;
let $MYSQLD_DATADIR= `select @@datadir`;
--remove_file $MYSQLD_DATADIR/master-bin.000001
--copy_file $MYSQL_TEST_DIR/std_data/bug47142_master-bin.000001 $MYSQLD_DATADIR/master-bin.000001
# this a constant bound to the bug47142_master-bin.000001 binlog file
--let $binlog_before_drop=294;
connection slave;
stop slave;
reset slave;
--replace_regex /master_log_pos=[0-9]+/master_log_pos=MASTER_LOG_POS/
eval start slave until master_log_file='master-bin.000001', master_log_pos=$binlog_before_drop /* to stop right before DROP */;
--source include/wait_for_slave_sql_to_stop.inc
show tables /* t1 must exist */;
# clean-up of Bug #47142 testing
drop table t1; # drop on slave only, master does not have t1.
stop slave;
# End of tests
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc