Below is the list of changes that have just been committed into a local
5.1 repository of rafal. When rafal does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-08-21 09:45:58+02:00, rafal@quant.(none) +6 -0
BUG#21842 (Cluster fails to replicate to innodb or myisam with err 134
using TPC-B):
This patch introduces test rpl_ndb_2other which tests basic replication
from master using ndb tables to slave storing the same tables using
(possibly) different engine (myisam,innodb).
Test is based on existing tests rpl_ndb_2myisam and rpl_ndb_2innodb.
However, these tests doesn't work for various reasons and currently are
disabled (see BUG#19227).
The new test differs from the ones it is based on as follows:
1. Single test tests replication with different storage engines on slave
(myisam, innodb, ndb).
2. Include file extra/rpl_tests/rpl_ndb_2multi_eng.test containing
original tests is replaced by extra/rpl_tests/rpl_ndb_2multi_basic.test
which doesn't contain tests using partitioned tables as these don't work
currently. Instead, it tests replication to a slave which has more
columns than master.
3. Include file include/rpl_multi_engine3.inc is replaced with
include/rpl_multi_engine2.inc. The later differs by performing slightly
different operations (updating more than one row in the table) and
clearing table with "TRUNCATE TABLE" statement instead of "DELETE FROM"
as replication of "DELETE" doesn't work well in this setting.
4. Slave must use option --log-slave-updates=0 as otherwise execution of
replication events generated by ndb fails if table uses a different
storage engine on slave (see BUG#29569).
mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test@stripped, 2007-08-21 09:45:55+02:00,
rafal@quant.(none) +99 -0
Modification of rpl_ndb_2multi_eng test. Tests with partitioned tables are
removed and a setup with slave having extra columns in a table is added.
mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test@stripped, 2007-08-21 09:45:55+02:00,
rafal@quant.(none) +0 -0
mysql-test/include/rpl_multi_engine2.inc@stripped, 2007-08-21 09:45:55+02:00,
rafal@quant.(none) +10 -0
Fill table with data and perform basic operations on the contents.
mysql-test/include/rpl_multi_engine2.inc@stripped, 2007-08-21 09:45:55+02:00,
rafal@quant.(none) +0 -0
mysql-test/include/rpl_multi_engine2_data.inc@stripped, 2007-08-21 09:45:55+02:00,
rafal@quant.(none) +29 -0
Fill table with test data.
mysql-test/include/rpl_multi_engine2_data.inc@stripped, 2007-08-21 09:45:55+02:00,
rafal@quant.(none) +0 -0
mysql-test/include/rpl_multi_engine2_queries.inc@stripped, 2007-08-21 09:45:55+02:00,
rafal@quant.(none) +37 -0
Perform basic operations on table data (update, delete) and check results.
mysql-test/include/rpl_multi_engine2_queries.inc@stripped, 2007-08-21 09:45:55+02:00,
rafal@quant.(none) +0 -0
mysql-test/t/rpl_ndb_2other-slave.opt@stripped, 2007-08-21 09:45:54+02:00, rafal@quant.(none)
+1 -0
Enable innodb engine and disable logging of slave thread updates for
rpl_ndb_2other test.
mysql-test/t/rpl_ndb_2other-slave.opt@stripped, 2007-08-21 09:45:54+02:00, rafal@quant.(none)
+0 -0
mysql-test/t/rpl_ndb_2other.test@stripped, 2007-08-21 09:45:54+02:00, rafal@quant.(none) +34
-0
Test replication of NDB table to slave using other engine. The main test
is in extra/rpl_tests/rpl_ndb_2multi_basic.test. It is included here
several times with different settings of default storage engine on slave.
mysql-test/t/rpl_ndb_2other.test@stripped, 2007-08-21 09:45:54+02:00, rafal@quant.(none) +0
-0
diff -Nrup a/mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test
b/mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test 2007-08-21 09:45:55 +02:00
@@ -0,0 +1,99 @@
+#######################################
+# 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 --- Start test 1 Basic testing ---
+--echo --- Create Table Section ---
+
+#################################################
+# Requirment: Create basic table, replicate #
+# basice operations such at insert, update #
+# delete between 2 different storage engines #
+# Alter table and ensure table is handled #
+# Correctly on the slave #
+#################################################
+
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(3), 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
+
+ALTER TABLE t1 ADD PRIMARY KEY(id,total);
+ALTER TABLE t1 MODIFY vc TEXT;
+
+--source include/rpl_multi_engine2_data.inc
+
+--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 < 100;
+UPDATE t1 SET v='explicit' WHERE id >10;
+
+--echo --- Show changed table on slave ---
+
+SHOW CREATE TABLE t1;
+SELECT id, hex(b1), vc, bc, d, f, total, y, t, u, v
+FROM t1
+ORDER BY id;
+
+--source include/rpl_multi_engine2_queries.inc
+
+--echo --- Show all columns on slave ---
+connection slave;
+SELECT id, hex(b1), vc, bc, d, f, total, y, t, u, v
+FROM t1
+ORDER BY id;
+
+--echo --- End test 1 Basic testing ---
+--echo --- Do Cleanup --
+
+DROP TABLE IF EXISTS t1;
+
+#################################################################
+
+# End of 5.1 test case
diff -Nrup a/mysql-test/include/rpl_multi_engine2.inc
b/mysql-test/include/rpl_multi_engine2.inc
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/mysql-test/include/rpl_multi_engine2.inc 2007-08-21 09:45:55 +02:00
@@ -0,0 +1,10 @@
+#############################################################
+# Author: Rafal
+# Date: 2007-08-20
+#############################################################
+
+connection master;
+--source include/rpl_multi_engine2_data.inc
+--source include/rpl_multi_engine2_queries.inc
+
+TRUNCATE TABLE t1;
diff -Nrup a/mysql-test/include/rpl_multi_engine2_data.inc
b/mysql-test/include/rpl_multi_engine2_data.inc
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/mysql-test/include/rpl_multi_engine2_data.inc 2007-08-21 09:45:55 +02:00
@@ -0,0 +1,29 @@
+connection master;
+--echo --- Populate t1 with data ---
+--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 id, hex(b1), vc, bc, d, f, total, y, t from t1 order by id;
+
+sync_slave_with_master;
+--echo --- Select from t1 on slave ---
+select id, hex(b1), vc, bc, d, f, total, y, t from t1 order by id;
+
+connection master;
+
diff -Nrup a/mysql-test/include/rpl_multi_engine2_queries.inc
b/mysql-test/include/rpl_multi_engine2_queries.inc
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/mysql-test/include/rpl_multi_engine2_queries.inc 2007-08-21 09:45:55 +02:00
@@ -0,0 +1,37 @@
+connection master;
+--echo --- Perform basic operation on master ---
+--echo --- and ensure replicated correctly ---
+
+--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 id, hex(b1), vc, bc, d, f, total, y, t
+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 id, hex(b1), vc, bc, d, f, total, y, t
+FROM t1
+WHERE id < 100
+ORDER BY id;
+
+connection master;
+--echo --- Remove a record from t1 on master ---
+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;
diff -Nrup a/mysql-test/t/rpl_ndb_2other-slave.opt b/mysql-test/t/rpl_ndb_2other-slave.opt
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/rpl_ndb_2other-slave.opt 2007-08-21 09:45:54 +02:00
@@ -0,0 +1 @@
+--innodb --log-slave-updates=0
diff -Nrup a/mysql-test/t/rpl_ndb_2other.test b/mysql-test/t/rpl_ndb_2other.test
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/rpl_ndb_2other.test 2007-08-21 09:45:54 +02:00
@@ -0,0 +1,34 @@
+#############################################################
+# 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/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
| Thread |
|---|
| • bk commit into 5.1 tree (rafal:1.2532) BUG#21842 | rsomla | 21 Aug |