Browse Source
Merge quant.(none):/ext/mysql/bk/mysql-5.1-bug21842-5.1.22
Merge quant.(none):/ext/mysql/bk/mysql-5.1-bug21842-5.1.22
into quant.(none):/ext/mysql/bk/mysql-5.1-bug21842-5.1.22-mergepull/374/head
13 changed files with 3199 additions and 570 deletions
-
119mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test
-
91mysql-test/include/rpl_multi_engine2.inc
-
1189mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result
-
1mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt
-
35mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test
-
850sql/log_event.cc
-
107sql/log_event.h
-
1115sql/log_event_old.cc
-
130sql/log_event_old.h
-
78sql/rpl_record.cc
-
10sql/rpl_record.h
-
2sql/rpl_utility.cc
-
42sql/rpl_utility.h
@ -0,0 +1,119 @@ |
|||
####################################### |
|||
# Author: Rafal Somla # |
|||
# Date: 2006-08-20 # |
|||
# Purpose: Test replication of basic # |
|||
# table operations in various setups # |
|||
# # |
|||
# Based on rpl_ndb_2multi_eng.test by # |
|||
# JBM # |
|||
####################################### |
|||
|
|||
--echo --- Doing pre test cleanup --- |
|||
|
|||
connection master; |
|||
--disable_warnings |
|||
DROP TABLE IF EXISTS t1; |
|||
--enable_query_log |
|||
|
|||
################################################# |
|||
--echo --- Create Table Section --- |
|||
|
|||
CREATE TABLE t1 (id MEDIUMINT NOT NULL, |
|||
b1 INT, |
|||
vc VARCHAR(255), |
|||
bc CHAR(255), |
|||
d DECIMAL(10,4) DEFAULT 0, |
|||
f FLOAT DEFAULT 0, |
|||
total BIGINT UNSIGNED, |
|||
y YEAR, |
|||
t DATE, |
|||
PRIMARY KEY(id)); |
|||
|
|||
--echo --- Show table on master --- |
|||
|
|||
SHOW CREATE TABLE t1; |
|||
|
|||
--echo --- Show table on slave --- |
|||
|
|||
sync_slave_with_master; |
|||
SHOW CREATE TABLE t1; |
|||
|
|||
--source include/rpl_multi_engine2.inc |
|||
|
|||
################################################# |
|||
# Okay lets see how it holds up to table changes |
|||
--echo --- Check that simple Alter statements are replicated correctly -- |
|||
|
|||
ALTER TABLE t1 DROP PRIMARY KEY; |
|||
# note: table with no PK can't contain blobs if it is to be replicated. |
|||
ALTER TABLE t1 MODIFY vc char(32); |
|||
|
|||
--echo --- Show the new improved table on the master --- |
|||
|
|||
SHOW CREATE TABLE t1; |
|||
|
|||
--echo --- Make sure that our tables on slave are still same engine --- |
|||
--echo --- and that the alter statements replicated correctly --- |
|||
|
|||
sync_slave_with_master; |
|||
SHOW CREATE TABLE t1; |
|||
|
|||
--source include/rpl_multi_engine2.inc |
|||
|
|||
################################################# |
|||
--echo --- Check that replication works when slave has more columns than master |
|||
connection master; |
|||
ALTER TABLE t1 ADD PRIMARY KEY(id,total); |
|||
ALTER TABLE t1 MODIFY vc TEXT; |
|||
|
|||
INSERT INTO t1 VALUES(3,1,'Testing MySQL databases is a cool ', |
|||
'Must make it bug free for the customer', |
|||
654321.4321,15.21,0,1965,"1905-11-14"); |
|||
INSERT INTO t1 VALUES(20,1,'Testing MySQL databases is a cool ', |
|||
'Must make it bug free for the customer', |
|||
654321.4321,15.21,0,1965,"1965-11-14"); |
|||
INSERT INTO t1 VALUES(50,1,'Testing MySQL databases is a cool ', |
|||
'Must make it bug free for the customer', |
|||
654321.4321,15.21,0,1965,"1985-11-14"); |
|||
|
|||
--echo --- Add columns on slave --- |
|||
--sync_slave_with_master |
|||
ALTER TABLE t1 ADD (u int, v char(16) default 'default'); |
|||
UPDATE t1 SET u=7 WHERE id < 50; |
|||
UPDATE t1 SET v='explicit' WHERE id >10; |
|||
|
|||
--echo --- Show changed table on slave --- |
|||
|
|||
SHOW CREATE TABLE t1; |
|||
SELECT * |
|||
FROM t1 |
|||
ORDER BY id; |
|||
|
|||
--source include/rpl_multi_engine2.inc |
|||
TRUNCATE TABLE t1; |
|||
|
|||
################################################# |
|||
--echo --- Check that replication works when master has more columns than slave |
|||
connection master; |
|||
|
|||
--echo --- Remove columns on slave --- |
|||
--sync_slave_with_master |
|||
ALTER TABLE t1 DROP COLUMN v; |
|||
ALTER TABLE t1 DROP COLUMN u; |
|||
ALTER TABLE t1 DROP COLUMN t; |
|||
ALTER TABLE t1 DROP COLUMN y; |
|||
|
|||
--echo --- Show changed table on slave --- |
|||
|
|||
SHOW CREATE TABLE t1; |
|||
|
|||
--source include/rpl_multi_engine2.inc |
|||
TRUNCATE TABLE t1; |
|||
|
|||
################################################# |
|||
--echo --- Do Cleanup -- |
|||
connection master; |
|||
DROP TABLE IF EXISTS t1; |
|||
|
|||
sync_slave_with_master; |
|||
connection master; |
|||
@ -0,0 +1,91 @@ |
|||
############################################################# |
|||
# Author: Rafal |
|||
# Date: 2007-08-20 |
|||
# based on rpl_multi_engine3.inc |
|||
############################################################# |
|||
|
|||
connection slave; |
|||
STOP SLAVE; |
|||
RESET SLAVE; |
|||
|
|||
connection master; |
|||
RESET MASTER; |
|||
|
|||
connection slave; |
|||
START SLAVE; |
|||
|
|||
--echo --- Populate t1 with data --- |
|||
connection master; |
|||
--disable_query_log |
|||
INSERT INTO t1 VALUES(42,1,'Testing MySQL databases is a cool ', |
|||
'Must make it bug free for the customer', |
|||
654321.4321,15.21,0,1965,"1905-11-14"); |
|||
INSERT INTO t1 VALUES(2,1,'Testing MySQL databases is a cool ', |
|||
'Must make it bug free for the customer', |
|||
654321.4321,15.21,0,1965,"1965-11-14"); |
|||
INSERT INTO t1 VALUES(4,1,'Testing MySQL databases is a cool ', |
|||
'Must make it bug free for the customer', |
|||
654321.4321,15.21,0,1965,"1985-11-14"); |
|||
INSERT INTO t1 VALUES(142,1,'Testing MySQL databases is a cool ', |
|||
'Must make it bug free for the customer', |
|||
654321.4321,15.21,0,1965,"1995-11-14"); |
|||
INSERT INTO t1 VALUES(412,1,'Testing MySQL databases is a cool ', |
|||
'Must make it bug free for the customer', |
|||
654321.4321,15.21,0,1965,"2005-11-14"); |
|||
--enable_query_log |
|||
|
|||
--echo --- Select from t1 on master --- |
|||
select * |
|||
from t1 |
|||
order by id; |
|||
|
|||
sync_slave_with_master; |
|||
--echo --- Select from t1 on slave --- |
|||
select * |
|||
from t1 |
|||
order by id; |
|||
|
|||
--echo --- Perform basic operation on master --- |
|||
--echo --- and ensure replicated correctly --- |
|||
connection master; |
|||
|
|||
--echo --- Update t1 on master -- |
|||
UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" |
|||
WHERE id < 100 |
|||
ORDER BY id; |
|||
|
|||
--echo --- Check the update on master --- |
|||
SELECT * |
|||
FROM t1 |
|||
WHERE id < 100 |
|||
ORDER BY id; |
|||
|
|||
# Must give injector thread a little time to get update |
|||
# into the binlog other wise we will miss the update. |
|||
|
|||
sync_slave_with_master; |
|||
--echo --- Check Update on slave --- |
|||
SELECT * |
|||
FROM t1 |
|||
WHERE id < 100 |
|||
ORDER BY id; |
|||
|
|||
connection master; |
|||
--echo --- Remove a record from t1 on master --- |
|||
# Note: there is an error in replication of Delete_row |
|||
# from NDB to MyISAM (BUG#28538). However, if there is |
|||
# only one row in Delete_row event then it works fine, |
|||
# as this test demonstrates. |
|||
DELETE FROM t1 WHERE id = 412; |
|||
|
|||
--echo --- Show current count on master for t1 --- |
|||
SELECT COUNT(*) FROM t1; |
|||
|
|||
sync_slave_with_master; |
|||
--echo --- Show current count on slave for t1 --- |
|||
SELECT COUNT(*) FROM t1; |
|||
|
|||
connection master; |
|||
TRUNCATE TABLE t1; |
|||
sync_slave_with_master; |
|||
connection master; |
|||
1189
mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1 @@ |
|||
--innodb --log-slave-updates=0 |
|||
@ -0,0 +1,35 @@ |
|||
############################################################# |
|||
# Author: Rafal Somla |
|||
# Date: 2006-08-20 |
|||
# Purpose: Trying to test ability to replicate from cluster |
|||
# to other engines (innodb, myisam). |
|||
############################################################## |
|||
--source include/have_ndb.inc |
|||
--source include/have_innodb.inc |
|||
--source include/have_binlog_format_mixed_or_row.inc |
|||
--source include/master-slave.inc |
|||
|
|||
# On master use NDB as storage engine. |
|||
connection master; |
|||
SET storage_engine=ndb; |
|||
|
|||
--echo |
|||
--echo === NDB -> MYISAM === |
|||
--echo |
|||
connection slave; |
|||
SET storage_engine=myisam; |
|||
--source extra/rpl_tests/rpl_ndb_2multi_basic.test |
|||
|
|||
--echo |
|||
--echo === NDB -> INNODB === |
|||
--echo |
|||
connection slave; |
|||
SET storage_engine=innodb; |
|||
--source extra/rpl_tests/rpl_ndb_2multi_basic.test |
|||
|
|||
--echo |
|||
--echo === NDB -> NDB === |
|||
--echo |
|||
connection slave; |
|||
SET storage_engine=ndb; |
|||
--source extra/rpl_tests/rpl_ndb_2multi_basic.test |
|||
850
sql/log_event.cc
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1115
sql/log_event_old.cc
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue