Commit 946a32f9 authored by unknown's avatar unknown

Merge lthalmann@bk-internal.mysql.com:/home/bk/mysql-5.1

into  mysql.com:/users/lthalmann/bkroot/mysql-5.1


client/mysqldump.c:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
  Auto merged
mysql-test/t/ndb_multi.test:
  Manual merge
parents 5bd485a6 a15a9f09
......@@ -2,3 +2,4 @@
44ec850ac2k4y2Omgr92GiWPBAVKGQ
44edb86b1iE5knJ97MbliK_3lCiAXA
44f33f3aj5KW5qweQeekY1LU0E9ZCg
4513d8e4Af4dQWuk13sArwofRgFDQw
......@@ -24,11 +24,11 @@ EXTRA_DIST = INSTALL-SOURCE INSTALL-WIN-SOURCE \
SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
@readline_topdir@ sql-common \
@thread_dirs@ pstack \
@sql_union_dirs@ storage plugin \
@sql_union_dirs@ unittest storage plugin \
@sql_server@ scripts @man_dirs@ tests \
netware @libmysqld_dirs@ \
mysql-test support-files @tools_dirs@ \
unittest win
win
DIST_SUBDIRS = $(SUBDIRS) BUILD
......@@ -114,7 +114,7 @@ test-unit:
test-ps:
cd mysql-test ; \
./mysql-test-run.pl $(force) --ps-protocol --mysqld=--binlog-format=statement
./mysql-test-run.pl $(force) --ps-protocol --mysqld=--binlog-format=mixed
test-nr:
cd mysql-test ; \
......@@ -125,6 +125,10 @@ test-pr:
./mysql-test-run.pl $(force) --ps-protocol --mysqld=--binlog-format=row
test-ns:
cd mysql-test ; \
./mysql-test-run.pl $(force) --mysqld=--binlog-format=mixed
test-binlog-statement:
cd mysql-test ; \
./mysql-test-run.pl $(force) --mysqld=--binlog-format=statement
......
This diff is collapsed.
......@@ -280,6 +280,8 @@ AC_DEFUN([MYSQL_CONFIGURE_PLUGINS],[
_MYSQL_EMIT_PLUGIN_ACTIONS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
AC_SUBST([mysql_se_dirs])
AC_SUBST([mysql_pg_dirs])
AC_SUBST([mysql_se_unittest_dirs])
AC_SUBST([mysql_pg_unittest_dirs])
])
])
])
......@@ -410,9 +412,15 @@ dnl Although this is "pretty", it breaks libmysqld build
[AC_CONFIG_FILES($6/Makefile)]
)
ifelse(m4_substr($6, 0, 8), [storage/],
[mysql_se_dirs="$mysql_se_dirs ]m4_substr($6, 8)",
[
[mysql_se_dirs="$mysql_se_dirs ]m4_substr($6, 8)"
mysql_se_unittest_dirs="$mysql_se_unittest_dirs ../$6"
],
m4_substr($6, 0, 7), [plugin/],
[mysql_pg_dirs="$mysql_pg_dirs ]m4_substr($6, 7)",
[
[mysql_pg_dirs="$mysql_pg_dirs ]m4_substr($6, 7)"
mysql_pg_unittest_dirs="$mysql_pg_unittest_dirs ../$6"
],
[AC_FATAL([don't know how to handle plugin dir ]$6)])
fi
])
......
......@@ -59,24 +59,4 @@ insert into t1 values(null);
select * from t1;
drop table t1;
# Test of binlogging of INSERT_ID with INSERT DELAYED
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
# First, avoid BUG#20627:
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
# Verify that only one INSERT_ID event is binlogged.
insert delayed into t1 values (207);
# We use sleeps between statements, that's the only way to get a
# repeatable binlog in a normal test run and under Valgrind.
# It may be that the "binlog missing rows" of BUG#20821 shows up
# here.
sleep 2;
insert delayed into t1 values (null);
sleep 2;
insert delayed into t1 values (300);
sleep 2; # time for the delayed queries to reach disk
select * from t1;
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events from 102;
drop table t1;
-- source extra/binlog_tests/binlog_insert_delayed.test
# Test of binlogging of INSERT_ID with INSERT DELAYED
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
# First, avoid BUG#20627:
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
# Verify that only one INSERT_ID event is binlogged.
# Note, that because of WL#3368 mixed mode binlog records RBR events for the delayed
insert delayed into t1 values (207);
# We use sleeps between statements, that's the only way to get a
# repeatable binlog in a normal test run and under Valgrind. The
# reason is that without sleeps, rows of different INSERT DELAYEDs
# sometimes group together and sometimes not, so the table may be
# unlocked/relocked causing a different number of table map log
# events.
sleep 2;
insert delayed into t1 values (null);
sleep 2;
insert delayed into t1 values (300);
sleep 2; # time for the delayed queries to reach disk
insert delayed into t1 values (null),(null),(null),(null);
sleep 2;
insert delayed into t1 values (null),(null),(400),(null);
sleep 2;
select * from t1;
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events from 102;
drop table t1;
......@@ -31,4 +31,4 @@ connection master;
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS t1,t2,t3;
SET FOREIGN_KEY_CHECKS=1;
sync_slave_with_master;
......@@ -9,8 +9,21 @@
# column and index but without primary key.
##############################################################
--echo #
--echo # Setup
--echo #
# We also check how the foreign_key_check variable is replicated
use test;
--disable_warnings
drop table if exists t1, t2, t3;
--enable_warnings
--echo #
--echo # See if queries that use both auto_increment and LAST_INSERT_ID()
--echo # are replicated well
--echo #
--echo # We also check how the foreign_key_check variable is replicated
--echo #
-- source include/master-slave.inc
#should work for both SBR and RBR
......@@ -49,7 +62,9 @@ select * from t1;
select * from t2;
connection master;
# check if INSERT SELECT in auto_increment is well replicated (bug #490)
--echo #
--echo # check if INSERT SELECT in auto_increment is well replicated (bug #490)
--echo #
drop table t2;
drop table t1;
......@@ -72,10 +87,11 @@ save_master_pos;
connection slave;
sync_with_master;
#
# Bug#8412: Error codes reported in binary log for CHARACTER SET,
# FOREIGN_KEY_CHECKS
#
--echo #
--echo # Bug#8412: Error codes reported in binary log for CHARACTER SET,
--echo # FOREIGN_KEY_CHECKS
--echo #
connection master;
SET TIMESTAMP=1000000000;
CREATE TABLE t1 ( a INT UNIQUE );
......@@ -88,11 +104,10 @@ connection master;
drop table t1;
sync_slave_with_master;
# End of 4.1 tests
#
# Bug#14553: NULL in WHERE resets LAST_INSERT_ID
#
--echo #
--echo # Bug#14553: NULL in WHERE resets LAST_INSERT_ID
--echo #
connection master;
create table t1(a int auto_increment, key(a));
create table t2(a int);
......@@ -107,11 +122,16 @@ connection master;
drop table t1;
drop table t2;
#
# BUG#15728: LAST_INSERT_ID function inside a stored function returns 0
#
# The solution is not to reset last_insert_id on enter to sub-statement.
#
--echo #
--echo # End of 4.1 tests
--echo #
--echo #
--echo # BUG#15728: LAST_INSERT_ID function inside a stored function returns 0
--echo #
--echo # The solution is not to reset last_insert_id on enter to sub-statement.
--echo #
connection master;
--disable_warnings
drop function if exists bug15728;
......@@ -254,12 +274,16 @@ select * from t1 order by n;
connection master;
drop table t1;
sync_slave_with_master;
# End of 5.0 tests
--echo #
--echo # End of 5.0 tests
--echo #
# Test for BUG#20341 "stored function inserting into one
# auto_increment puts bad data in slave"
connection master;
truncate table t2;
create table t1 (id tinyint primary key); # no auto_increment
......@@ -289,8 +313,30 @@ select * from t1;
select * from t2;
connection master;
drop table t1, t2;
drop table t1;
drop function insid;
truncate table t2;
create table t1 (n int primary key auto_increment not null,
b int, unique(b));
delimiter |;
create procedure foo()
begin
insert into t1 values(null,10);
insert ignore into t1 values(null,10);
insert ignore into t1 values(null,10);
insert into t2 values(null,3);
end|
delimiter ;|
call foo();
select * from t1;
select * from t2;
sync_slave_with_master;
select * from t1;
select * from t2;
connection master;
drop table t1, t2;
drop procedure foo;
sync_slave_with_master;
# Requires statement logging
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
# See if replication of a "LOAD DATA in an autoincrement column"
# Honours autoincrement values
......
......@@ -9,7 +9,10 @@
connection slave;
stop slave;
connection master;
# Generate a big enough master's binlog to cause relay log rotations
--echo #
--echo # Generate a big enough master's binlog to cause relay log rotations
--echo #
create table t1 (a int);
let $1=800;
......@@ -26,6 +29,11 @@ drop table t1;
save_master_pos;
connection slave;
reset slave;
--echo #
--echo # Test 1
--echo #
set global max_binlog_size=8192;
set global max_relay_log_size=8192-1; # mapped to 4096
select @@global.max_relay_log_size;
......@@ -33,7 +41,13 @@ start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
--vertical_results
show slave status;
--echo #
--echo # Test 2
--echo #
stop slave;
reset slave;
set global max_relay_log_size=(5*4096);
......@@ -42,7 +56,13 @@ start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
--vertical_results
show slave status;
--echo #
--echo # Test 3: max_relay_log_size = 0
--echo #
stop slave;
reset slave;
set global max_relay_log_size=0;
......@@ -51,9 +71,12 @@ start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
--vertical_results
show slave status;
# Tests below are mainly to ensure that we have not coded with wrong assumptions
--echo #
--echo # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
--echo #
stop slave;
reset slave;
......@@ -62,8 +85,13 @@ reset slave;
flush logs;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
--vertical_results
show slave status;
--echo #
--echo # Test 5
--echo #
reset slave;
start slave;
sync_with_master;
......@@ -78,8 +106,13 @@ connection slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
--vertical_results
show slave status;
# one more rotation, to be sure Relay_Log_Space is correctly updated
--echo #
--echo # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
--echo #
flush logs;
connection master;
drop table t1;
......@@ -88,6 +121,7 @@ connection slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
--vertical_results
show slave status;
connection master;
......@@ -95,3 +129,7 @@ connection master;
flush logs;
-- replace_column 3 <Binlog_Ignore_DB>
show master status;
--echo #
--echo # End of 4.1 tests
--echo #
......@@ -3,27 +3,51 @@
# Consider making these part of the basic RBR tests.
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
connection master;
--disable_warnings
--disable_query_log
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t9;
--enable_query_log
--enable_warnings
sync_slave_with_master;
STOP SLAVE;
SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
START SLAVE;
connection master;
eval CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=$engine_type;
eval CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE=$engine_type;
eval CREATE TABLE t1_bit (a INT PRIMARY KEY, b INT) ENGINE=$engine_type;
eval CREATE TABLE t1_char (a INT PRIMARY KEY, b INT) ENGINE=$engine_type;
eval CREATE TABLE t1_nodef (a INT PRIMARY KEY, b INT) ENGINE=$engine_type;
eval CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=$engine_type;
eval CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=$engine_type;
eval CREATE TABLE t4 (a INT) ENGINE=$engine_type;
eval CREATE TABLE t5 (a INT, b INT, c INT) ENGINE=$engine_type;
eval CREATE TABLE t6 (a INT, b INT, c INT) ENGINE=$engine_type;
eval CREATE TABLE t7 (a INT NOT NULL) ENGINE=$engine_type;
eval CREATE TABLE t8 (a INT NOT NULL) ENGINE=$engine_type;
# Table used to detect that slave is running
eval CREATE TABLE t9 (a INT PRIMARY KEY) ENGINE=$engine_type;
eval CREATE TABLE t9 (a INT) ENGINE=$engine_type;
sync_slave_with_master;
# On the slave, we add one column last in table 't1',
ALTER TABLE t1 ADD x INT DEFAULT 42;
# ... add one column in the middle of table 't2', and
ALTER TABLE t2 ADD x INT DEFAULT 42 AFTER a;
# ... add one column first in table 't3'.
ALTER TABLE t3 ADD x INT DEFAULT 42 FIRST;
# On the slave, we add one INT column last in table 't1_int',
ALTER TABLE t1_int ADD x INT DEFAULT 42;
# ... and add BIT columns last in table 't1_bit' to ensure that we
# have at least one extra null byte on the slave,
ALTER TABLE t1_bit
ADD x BIT(3) DEFAULT b'011',
ADD y BIT(5) DEFAULT b'10101',
ADD z BIT(2) DEFAULT b'10';
# ... and add one CHAR column last in table 't1_char',
ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
# ... and add one non-nullable INT column last in table 't1_text'
# with no default,
ALTER TABLE t1_nodef ADD x INT NOT NULL;
# ... and remove the last column in t2
ALTER TABLE t2 DROP b;
# ... change the type of the single column in table 't4'
ALTER TABLE t4 MODIFY a FLOAT;
# ... change the type of the middle column of table 't5'
......@@ -31,49 +55,81 @@ ALTER TABLE t5 MODIFY b FLOAT;
# ... change the type of the last column of table 't6'
ALTER TABLE t6 MODIFY c FLOAT;
# Each of these should generate an error and stop the slave
# ... add one byte worth of null bytes to the table on the slave
ALTER TABLE t7 ADD e1 INT, ADD e2 INT, ADD e3 INT, ADD e4 INT,
ADD e5 INT, ADD e6 INT, ADD e7 INT, ADD e8 INT;
# ... add 8 columns that are nullable: t8 will not be entirely
# nullable and have no null bits (just an X bit)
ALTER TABLE t8 ADD e1 INT NOT NULL DEFAULT 0, ADD e2 INT NOT NULL DEFAULT 0,
ADD e3 INT NOT NULL DEFAULT 0, ADD e4 INT NOT NULL DEFAULT 0,
ADD e5 INT NOT NULL DEFAULT 0, ADD e6 INT NOT NULL DEFAULT 0,
ADD e7 INT NOT NULL DEFAULT 0, ADD e8 INT NOT NULL DEFAULT 0;
# Insert some values for tables on slave side. These should not be
# modified when the row from the master is applied.
INSERT INTO t1_int VALUES (2, 4, 4711);
INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
--echo **** On Master ****
connection master;
INSERT INTO t9 VALUES (1);
INSERT INTO t1_int VALUES (1,2);
INSERT INTO t1_int VALUES (2,5);
INSERT INTO t1_bit VALUES (1,2);
INSERT INTO t1_bit VALUES (2,5);
INSERT INTO t1_char VALUES (1,2);
INSERT INTO t1_char VALUES (2,5);
SELECT * FROM t1_int;
SELECT * FROM t1_bit;
SELECT * FROM t1_char;
--echo **** On Slave ****
sync_slave_with_master;
# Now slave is guaranteed to be running
SELECT a,b,x FROM t1_int;
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit;
SELECT a,b,x FROM t1_char;
--echo **** On Master ****
connection master;
INSERT INTO t1 VALUES (1,2);
connection slave;
wait_for_slave_to_stop;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
--vertical_results
SHOW SLAVE STATUS;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
UPDATE t1_int SET b=2*b WHERE a=2;
UPDATE t1_char SET b=2*b WHERE a=2;
UPDATE t1_bit SET b=2*b WHERE a=2;
SELECT * FROM t1_int;
SELECT * FROM t1_bit;
SELECT * FROM t1_char;
--echo **** On Slave ****
sync_slave_with_master;
SELECT a,b,x FROM t1_int;
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit;
SELECT a,b,x FROM t1_char;
# Each of these inserts should generate an error and stop the slave
connection master;
INSERT INTO t9 VALUES (2);
sync_slave_with_master;
# Now slave is guaranteed to be running
connection master;
INSERT INTO t2 VALUES (2,4);
INSERT INTO t1_nodef VALUES (1,2);
connection slave;
wait_for_slave_to_stop;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
--vertical_results
SHOW SLAVE STATUS;
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
connection master;
INSERT INTO t9 VALUES (3);
INSERT INTO t9 VALUES (2);
sync_slave_with_master;
# Now slave is guaranteed to be running
connection master;
INSERT INTO t3 VALUES (3,6);
INSERT INTO t2 VALUES (2,4);
connection slave;
wait_for_slave_to_stop;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
--vertical_results
SHOW SLAVE STATUS;
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
......@@ -86,9 +142,8 @@ INSERT INTO t4 VALUES (4);
connection slave;
wait_for_slave_to_stop;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
--vertical_results
SHOW SLAVE STATUS;
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
......@@ -101,9 +156,8 @@ INSERT INTO t5 VALUES (5,10,25);
connection slave;
wait_for_slave_to_stop;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
--vertical_results
SHOW SLAVE STATUS;
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
......@@ -116,14 +170,71 @@ INSERT INTO t6 VALUES (6,12,36);
connection slave;
wait_for_slave_to_stop;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
--vertical_results
SHOW SLAVE STATUS;
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
connection master;
INSERT INTO t9 VALUES (6);
sync_slave_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
# Testing some tables extra field that can be null and cannot be null
# (but have default values)
connection master;
INSERT INTO t7 VALUES (1),(2),(3);
INSERT INTO t8 VALUES (1),(2),(3);
SELECT * FROM t7;
SELECT * FROM t8;
sync_slave_with_master;
SELECT * FROM t7;
SELECT * FROM t8;
# We will now try to update and then delete a row on the master where
# the extra field on the slave does not have a default value. This
# update should not generate an error even though there is no default
# for the extra column.
--echo **** On Master ****
connection master;
TRUNCATE t1_nodef;
SET SQL_LOG_BIN=0;
INSERT INTO t1_nodef VALUES (1,2);
INSERT INTO t1_nodef VALUES (2,4);
SET SQL_LOG_BIN=1;
sync_slave_with_master;
--echo **** On Slave ****
connection slave;
INSERT INTO t1_nodef VALUES (1,2,3);
INSERT INTO t1_nodef VALUES (2,4,6);
--echo **** On Master ****
connection master;
UPDATE t1_nodef SET b=2*b WHERE a=1;
SELECT * FROM t1_nodef;
--echo **** On Slave ****
sync_slave_with_master;
SELECT * FROM t1_nodef;
--echo **** On Master ****
connection master;
DELETE FROM t1_nodef WHERE a=2;
SELECT * FROM t1_nodef;
--echo **** On Slave ****
sync_slave_with_master;
SELECT * FROM t1_nodef;
--echo **** Cleanup ****
connection master;
--disable_warnings
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t9;
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
--enable_warnings
sync_slave_with_master;
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source include/master-slave.inc
create table t1 (word char(20) not null);
......
......@@ -2,7 +2,7 @@
# This test will fail if the server/client does not support enough charsets.
# Requires statement logging
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
source include/master-slave.inc;
--disable_warnings
......
-- require r/have_binlog_format_mixed.require
disable_query_log;
show variables like "binlog_format";
enable_query_log;
--require r/have_binlog_format_statement.require
--disable_query_log
--replace_result MIXED STATEMENT
show variables like "binlog_format";
--enable_query_log
......@@ -28,7 +28,6 @@ INSERT INTO t1 VALUES(412,1,'Testing MySQL databases is a cool ',
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
sync_slave_with_master;
--sleep 5
--echo --- Select from t1 on slave ---
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
......@@ -44,7 +43,6 @@ SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
# into the binlog other wise we will miss the update.
sync_slave_with_master;
--sleep 5
--echo --- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
......@@ -56,7 +54,6 @@ DELETE FROM t1 WHERE id = 42;
SELECT COUNT(*) FROM t1;
sync_slave_with_master;
--sleep 5
--echo --- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
......
# to mask out the error - never abort neither log in result file - in setting
# to read-only variable.
# It is assumed that the new value is equal to one the var was set to.
# Such situation happens particularily with binlog_format that becomes read-only
# with ndb default storage.
#
# when generate results always watch the file to find what is expected,
# the SET query may fail
# script accepts $maybe_ro_var the var name and $val4var the value
### USAGE:
### let $maybe_ro_var= ...
### let $val4var= ...
### include/safe_set_to_maybe_ro_var.inc
--disable_result_log
--disable_abort_on_error
eval SET $maybe_ro_var = $val4var;
--enable_abort_on_error
--enable_result_log
eval SELECT $maybe_ro_var;
......@@ -250,11 +250,21 @@ set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
insert delayed into t1 values (207);
insert delayed into t1 values (null);
insert delayed into t1 values (300);
insert delayed into t1 values (null),(null),(null),(null);
insert delayed into t1 values (null),(null),(400),(null);
select * from t1;
a
207
208
300
301
302
303
304
305
306
400
401
show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key)
......@@ -268,4 +278,12 @@ master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
drop table t1;
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
insert delayed into t1 values (207);
insert delayed into t1 values (null);
insert delayed into t1 values (300);
insert delayed into t1 values (null),(null),(null),(null);
insert delayed into t1 values (null),(null),(400),(null);
select * from t1;
a
207
208
300
301
302
303
304
305
306
400
401
show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
master-bin.000001 # Query 1 # use `test`; insert delayed into t1 values (207)
master-bin.000001 # Intvar 1 # INSERT_ID=208
master-bin.000001 # Query 1 # use `test`; insert delayed into t1 values (null)
master-bin.000001 # Query 1 # use `test`; insert delayed into t1 values (300)
master-bin.000001 # Intvar 1 # INSERT_ID=301
master-bin.000001 # Query 1 # use `test`; insert delayed into t1 values (null),(null),(null),(null)
master-bin.000001 # Intvar 1 # INSERT_ID=305
master-bin.000001 # Query 1 # use `test`; insert delayed into t1 values (null),(null),(400),(null)
drop table t1;
......@@ -160,11 +160,21 @@ set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
insert delayed into t1 values (207);
insert delayed into t1 values (null);
insert delayed into t1 values (300);
insert delayed into t1 values (null),(null),(null),(null);
insert delayed into t1 values (null),(null),(400),(null);
select * from t1;
a
207
208
300
301
302
303
304
305
306
400
401
show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key)
......@@ -172,8 +182,18 @@ master-bin.000001 # Intvar 1 # INSERT_ID=127
master-bin.000001 # Query 1 # use `test`; insert into t1 values(null)
master-bin.000001 # Query 1 # use `test`; drop table t1
master-bin.000001 # Query 1 # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
master-bin.000001 # Query 1 # use `test`; insert delayed into t1 values (207)
master-bin.000001 # Intvar 1 # INSERT_ID=208
master-bin.000001 # Query 1 # use `test`; insert delayed into t1 values (null)
master-bin.000001 # Query 1 # use `test`; insert delayed into t1 values (300)
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
drop table t1;
Variable_name Value
binlog_format MIXED
......@@ -46,6 +46,8 @@ COLUMN_PRIVILEGES
ENGINES
EVENTS
FILES
GLOBAL_STATUS
GLOBAL_VARIABLES
KEY_COLUMN_USAGE
PARTITIONS
PLUGINS
......@@ -54,6 +56,8 @@ REFERENTIAL_CONSTRAINTS
ROUTINES
SCHEMATA
SCHEMA_PRIVILEGES
SESSION_STATUS
SESSION_VARIABLES
STATISTICS
TABLES
TABLE_CONSTRAINTS
......@@ -758,6 +762,7 @@ table_schema table_name column_name
information_schema COLUMNS COLUMN_TYPE
information_schema EVENTS EVENT_DEFINITION
information_schema EVENTS SQL_MODE
information_schema GLOBAL_VARIABLES VARIABLE_VALUE
information_schema PARTITIONS PARTITION_EXPRESSION
information_schema PARTITIONS SUBPARTITION_EXPRESSION
information_schema PARTITIONS PARTITION_DESCRIPTION
......@@ -765,6 +770,7 @@ information_schema PLUGINS PLUGIN_DESCRIPTION
information_schema PROCESSLIST INFO
information_schema ROUTINES ROUTINE_DEFINITION
information_schema ROUTINES SQL_MODE
information_schema SESSION_VARIABLES VARIABLE_VALUE
information_schema TRIGGERS ACTION_CONDITION
information_schema TRIGGERS ACTION_STATEMENT
information_schema TRIGGERS SQL_MODE
......@@ -847,7 +853,7 @@ delete from mysql.db where user='mysqltest_4';
flush privileges;
SELECT table_schema, count(*) FROM information_schema.TABLES where TABLE_SCHEMA!='cluster' GROUP BY TABLE_SCHEMA;
table_schema count(*)
information_schema 23
information_schema 27
mysql 21
create table t1 (i int, j int);
create trigger trg1 before insert on t1 for each row
......@@ -1240,6 +1246,8 @@ COLUMN_PRIVILEGES TABLE_SCHEMA
ENGINES ENGINE
EVENTS EVENT_SCHEMA
FILES TABLE_SCHEMA
GLOBAL_STATUS VARIABLE_NAME
GLOBAL_VARIABLES VARIABLE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
PARTITIONS TABLE_SCHEMA
PLUGINS PLUGIN_NAME
......@@ -1248,6 +1256,8 @@ REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
ROUTINES ROUTINE_SCHEMA
SCHEMATA SCHEMA_NAME
SCHEMA_PRIVILEGES TABLE_SCHEMA
SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
STATISTICS TABLE_SCHEMA
TABLES TABLE_SCHEMA
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
......@@ -1278,6 +1288,8 @@ COLUMN_PRIVILEGES TABLE_SCHEMA
ENGINES ENGINE
EVENTS EVENT_SCHEMA
FILES TABLE_SCHEMA
GLOBAL_STATUS VARIABLE_NAME
GLOBAL_VARIABLES VARIABLE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
PARTITIONS TABLE_SCHEMA
PLUGINS PLUGIN_NAME
......@@ -1286,6 +1298,8 @@ REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
ROUTINES ROUTINE_SCHEMA
SCHEMATA SCHEMA_NAME
SCHEMA_PRIVILEGES TABLE_SCHEMA
SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
STATISTICS TABLE_SCHEMA
TABLES TABLE_SCHEMA
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
......
......@@ -13,6 +13,8 @@ COLUMN_PRIVILEGES
ENGINES
EVENTS
FILES
GLOBAL_STATUS
GLOBAL_VARIABLES
KEY_COLUMN_USAGE
PARTITIONS
PLUGINS
......@@ -21,6 +23,8 @@ REFERENTIAL_CONSTRAINTS
ROUTINES
SCHEMATA
SCHEMA_PRIVILEGES
SESSION_STATUS
SESSION_VARIABLES
STATISTICS
TABLES
TABLE_CONSTRAINTS
......
This diff is collapsed.
......@@ -87,6 +87,8 @@ Database: information_schema
| ENGINES |
| EVENTS |
| FILES |
| GLOBAL_STATUS |
| GLOBAL_VARIABLES |
| KEY_COLUMN_USAGE |
| PARTITIONS |
| PLUGINS |
......@@ -95,6 +97,8 @@ Database: information_schema
| ROUTINES |
| SCHEMATA |
| SCHEMA_PRIVILEGES |
| SESSION_STATUS |
| SESSION_VARIABLES |
| STATISTICS |
| TABLES |
| TABLE_CONSTRAINTS |
......@@ -115,6 +119,8 @@ Database: INFORMATION_SCHEMA
| ENGINES |
| EVENTS |
| FILES |
| GLOBAL_STATUS |
| GLOBAL_VARIABLES |
| KEY_COLUMN_USAGE |
| PARTITIONS |
| PLUGINS |
......@@ -123,6 +129,8 @@ Database: INFORMATION_SCHEMA
| ROUTINES |
| SCHEMATA |
| SCHEMA_PRIVILEGES |
| SESSION_STATUS |
| SESSION_VARIABLES |
| STATISTICS |
| TABLES |
| TABLE_CONSTRAINTS |
......
#
# Bug#20821: INSERT DELAYED fails to write some rows to binlog
#
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
......@@ -13,4 +16,8 @@ COUNT(*)
SELECT COUNT(*) FROM mysqlslap.t1;
COUNT(*)
5000
DROP SCHEMA IF EXISTS mysqlslap;
#
# Cleanup
#
USE test;
DROP SCHEMA mysqlslap;
#
# Setup
#
use test;
drop table if exists t1, t2, t3;
#
# See if queries that use both auto_increment and LAST_INSERT_ID()
# are replicated well
#
# We also check how the foreign_key_check variable is replicated
#
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
......@@ -38,6 +49,9 @@ select * from t2;
b c
5 0
6 11
#
# check if INSERT SELECT in auto_increment is well replicated (bug #490)
#
drop table t2;
drop table t1;
create table t1(a int auto_increment, key(a));
......@@ -68,12 +82,19 @@ b c
9 13
drop table t1;
drop table t2;
#
# Bug#8412: Error codes reported in binary log for CHARACTER SET,
# FOREIGN_KEY_CHECKS
#
SET TIMESTAMP=1000000000;
CREATE TABLE t1 ( a INT UNIQUE );
SET FOREIGN_KEY_CHECKS=0;
INSERT INTO t1 VALUES (1),(1);
Got one of the listed errors
drop table t1;
#
# Bug#14553: NULL in WHERE resets LAST_INSERT_ID
#
create table t1(a int auto_increment, key(a));
create table t2(a int);
insert into t1 (a) values (null);
......@@ -87,6 +108,14 @@ a
1
drop table t1;
drop table t2;
#
# End of 4.1 tests
#
#
# BUG#15728: LAST_INSERT_ID function inside a stored function returns 0
#
# The solution is not to reset last_insert_id on enter to sub-statement.
#
drop function if exists bug15728;
drop function if exists bug15728_insert;
drop table if exists t1, t2;
......@@ -234,6 +263,9 @@ n b
2 100
3 350
drop table t1;
#
# End of 5.0 tests
#
truncate table t2;
create table t1 (id tinyint primary key);
create function insid() returns int
......@@ -267,5 +299,30 @@ select * from t2;
id last_id
4 0
8 0
drop table t1, t2;
drop table t1;
drop function insid;
truncate table t2;
create table t1 (n int primary key auto_increment not null,
b int, unique(b));
create procedure foo()
begin
insert into t1 values(null,10);
insert ignore into t1 values(null,10);
insert ignore into t1 values(null,10);
insert into t2 values(null,3);
end|
call foo();
select * from t1;
n b
1 10
select * from t2;
id last_id
1 3
select * from t1;
n b
1 10
select * from t2;
id last_id
1 3
drop table t1, t2;
drop procedure foo;
......@@ -28,7 +28,7 @@ day id category name
2003-03-22 2416 a bbbbb
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
slave-bin.000001 1248
slave-bin.000001 1276
drop table t1;
drop table t2;
drop table t3;
......@@ -39,7 +39,7 @@ set global sql_slave_skip_counter=1;
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1765 # # master-bin.000001 Yes Yes # 0 0 1765 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1793 # # master-bin.000001 Yes Yes # 0 0 1793 # None 0 No #
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
......@@ -49,7 +49,7 @@ change master to master_user='test';
change master to master_user='root';
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1800 # # master-bin.000001 No No # 0 0 1800 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1828 # # master-bin.000001 No No # 0 0 1828 # None 0 No #
set global sql_slave_skip_counter=1;
start slave;
set sql_log_bin=0;
......
......@@ -30,16 +30,16 @@ a b
2 2
3 3
4 4
7 5
10 6
5 5
6 6
SELECT * FROM t1 ORDER BY a;
a b
1 1
2 2
3 3
4 4
7 5
10 6
5 5
6 6
drop table t1;
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
......
......@@ -5,9 +5,6 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
SET BINLOG_FORMAT=MIXED;
SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT;
@@GLOBAL.BINLOG_FORMAT @@SESSION.BINLOG_FORMAT
STATEMENT MIXED
SET GLOBAL BINLOG_FORMAT=MIXED;
SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT;
@@GLOBAL.BINLOG_FORMAT @@SESSION.BINLOG_FORMAT
......
......@@ -60,3 +60,43 @@ master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 102 Query 1 188 use `test`; CREATE TABLE t1 (a INT)
master-bin.000001 188 Table_map 1 227 table_id: # (test.t1)
master-bin.000001 227 Write_rows 1 266 table_id: # flags: STMT_END_F
DROP TABLE t1;
================ Test for BUG#17620 ================
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
**** On Slave ****
SET GLOBAL QUERY_CACHE_SIZE=0;
**** On Master ****
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
**** On Slave ****
SET GLOBAL QUERY_CACHE_SIZE=16*1024*1024;
**** On Master ****
INSERT INTO t1 VALUES (4),(5),(6);
**** On Slave ****
SELECT * FROM t1;
a
1
2
3
4
5
6
**** On Master ****
INSERT INTO t1 VALUES (7),(8),(9);
**** On Slave ****
SELECT * FROM t1;
a
1
2
3
4
5
6
7
8
9
DROP TABLE t1;
......@@ -5,7 +5,10 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP TABLE IF EXISTS t1;
SET BINLOG_FORMAT=ROW;
SET @@BINLOG_FORMAT = ROW;
SELECT @@BINLOG_FORMAT;
@@BINLOG_FORMAT
ROW
**** Partition RANGE testing ****
CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
......
SET SESSION BINLOG_FORMAT=ROW;
SET GLOBAL BINLOG_FORMAT=ROW;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
......@@ -5,9 +7,15 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
stop slave;
#
# Generate a big enough master's binlog to cause relay log rotations
#
create table t1 (a int);
drop table t1;
reset slave;
#
# Test 1
#
set global max_binlog_size=8192;
set global max_relay_log_size=8192-1;
select @@global.max_relay_log_size;
......@@ -15,47 +23,251 @@ select @@global.max_relay_log_size;
4096
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 58664 # # master-bin.000001 Yes Yes # 0 0 58664 # None 0 No #
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 58664
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 58664
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
#
# Test 2
#
stop slave;
reset slave;
set global max_relay_log_size=(5*4096);
select @@global.max_relay_log_size;
@@global.max_relay_log_size
20480
@@global.max_relay_log_size 20480
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 58664 # # master-bin.000001 Yes Yes # 0 0 58664 # None 0 No #
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 58664
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 58664
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
#
# Test 3: max_relay_log_size = 0
#
stop slave;
reset slave;
set global max_relay_log_size=0;
select @@global.max_relay_log_size;
@@global.max_relay_log_size
0
@@global.max_relay_log_size 0
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 58664 # # master-bin.000001 Yes Yes # 0 0 58664 # None 0 No #
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 58664
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 58664
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
#
# Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
#
stop slave;
reset slave;
flush logs;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No #
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File
Read_Master_Log_Pos 4
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File
Slave_IO_Running No
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 0
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
#
# Test 5
#
reset slave;
start slave;
flush logs;
create table t1 (a int);
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 58750 # # master-bin.000001 Yes Yes # 0 0 58750 # None 0 No #
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 58750
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 58750
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
#
# Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
#
flush logs;
drop table t1;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 58826 # # master-bin.000001 Yes Yes # 0 0 58826 # None 0 No #
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 58826
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 58826
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
flush logs;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 102 <Binlog_Ignore_DB>
File master-bin.000002
Position 102
Binlog_Do_DB <Binlog_Ignore_DB>
Binlog_Ignore_DB
#
# End of 4.1 tests
#
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
STOP SLAVE;
SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
START SLAVE;
CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
CREATE TABLE t1_bit (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
CREATE TABLE t1_char (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
CREATE TABLE t1_nodef (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
CREATE TABLE t4 (a INT) ENGINE='MyISAM';
CREATE TABLE t5 (a INT, b INT, c INT) ENGINE='MyISAM';
CREATE TABLE t6 (a INT, b INT, c INT) ENGINE='MyISAM';
CREATE TABLE t7 (a INT NOT NULL) ENGINE='MyISAM';
CREATE TABLE t8 (a INT NOT NULL) ENGINE='MyISAM';
CREATE TABLE t9 (a INT) ENGINE='MyISAM';
ALTER TABLE t1_int ADD x INT DEFAULT 42;
ALTER TABLE t1_bit
ADD x BIT(3) DEFAULT b'011',
ADD y BIT(5) DEFAULT b'10101',
ADD z BIT(2) DEFAULT b'10';
ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
ALTER TABLE t1_nodef ADD x INT NOT NULL;
ALTER TABLE t2 DROP b;
ALTER TABLE t4 MODIFY a FLOAT;
ALTER TABLE t5 MODIFY b FLOAT;
ALTER TABLE t6 MODIFY c FLOAT;
ALTER TABLE t7 ADD e1 INT, ADD e2 INT, ADD e3 INT, ADD e4 INT,
ADD e5 INT, ADD e6 INT, ADD e7 INT, ADD e8 INT;
ALTER TABLE t8 ADD e1 INT NOT NULL DEFAULT 0, ADD e2 INT NOT NULL DEFAULT 0,
ADD e3 INT NOT NULL DEFAULT 0, ADD e4 INT NOT NULL DEFAULT 0,
ADD e5 INT NOT NULL DEFAULT 0, ADD e6 INT NOT NULL DEFAULT 0,
ADD e7 INT NOT NULL DEFAULT 0, ADD e8 INT NOT NULL DEFAULT 0;
INSERT INTO t1_int VALUES (2, 4, 4711);
INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
**** On Master ****
INSERT INTO t1_int VALUES (1,2);
INSERT INTO t1_int VALUES (2,5);
INSERT INTO t1_bit VALUES (1,2);
INSERT INTO t1_bit VALUES (2,5);
INSERT INTO t1_char VALUES (1,2);
INSERT INTO t1_char VALUES (2,5);
SELECT * FROM t1_int;
a b
1 2
2 5
SELECT * FROM t1_bit;
a b
1 2
2 5
SELECT * FROM t1_char;
a b
1 2
2 5
**** On Slave ****
SELECT a,b,x FROM t1_int;
a b x
2 5 4711
1 2 42
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit;
a b HEX(x) HEX(y) HEX(z)
2 5 5 1C 1
1 2 3 15 2
SELECT a,b,x FROM t1_char;
a b x
2 5 Foo is a bar
1 2 Just a test
**** On Master ****
UPDATE t1_int SET b=2*b WHERE a=2;
UPDATE t1_char SET b=2*b WHERE a=2;
UPDATE t1_bit SET b=2*b WHERE a=2;
SELECT * FROM t1_int;
a b
1 2
2 10
SELECT * FROM t1_bit;
a b
1 2
2 10
SELECT * FROM t1_char;
a b
1 2
2 10
**** On Slave ****
SELECT a,b,x FROM t1_int;
a b x
2 10 4711
1 2 42
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit;
a b HEX(x) HEX(y) HEX(z)
2 10 5 1C 1
1 2 3 15 2
SELECT a,b,x FROM t1_char;
a b x
2 10 Foo is a bar
1 2 Just a test
INSERT INTO t9 VALUES (2);
INSERT INTO t1_nodef VALUES (1,2);
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1364
Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (2);
INSERT INTO t2 VALUES (2,4);
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1522
Last_Error Table width mismatch - received 2 columns, test.t2 has 1 columns
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (4);
INSERT INTO t4 VALUES (4);
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1522
Last_Error Column 0 type mismatch - received type 3, test.t4 has type 4
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (5);
INSERT INTO t5 VALUES (5,10,25);
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1522
Last_Error Column 1 type mismatch - received type 3, test.t5 has type 4
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (6);
INSERT INTO t6 VALUES (6,12,36);
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1522
Last_Error Column 2 type mismatch - received type 3, test.t6 has type 4
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (6);
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
INSERT INTO t7 VALUES (1),(2),(3);
INSERT INTO t8 VALUES (1),(2),(3);
SELECT * FROM t7;
a
1
2
3
SELECT * FROM t8;
a
1
2
3
SELECT * FROM t7;
a e1 e2 e3 e4 e5 e6 e7 e8
1 NULL NULL NULL NULL NULL NULL NULL NULL
2 NULL NULL NULL NULL NULL NULL NULL NULL
3 NULL NULL NULL NULL NULL NULL NULL NULL
SELECT * FROM t8;
a e1 e2 e3 e4 e5 e6 e7 e8
1 0 0 0 0 0 0 0 0
2 0 0 0 0 0 0 0 0
3 0 0 0 0 0 0 0 0
**** On Master ****
TRUNCATE t1_nodef;
SET SQL_LOG_BIN=0;
INSERT INTO t1_nodef VALUES (1,2);
INSERT INTO t1_nodef VALUES (2,4);
SET SQL_LOG_BIN=1;
**** On Slave ****
INSERT INTO t1_nodef VALUES (1,2,3);
INSERT INTO t1_nodef VALUES (2,4,6);
**** On Master ****
UPDATE t1_nodef SET b=2*b WHERE a=1;
SELECT * FROM t1_nodef;
a b
1 4
2 4
**** On Slave ****
SELECT * FROM t1_nodef;
a b x
1 4 3
2 4 6
**** On Master ****
DELETE FROM t1_nodef WHERE a=2;
SELECT * FROM t1_nodef;
a b
1 4
**** On Slave ****
SELECT * FROM t1_nodef;
a b x
1 4 3
**** Cleanup ****
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
STOP SLAVE;
SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
START SLAVE;
CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
CREATE TABLE t1_bit (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
CREATE TABLE t1_char (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
CREATE TABLE t1_nodef (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
CREATE TABLE t4 (a INT) ENGINE='InnoDB';
CREATE TABLE t5 (a INT, b INT, c INT) ENGINE='InnoDB';
CREATE TABLE t6 (a INT, b INT, c INT) ENGINE='InnoDB';
CREATE TABLE t7 (a INT NOT NULL) ENGINE='InnoDB';
CREATE TABLE t8 (a INT NOT NULL) ENGINE='InnoDB';
CREATE TABLE t9 (a INT) ENGINE='InnoDB';
ALTER TABLE t1_int ADD x INT DEFAULT 42;
ALTER TABLE t1_bit
ADD x BIT(3) DEFAULT b'011',
ADD y BIT(5) DEFAULT b'10101',
ADD z BIT(2) DEFAULT b'10';
ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
ALTER TABLE t1_nodef ADD x INT NOT NULL;
ALTER TABLE t2 DROP b;
ALTER TABLE t4 MODIFY a FLOAT;
ALTER TABLE t5 MODIFY b FLOAT;
ALTER TABLE t6 MODIFY c FLOAT;
ALTER TABLE t7 ADD e1 INT, ADD e2 INT, ADD e3 INT, ADD e4 INT,
ADD e5 INT, ADD e6 INT, ADD e7 INT, ADD e8 INT;
ALTER TABLE t8 ADD e1 INT NOT NULL DEFAULT 0, ADD e2 INT NOT NULL DEFAULT 0,
ADD e3 INT NOT NULL DEFAULT 0, ADD e4 INT NOT NULL DEFAULT 0,
ADD e5 INT NOT NULL DEFAULT 0, ADD e6 INT NOT NULL DEFAULT 0,
ADD e7 INT NOT NULL DEFAULT 0, ADD e8 INT NOT NULL DEFAULT 0;
INSERT INTO t1_int VALUES (2, 4, 4711);
INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
**** On Master ****
INSERT INTO t1_int VALUES (1,2);
INSERT INTO t1_int VALUES (2,5);
INSERT INTO t1_bit VALUES (1,2);
INSERT INTO t1_bit VALUES (2,5);
INSERT INTO t1_char VALUES (1,2);
INSERT INTO t1_char VALUES (2,5);
SELECT * FROM t1_int;
a b
1 2
2 5
SELECT * FROM t1_bit;
a b
1 2
2 5
SELECT * FROM t1_char;
a b
1 2
2 5
**** On Slave ****
SELECT a,b,x FROM t1_int;
a b x
2 5 4711
1 2 42
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit;
a b HEX(x) HEX(y) HEX(z)
2 5 5 1C 1
1 2 3 15 2
SELECT a,b,x FROM t1_char;
a b x
2 5 Foo is a bar
1 2 Just a test
**** On Master ****
UPDATE t1_int SET b=2*b WHERE a=2;
UPDATE t1_char SET b=2*b WHERE a=2;
UPDATE t1_bit SET b=2*b WHERE a=2;
SELECT * FROM t1_int;
a b
1 2
2 10
SELECT * FROM t1_bit;
a b
1 2
2 10
SELECT * FROM t1_char;
a b
1 2
2 10
**** On Slave ****
SELECT a,b,x FROM t1_int;
a b x
2 10 4711
1 2 42
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit;
a b HEX(x) HEX(y) HEX(z)
2 10 5 1C 1
1 2 3 15 2
SELECT a,b,x FROM t1_char;
a b x
2 10 Foo is a bar
1 2 Just a test
INSERT INTO t9 VALUES (2);
INSERT INTO t1_nodef VALUES (1,2);
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1364
Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (2);
INSERT INTO t2 VALUES (2,4);
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1522
Last_Error Table width mismatch - received 2 columns, test.t2 has 1 columns
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (4);
INSERT INTO t4 VALUES (4);
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1522
Last_Error Column 0 type mismatch - received type 3, test.t4 has type 4
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (5);
INSERT INTO t5 VALUES (5,10,25);
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1522
Last_Error Column 1 type mismatch - received type 3, test.t5 has type 4
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (6);
INSERT INTO t6 VALUES (6,12,36);
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1522
Last_Error Column 2 type mismatch - received type 3, test.t6 has type 4
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (6);
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
INSERT INTO t7 VALUES (1),(2),(3);
INSERT INTO t8 VALUES (1),(2),(3);
SELECT * FROM t7;
a
1
2
3
SELECT * FROM t8;
a
1
2
3
SELECT * FROM t7;
a e1 e2 e3 e4 e5 e6 e7 e8
1 NULL NULL NULL NULL NULL NULL NULL NULL
2 NULL NULL NULL NULL NULL NULL NULL NULL
3 NULL NULL NULL NULL NULL NULL NULL NULL
SELECT * FROM t8;
a e1 e2 e3 e4 e5 e6 e7 e8
1 0 0 0 0 0 0 0 0
2 0 0 0 0 0 0 0 0
3 0 0 0 0 0 0 0 0
**** On Master ****
TRUNCATE t1_nodef;
SET SQL_LOG_BIN=0;
INSERT INTO t1_nodef VALUES (1,2);
INSERT INTO t1_nodef VALUES (2,4);
SET SQL_LOG_BIN=1;
**** On Slave ****
INSERT INTO t1_nodef VALUES (1,2,3);
INSERT INTO t1_nodef VALUES (2,4,6);
**** On Master ****
UPDATE t1_nodef SET b=2*b WHERE a=1;
SELECT * FROM t1_nodef;
a b
1 4
2 4
**** On Slave ****
SELECT * FROM t1_nodef;
a b x
1 4 3
2 4 6
**** On Master ****
DELETE FROM t1_nodef WHERE a=2;
SELECT * FROM t1_nodef;
a b
1 4
**** On Slave ****
SELECT * FROM t1_nodef;
a b x
1 4 3
**** Cleanup ****
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
......@@ -4,21 +4,96 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
CREATE TABLE t4 (a INT) ENGINE=myisam;
CREATE TABLE t5 (a INT, b INT, c INT) ENGINE=myisam;
CREATE TABLE t6 (a INT, b INT, c INT) ENGINE=myisam;
CREATE TABLE t9 (a INT PRIMARY KEY) ENGINE=myisam;
ALTER TABLE t1 ADD x INT DEFAULT 42;
ALTER TABLE t2 ADD x INT DEFAULT 42 AFTER a;
ALTER TABLE t3 ADD x INT DEFAULT 42 FIRST;
STOP SLAVE;
SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
START SLAVE;
CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE='NDB';
CREATE TABLE t1_bit (a INT PRIMARY KEY, b INT) ENGINE='NDB';
CREATE TABLE t1_char (a INT PRIMARY KEY, b INT) ENGINE='NDB';
CREATE TABLE t1_nodef (a INT PRIMARY KEY, b INT) ENGINE='NDB';
CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE='NDB';
CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE='NDB';
CREATE TABLE t4 (a INT) ENGINE='NDB';
CREATE TABLE t5 (a INT, b INT, c INT) ENGINE='NDB';
CREATE TABLE t6 (a INT, b INT, c INT) ENGINE='NDB';
CREATE TABLE t9 (a INT) ENGINE='NDB';
ALTER TABLE t1_int ADD x INT DEFAULT 42;
ALTER TABLE t1_bit
ADD x BIT(3) DEFAULT b'011',
ADD y BIT(5) DEFAULT b'10101',
ADD z BIT(2) DEFAULT b'10';
ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
ALTER TABLE t1_nodef ADD x INT NOT NULL;
ALTER TABLE t2 DROP b;
ALTER TABLE t4 MODIFY a FLOAT;
ALTER TABLE t5 MODIFY b FLOAT;
ALTER TABLE t6 MODIFY c FLOAT;
INSERT INTO t9 VALUES (1);
INSERT INTO t1 VALUES (1,2);
INSERT INTO t1_int VALUES (2, 4, 4711);
INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
**** On Master ****
INSERT INTO t1_int VALUES (1,2);
INSERT INTO t1_int VALUES (2,5);
INSERT INTO t1_bit VALUES (1,2);
INSERT INTO t1_bit VALUES (2,5);
INSERT INTO t1_char VALUES (1,2);
INSERT INTO t1_char VALUES (2,5);
SELECT * FROM t1_int;
a b
1 2
2 5
SELECT * FROM t1_bit;
a b
1 2
2 5
SELECT * FROM t1_char;
a b
1 2
2 5
**** On Slave ****
SELECT a,b,x FROM t1_int;
a b x
1 2 42
2 5 42
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit;
a b HEX(x) HEX(y) HEX(z)
1 2 3 15 2
2 5 3 15 2
SELECT a,b,x FROM t1_char;
a b x
1 2 Just a test
2 5 Just a test
**** On Master ****
UPDATE t1_int SET b=2*b WHERE a=2;
UPDATE t1_char SET b=2*b WHERE a=2;
UPDATE t1_bit SET b=2*b WHERE a=2;
SELECT * FROM t1_int;
a b
1 2
2 10
SELECT * FROM t1_bit;
a b
1 2
2 10
SELECT * FROM t1_char;
a b
1 2
2 10
**** On Slave ****
SELECT a,b,x FROM t1_int;
a b x
1 2 42
2 10 42
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit;
a b HEX(x) HEX(y) HEX(z)
1 2 3 15 2
2 10 3 15 2
SELECT a,b,x FROM t1_char;
a b x
1 2 Just a test
2 10 Just a test
INSERT INTO t9 VALUES (2);
INSERT INTO t1_nodef VALUES (1,2);
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
......@@ -26,7 +101,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 1042
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
......@@ -38,10 +113,10 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1454
Last_Error Table width mismatch - received 2 columns, test.t1 has 3 columns
Last_Errno 1364
Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef
Skip_Counter 0
Exec_Master_Log_Pos 968
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
......@@ -64,45 +139,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 1185
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1454
Last_Error Table width mismatch - received 2 columns, test.t2 has 3 columns
Skip_Counter 0
Exec_Master_Log_Pos 1111
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (3);
INSERT INTO t3 VALUES (3,6);
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 1328
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
......@@ -114,10 +151,10 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1454
Last_Error Table width mismatch - received 2 columns, test.t3 has 3 columns
Last_Errno 1514
Last_Error Table width mismatch - received 2 columns, test.t2 has 1 columns
Skip_Counter 0
Exec_Master_Log_Pos 1254
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
......@@ -140,7 +177,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 1466
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
......@@ -152,10 +189,10 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1454
Last_Errno 1514
Last_Error Column 0 type mismatch - received type 3, test.t4 has type 4
Skip_Counter 0
Exec_Master_Log_Pos 1397
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
......@@ -178,7 +215,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 1614
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
......@@ -190,10 +227,10 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1454
Last_Errno 1514
Last_Error Column 1 type mismatch - received type 3, test.t5 has type 4
Skip_Counter 0
Exec_Master_Log_Pos 1535
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
......@@ -216,7 +253,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 1762
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
......@@ -228,10 +265,10 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1454
Last_Errno 1514
Last_Error Column 2 type mismatch - received type 3, test.t6 has type 4
Skip_Counter 0
Exec_Master_Log_Pos 1683
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
......@@ -245,4 +282,5 @@ Master_SSL_Key
Seconds_Behind_Master #
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t9;
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t9;
......@@ -5,9 +5,15 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
stop slave;
#
# Generate a big enough master's binlog to cause relay log rotations
#
create table t1 (a int);
drop table t1;
reset slave;
#
# Test 1
#
set global max_binlog_size=8192;
set global max_relay_log_size=8192-1;
select @@global.max_relay_log_size;
......@@ -15,47 +21,251 @@ select @@global.max_relay_log_size;
4096
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 72956 # # master-bin.000001 Yes Yes # 0 0 72956 # None 0 No #
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 72956
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 72956
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
#
# Test 2
#
stop slave;
reset slave;
set global max_relay_log_size=(5*4096);
select @@global.max_relay_log_size;
@@global.max_relay_log_size
20480
@@global.max_relay_log_size 20480
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 72956 # # master-bin.000001 Yes Yes # 0 0 72956 # None 0 No #
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 72956
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 72956
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
#
# Test 3: max_relay_log_size = 0
#
stop slave;
reset slave;
set global max_relay_log_size=0;
select @@global.max_relay_log_size;
@@global.max_relay_log_size
0
@@global.max_relay_log_size 0
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 72956 # # master-bin.000001 Yes Yes # 0 0 72956 # None 0 No #
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 72956
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 72956
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
#
# Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
#
stop slave;
reset slave;
flush logs;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No #
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File
Read_Master_Log_Pos 4
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File
Slave_IO_Running No
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 0
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
#
# Test 5
#
reset slave;
start slave;
flush logs;
create table t1 (a int);
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73042 # # master-bin.000001 Yes Yes # 0 0 73042 # None 0 No #
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 73042
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 73042
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
#
# Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
#
flush logs;
drop table t1;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73118 # # master-bin.000001 Yes Yes # 0 0 73118 # None 0 No #
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 73118
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 73118
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
flush logs;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 102 <Binlog_Ignore_DB>
File master-bin.000002
Position 102
Binlog_Do_DB <Binlog_Ignore_DB>
Binlog_Ignore_DB
#
# End of 4.1 tests
#
......@@ -80,4 +80,19 @@ c
---> Cleaning up...
DROP VIEW v1;
DROP TABLE t1;
create table t1(a int, b int);
insert into t1 values (1, 1), (1, 2), (1, 3);
create view v1(a, b) as select a, sum(b) from t1 group by a;
explain v1;
Field Type Null Key Default Extra
a int(11) YES NULL
b decimal(32,0) YES NULL
show create table v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,sum(`t1`.`b`) AS `b` from `t1` group by `t1`.`a`
select * from v1;
a b
1 6
drop table t1;
drop view v1;
End of 5.0 tests
......@@ -3,6 +3,10 @@ show status like 'Table_lock%';
Variable_name Value
Table_locks_immediate 0
Table_locks_waited 0
select * from information_schema.session_status where variable_name like 'Table_lock%';
VARIABLE_NAME VARIABLE_VALUE
TABLE_LOCKS_IMMEDIATE 0.0000000
TABLE_LOCKS_WAITED 0.0000000
SET SQL_LOG_BIN=0;
drop table if exists t1;
create table t1(n int) engine=myisam;
......@@ -16,6 +20,10 @@ show status like 'Table_lock%';
Variable_name Value
Table_locks_immediate 3
Table_locks_waited 1
select * from information_schema.session_status where variable_name like 'Table_lock%';
VARIABLE_NAME VARIABLE_VALUE
TABLE_LOCKS_IMMEDIATE 3.0000000
TABLE_LOCKS_WAITED 1.0000000
drop table t1;
select 1;
1
......@@ -53,21 +61,36 @@ FLUSH STATUS;
SHOW STATUS LIKE 'max_used_connections';
Variable_name Value
Max_used_connections 1
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
VARIABLE_NAME VARIABLE_VALUE
MAX_USED_CONNECTIONS 1.0000000
SET @save_thread_cache_size=@@thread_cache_size;
SET GLOBAL thread_cache_size=3;
SHOW STATUS LIKE 'max_used_connections';
Variable_name Value
Max_used_connections 3
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
VARIABLE_NAME VARIABLE_VALUE
MAX_USED_CONNECTIONS 3.0000000
FLUSH STATUS;
SHOW STATUS LIKE 'max_used_connections';
Variable_name Value
Max_used_connections 2
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
VARIABLE_NAME VARIABLE_VALUE
MAX_USED_CONNECTIONS 2.0000000
SHOW STATUS LIKE 'max_used_connections';
Variable_name Value
Max_used_connections 3
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
VARIABLE_NAME VARIABLE_VALUE
MAX_USED_CONNECTIONS 3.0000000
SHOW STATUS LIKE 'max_used_connections';
Variable_name Value
Max_used_connections 4
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
VARIABLE_NAME VARIABLE_VALUE
MAX_USED_CONNECTIONS 4.0000000
SET GLOBAL thread_cache_size=@save_thread_cache_size;
show status like 'com_show_status';
Variable_name Value
......
This diff is collapsed.
......@@ -3,7 +3,7 @@
# Taken FROM the select test
#
-- source include/have_archive.inc
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
--disable_warnings
drop table if exists t1,t2,t3;
......
# This test is to verify replication with INSERT DELAY through
# unrecommended STATEMENT binlog format
-- source include/not_embedded.inc
-- source include/have_binlog_format_statement.inc
-- disable_query_log
reset master; # get rid of previous tests binlog
-- enable_query_log
-- source extra/binlog_tests/binlog_insert_delayed.test
......@@ -13,6 +13,6 @@ drop table t1;
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/not_embedded.inc
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed.inc
-- source extra/binlog_tests/binlog.test
......@@ -2,5 +2,5 @@
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/not_embedded.inc
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source extra/binlog_tests/blackhole.test
......@@ -2,5 +2,5 @@
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/not_embedded.inc
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source extra/binlog_tests/ctype_cp932.test
# This is a wrapper for binlog.test so that the same test case can be used
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source extra/binlog_tests/ctype_ucs_binlog.test
# This is a wrapper for binlog.test so that the same test case can be used
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source extra/binlog_tests/drop_temp_table.test
# This is a wrapper for binlog.test so that the same test case can be used
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source extra/binlog_tests/innodb_stat.test
# This is a wrapper for binlog.test so that the same test case can be used
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source extra/binlog_tests/insert_select-binlog.test
# This is a wrapper for binlog.test so that the same test case can be used
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source extra/binlog_tests/mix_innodb_myisam_binlog.test
# This piece below cannot be put into
......
......@@ -6,7 +6,7 @@
# inconsistency between binlog and the internal list of temp tables.
# This does not work for RBR yet.
--source include/have_binlog_format_statement.inc
--source include/have_binlog_format_mixed_or_statement.inc
-- source include/have_innodb.inc
--disable_warnings
......
# This is a wrapper for binlog.test so that the same test case can be used
# For both statement and row based bin logs 11/07/2005 [jbm]
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source extra/binlog_tests/ctype_cp932_binlog.test
#
......
......@@ -6,9 +6,9 @@
drop table if exists t1;
--enable_warnings
--replace_result ROW <format> STATEMENT <format>
--replace_result ROW <format> STATEMENT <format> MIXED <format>
SHOW GLOBAL VARIABLES LIKE "%_format%";
--replace_result ROW <format> STATEMENT <format>
--replace_result ROW <format> STATEMENT <format> MIXED <format>
SHOW SESSION VARIABLES LIKE "%_format%";
#
......@@ -36,7 +36,7 @@ set datetime_format= '%H:%i:%s.%f %m-%d-%Y';
set datetime_format= '%h:%i:%s %p %Y-%m-%d';
set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d';
--replace_result ROW <format> STATEMENT <format>
--replace_result ROW <format> STATEMENT <format> MIXED <format>
SHOW SESSION VARIABLES LIKE "%format";
--error 1231
......
......@@ -35,6 +35,7 @@ rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fa
rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly
rpl_sp : BUG#16456 2006-02-16 jmiller
rpl_multi_engine : BUG#22583 2006-09-23 lars
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
#ndb_binlog_ddl_multi : BUG#18976 2006-04-10 kent CRBR: multiple binlog, second binlog may miss schema log events
......
# We are using .opt file since we need small binlog size
# TODO: Need to look at making a row based version once the new row based client is completed. [jbm]
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
# Embedded server doesn't support binlogging
-- source include/not_embedded.inc
......
......@@ -2,7 +2,7 @@
# and a few others.
# TODO: Need to look at making row based version once new binlog client is complete.
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
# Embedded server doesn't support binlogging
-- source include/not_embedded.inc
......
This diff is collapsed.
......@@ -7,7 +7,7 @@
# in row-based, it hangs waiting for an offset which is never
# reached (the "sync_with_master 1"), logically.
--source include/have_binlog_format_statement.inc
--source include/have_binlog_format_mixed_or_statement.inc
source include/master-slave.inc;
save_master_pos;
connection slave;
......
#
# Bug#20821: INSERT DELAYED fails to write some rows to binlog
#
--echo #
--echo # Bug#20821: INSERT DELAYED fails to write some rows to binlog
--echo #
--source include/master-slave.inc
--source include/not_embedded.inc
......@@ -35,7 +34,11 @@ SELECT COUNT(*) FROM mysqlslap.t1;
sync_slave_with_master;
SELECT COUNT(*) FROM mysqlslap.t1;
--echo #
--echo # Cleanup
--echo #
connection master;
DROP SCHEMA IF EXISTS mysqlslap;
USE test;
DROP SCHEMA mysqlslap;
sync_slave_with_master;
......@@ -2,7 +2,7 @@
# replicated LOAD DATA INFILE correctly when it has binlog_*_db rules.
# This is for BUG#1100 (LOAD DATA INFILE was half-logged).
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source include/master-slave.inc
connection slave;
......
# Mixed DDL-DML (CREATE ... SELECT ...) statements can only be
# replicated properly in statement-based replication.
# Currently statement based due to bug 12345
--source include/have_binlog_format_statement.inc
--source include/have_binlog_format_mixed_or_statement.inc
source include/master-slave.inc;
......
-- source include/have_row_based.inc
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source include/not_ndb_default.inc
-- source include/master-slave.inc
# Test that the slave temporarily switches to ROW when seeing binrow
# events when it is in STATEMENT or MIXED mode
SET BINLOG_FORMAT=MIXED;
SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT;
SET GLOBAL BINLOG_FORMAT=MIXED;
SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT;
......
# TBF - difference in row level logging
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source include/master-slave.inc
--disable_warnings
......
......@@ -13,7 +13,7 @@
# - Test creating a duplicate key error and recover from it
# Requires statement logging
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
--disable_warnings
......
......@@ -54,3 +54,43 @@ UPDATE t1 SET a=99 WHERE a = 0;
--replace_result $SERVER_VERSION SERVER_VERSION
--replace_regex /table_id: [0-9]+/table_id: #/
SHOW BINLOG EVENTS;
DROP TABLE t1;
# BUG#17620: Replicate (Row Based) Fails when Query Cache enabled on
# slave
--echo ================ Test for BUG#17620 ================
--disable_query_log
--source include/master-slave-reset.inc
--enable_query_log
--echo **** On Slave ****
connection slave;
SET GLOBAL QUERY_CACHE_SIZE=0;
--echo **** On Master ****
connection master;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
--echo **** On Slave ****
sync_slave_with_master;
SET GLOBAL QUERY_CACHE_SIZE=16*1024*1024;
--echo **** On Master ****
connection master;
INSERT INTO t1 VALUES (4),(5),(6);
--echo **** On Slave ****
sync_slave_with_master;
SELECT * FROM t1;
--echo **** On Master ****
connection master;
INSERT INTO t1 VALUES (7),(8),(9);
--echo **** On Slave ****
sync_slave_with_master;
SELECT * FROM t1;
DROP TABLE t1;
......@@ -8,12 +8,17 @@
############################################################
--source include/have_row_based.inc
--source include/have_binlog_format_row.inc
--source include/have_partition.inc
--source include/not_ndb_default.inc
--source include/master-slave.inc
connection master;
--disable_warnings
DROP TABLE IF EXISTS t1;
SET BINLOG_FORMAT=ROW;
let $maybe_ro_var = @@BINLOG_FORMAT;
let $val4var = ROW;
--source include/safe_set_to_maybe_ro_var.inc
--echo **** Partition RANGE testing ****
......
......@@ -5,6 +5,8 @@
# Requires statement logging
-- source include/not_ndb_default.inc
-- source include/have_binlog_format_row.inc
-- source include/have_row_based.inc
SET SESSION BINLOG_FORMAT=ROW;
SET GLOBAL BINLOG_FORMAT=ROW;
-- source extra/rpl_tests/rpl_max_relay_size.test
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
let $engine_type = 'MyISAM';
-- source extra/rpl_tests/rpl_row_tabledefs.test
-- source include/have_binlog_format_row.inc
-- source include/have_innodb.inc
-- source include/master-slave.inc
let $engine_type = 'InnoDB';
-- source extra/rpl_tests/rpl_row_tabledefs.test
......@@ -3,6 +3,6 @@
# Date: 2006-01-11
# Purpose: Engine Wrapper for rpl_stm_EE_err2.test
##############################
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
let $engine_type=myisam;
-- source extra/rpl_tests/rpl_stm_EE_err2.test
# depends on the binlog output
--source include/have_binlog_format_statement.inc
--source include/have_binlog_format_mixed_or_statement.inc
let $rename_event_pos= 652;
-- source extra/rpl_tests/rpl_flsh_tbls.test
......
# Requires statement logging
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
let $engine_type=MyISAM;
-- source extra/rpl_tests/rpl_log.test
......
......@@ -4,7 +4,7 @@
# Test of manual relay log rotation with FLUSH LOGS.
# Requires statement logging
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source extra/rpl_tests/rpl_max_relay_size.test
# End of 4.1 tests
......
......@@ -4,7 +4,7 @@
# one binlog event containing all queries)
# Requires statement logging
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source extra/rpl_tests/rpl_multi_query.test
......
......@@ -15,7 +15,7 @@
#should proceed in a correct way.
#################################
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source include/master-slave.inc
# first, cause a duplicate key problem on the slave
......
......@@ -4,7 +4,7 @@
# case. So this test is meaningul only in statement-based (and if it was
# enabled in row-based, it would fail as expected).
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
source include/master-slave.inc;
......
# TBF - difference in row level logging
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source extra/rpl_tests/rpl_reset_slave.test
# End of 4.1 tests
......
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source include/master-slave.inc
# Test is dependent on binlog positions
......
-- source include/have_binlog_format_row.inc
-- source include/have_row_based.inc
-- source include/not_ndb_default.inc
-- source include/master-slave.inc
connection master;
......@@ -8,6 +9,9 @@ create database mysqltest1;
--enable_warnings
use mysqltest1;
set session binlog_format=row;
set global binlog_format=row;
show global variables like "binlog_format%";
show session variables like "binlog_format%";
select @@global.binlog_format, @@session.binlog_format;
......@@ -462,6 +466,41 @@ if ($you_want_to_test_UDF)
}
sync_slave_with_master;
#
# Bug#20863 If binlog format is changed between update and unlock of
# tables, wrong binlog
#
connection master;
DROP TABLE IF EXISTS t11;
SET SESSION BINLOG_FORMAT=STATEMENT;
CREATE TABLE t11 (song VARCHAR(255));
LOCK TABLES t11 WRITE;
SET SESSION BINLOG_FORMAT=ROW;
INSERT INTO t11 VALUES('Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict');
SET SESSION BINLOG_FORMAT=STATEMENT;
INSERT INTO t11 VALUES('Careful With That Axe, Eugene');
UNLOCK TABLES;
--query_vertical SELECT * FROM t11
sync_slave_with_master;
USE mysqltest1;
--query_vertical SELECT * FROM t11
connection master;
DROP TABLE IF EXISTS t12;
SET SESSION BINLOG_FORMAT=MIXED;
CREATE TABLE t12 (data LONG);
LOCK TABLES t12 WRITE;
INSERT INTO t12 VALUES(UUID());
UNLOCK TABLES;
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events from 102;
sync_slave_with_master;
# as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
......
# drop table t1 t2 t3 are included int master-slave.inc
# meaningful only in statement-based:
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source include/master-slave.inc
......
......@@ -2,7 +2,7 @@
# Test of triggers with replication
# Adding statement include due to Bug 12574
# TODO: Remove statement include once 12574 is patched
--source include/have_binlog_format_statement.inc
--source include/have_binlog_format_mixed_or_statement.inc
--source include/master-slave.inc
--disable_warnings
......
# Requires statement logging
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
source include/master-slave.inc;
......
--source include/not_ndb_default.inc
let $engine=MyISAM;
--source extra/rpl_tests/rpl_truncate.test
--source include/have_innodb.inc
--source include/not_ndb_default.inc
let $engine=InnoDB;
--source extra/rpl_tests/rpl_truncate.test
......@@ -132,4 +132,24 @@ DROP TABLE t1;
--sync_with_master
--connection master
#
# BUG#19419: "VIEW: View that the column name is different
# by master and slave is made".
#
connection master;
create table t1(a int, b int);
insert into t1 values (1, 1), (1, 2), (1, 3);
create view v1(a, b) as select a, sum(b) from t1 group by a;
sync_slave_with_master;
explain v1;
show create table v1;
select * from v1;
connection master;
drop table t1;
drop view v1;
sync_slave_with_master;
--echo End of 5.0 tests
......@@ -13,6 +13,7 @@ connect (con2,localhost,root,,);
flush status;
show status like 'Table_lock%';
select * from information_schema.session_status where variable_name like 'Table_lock%';
connection con1;
SET SQL_LOG_BIN=0;
--disable_warnings
......@@ -34,6 +35,7 @@ unlock tables;
connection con1;
reap;
show status like 'Table_lock%';
select * from information_schema.session_status where variable_name like 'Table_lock%';
drop table t1;
disconnect con2;
......@@ -102,6 +104,7 @@ while ($wait_more)
# Prerequisite.
SHOW STATUS LIKE 'max_used_connections';
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
# Save original setting.
SET @save_thread_cache_size=@@thread_cache_size;
......@@ -115,6 +118,7 @@ disconnect con2;
# Check that max_used_connections still reflects maximum value.
SHOW STATUS LIKE 'max_used_connections';
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
# Check that after flush max_used_connections equals to current number
# of connections. First wait for previous disconnect to finish.
......@@ -138,15 +142,18 @@ while ($wait_more)
--enable_result_log
# Check that we don't count disconnected thread any longer.
SHOW STATUS LIKE 'max_used_connections';
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
# Check that max_used_connections is updated when cached thread is
# reused...
connect (con2,localhost,root,,);
SHOW STATUS LIKE 'max_used_connections';
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
# ...and when new thread is created.
connect (con3,localhost,root,,);
SHOW STATUS LIKE 'max_used_connections';
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
# Restore original setting.
connection default;
......
# Requires statement logging
-- source include/have_binlog_format_statement.inc
-- source include/have_binlog_format_mixed_or_statement.inc
# TODO: Create row based version once $MYSQL_BINLOG has new RB version
# Embedded server does not support binlogging
--source include/not_embedded.inc
......
This diff is collapsed.
......@@ -53,7 +53,7 @@ ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc
rpl_tblmap.cc sql_binlog.cc event_scheduler.cc event_data_objects.cc
event_queue.cc event_db_repository.cc
sql_tablespace.cc events.cc ../sql-common/my_user.c
partition_info.cc rpl_injector.cc sql_locale.cc
partition_info.cc rpl_utility.cc rpl_injector.cc sql_locale.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
${PROJECT_SOURCE_DIR}/include/mysqld_error.h
......
......@@ -52,7 +52,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
ha_partition.h \
ha_ndbcluster.h ha_ndbcluster_binlog.h \
ha_ndbcluster_tables.h \
opt_range.h protocol.h rpl_tblmap.h \
opt_range.h protocol.h rpl_tblmap.h rpl_utility.h \
log.h sql_show.h rpl_rli.h \
sql_select.h structs.h table.h sql_udf.h hash_filo.h \
lex.h lex_symbol.h sql_acl.h sql_crypt.h \
......@@ -93,7 +93,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \
sql_load.cc mf_iocache.cc field_conv.cc sql_show.cc \
sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc \
slave.cc sql_repl.cc rpl_filter.cc rpl_tblmap.cc \
rpl_injector.cc \
rpl_utility.cc rpl_injector.cc \
sql_union.cc sql_derived.cc \
client.c sql_client.cc mini_client_errors.c pack.c\
stacktrace.c repl_failsafe.h repl_failsafe.cc \
......@@ -122,7 +122,8 @@ DEFS = -DMYSQL_SERVER \
BUILT_SOURCES = sql_yacc.cc sql_yacc.h lex_hash.h
EXTRA_DIST = udf_example.c udf_example.def $(BUILT_SOURCES) \
nt_servc.cc nt_servc.h message.mc CMakeLists.txt
nt_servc.cc nt_servc.h message.mc CMakeLists.txt \
udf_example.c udf_example.def
CLEANFILES = lex_hash.h sql_yacc.cc sql_yacc.h sql_yacc.output
AM_YFLAGS = -d --debug --verbose
......
......@@ -1257,6 +1257,16 @@ void Field::hash(ulong *nr, ulong *nr2)
}
}
my_size_t
Field::do_last_null_byte() const
{
DBUG_ASSERT(null_ptr == NULL || (byte*) null_ptr >= table->record[0]);
if (null_ptr)
return (byte*) null_ptr - table->record[0] + 1;
else
return LAST_NULL_BYTE_UNDEF;
}
void Field::copy_from_tmp(int row_offset)
{
......@@ -8094,6 +8104,33 @@ Field_bit::Field_bit(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
}
my_size_t
Field_bit::do_last_null_byte() const
{
/*
Code elsewhere is assuming that bytes are 8 bits, so I'm using
that value instead of the correct one: CHAR_BIT.
REFACTOR SUGGESTION (Matz): Change to use the correct number of
bits. On systems with CHAR_BIT > 8 (not very common), the storage
will lose the extra bits.
*/
DBUG_PRINT("debug", ("bit_ofs=%d, bit_len=%d, bit_ptr=%p",
bit_ofs, bit_len, bit_ptr));
uchar *result;
if (bit_len == 0)
result= null_ptr;
else if (bit_ofs + bit_len > 8)
result= bit_ptr + 1;
else
result= bit_ptr;
if (result)
return (byte*) result - table->record[0] + 1;
else
return LAST_NULL_BYTE_UNDEF;
}
Field *Field_bit::new_key_field(MEM_ROOT *root,
struct st_table *new_table,
char *new_ptr, uchar *new_null_ptr,
......@@ -8345,6 +8382,14 @@ const char *Field_bit::unpack(char *to, const char *from)
}
void Field_bit::set_default()
{
my_ptrdiff_t const offset= table->s->default_values - table->record[0];
uchar bits= get_rec_bits(bit_ptr + offset, bit_ofs, bit_len);
set_rec_bits(bits, bit_ptr, bit_ofs, bit_len);
Field::set_default();
}
/*
Bit field support for non-MyISAM tables.
*/
......
This diff is collapsed.
......@@ -3171,7 +3171,7 @@ int MYSQL_BIN_LOG::
flush_and_set_pending_rows_event(THD *thd, Rows_log_event* event)
{
DBUG_ENTER("MYSQL_BIN_LOG::flush_and_set_pending_rows_event(event)");
DBUG_ASSERT(thd->current_stmt_binlog_row_based && mysql_bin_log.is_open());
DBUG_ASSERT(mysql_bin_log.is_open());
DBUG_PRINT("enter", ("event=%p", event));
int error= 0;
......@@ -3416,9 +3416,6 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info)
}
}
}
/* Forget those values, for next binlogger: */
thd->stmt_depends_on_first_successful_insert_id_in_prev_stmt= 0;
thd->auto_inc_intervals_in_cur_stmt_for_binlog.empty();
}
/*
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment