mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 13:02:28 +01:00
2c631fe880
- make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_commit_after_flush.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_delete_no_where.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_insert_ignore.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_log.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_multi_update2.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_multi_update3.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_relayrotate.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_row_001.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_row_UUID.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_row_basic.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_row_blob.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_row_charset.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_row_func003.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_row_sp003.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_row_sp006.test: make tests wait until ndb connects properly mysql-test/include/have_multi_ndb.inc: make tests wait until ndb connects properly mysql-test/include/have_ndb.inc: make tests wait until ndb connects properly mysql-test/include/ndb_not_readonly.inc: make tests wait until ndb connects properly mysql-test/t/rpl_commit_after_flush.test: make tests wait until ndb connects properly mysql-test/t/rpl_delete_no_where.test: make tests wait until ndb connects properly mysql-test/t/rpl_insert_ignore.test: make tests wait until ndb connects properly mysql-test/t/rpl_multi_update2.test: make tests wait until ndb connects properly mysql-test/t/rpl_multi_update3.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_2innodb.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_2myisam.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_UUID.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_auto_inc.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_bank.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_basic.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_blob.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_blob2.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_charset.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_circular.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_circular_simplex.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_commit_afterflush.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_dd_advance.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_dd_basic.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_dd_partitions.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_ddl.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_delete_nowhere.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_do_db.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_do_table.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_extraCol.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_func003.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_idempotent.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_innodb2ndb.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_innodb_trans.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_insert_ignore.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_load.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_log.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_multi.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_multi_update2.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_multi_update3.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_myisam2ndb.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_relayrotate.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_rep_ignore.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_row_001.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_sp003.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_sp006.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_stm_innodb.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_sync.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_trig004.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndbapi_multi.test: make tests wait until ndb connects properly mysql-test/t/rpl_relayrotate.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_001.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_UUID.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_basic_2myisam.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_basic_3innodb.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_basic_7ndb.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_blob_innodb.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_blob_myisam.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_charset.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_func003.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_log.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_log_innodb.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_sp003.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_sp006_InnoDB.test: make tests wait until ndb connects properly mysql-test/t/rpl_stm_log.test: make tests wait until ndb connects properly mysql-test/t/rpl_truncate_7ndb.test: make tests wait until ndb connects properly mysql-test/include/ndb_master-slave.inc: New BitKeeper file ``mysql-test/include/ndb_master-slave.inc''
187 lines
5.8 KiB
Text
187 lines
5.8 KiB
Text
#################################################
|
|
# Author: JBM
|
|
# Date: 2006-01-06
|
|
# Purpose: Test test that BLOBs are replicated
|
|
# correctly.
|
|
################################################
|
|
|
|
# Pre test clean up section
|
|
connection master;
|
|
--disable_warnings
|
|
DROP TABLE IF EXISTS test.t1;
|
|
DROP TABLE IF EXISTS test.t2;
|
|
--enable_warnings
|
|
|
|
# Start test section
|
|
--echo ***** Table Create Section ****
|
|
--echo
|
|
--disable_warnings
|
|
--replace_result $engine_type #
|
|
eval CREATE TABLE test.t1 (c1 int not null auto_increment,
|
|
data LONGBLOB, PRIMARY KEY(c1))ENGINE=$engine_type;
|
|
--enable_warnings
|
|
--echo
|
|
--echo **** Data Insert Section test.t1 *****
|
|
--echo
|
|
INSERT INTO test.t1 VALUES (NULL, NULL);
|
|
INSERT INTO test.t1 VALUES (NULL, repeat('a',1*1024));
|
|
INSERT INTO test.t1 VALUES (NULL, repeat('b',16*1024));
|
|
--echo
|
|
|
|
--echo **** Data Insert Validation Master Section test.t1 ****
|
|
--echo
|
|
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
|
|
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
|
|
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
sleep 5;
|
|
--echo
|
|
--echo **** Data Insert Validation Slave Section test.t1 ****
|
|
--echo
|
|
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
|
|
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
|
|
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
|
|
connection master;
|
|
--echo
|
|
|
|
--echo **** Data Update Section test.t1 ****
|
|
--echo
|
|
UPDATE test.t1 set data=repeat('a',18*1024) where c1 = 1;
|
|
UPDATE t1 set data=repeat('c',17*1024) where c1 = 2;
|
|
--echo
|
|
|
|
--echo **** Data Update Validation Master Section test.t1 ****
|
|
--echo
|
|
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
|
|
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
|
|
# Sleep is needed for NDB to allow time for
|
|
# Injector thread to populate the bin log.
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
sleep 5;
|
|
--echo
|
|
--echo **** Data Update Validation Slave Section test.t1 ****
|
|
--echo
|
|
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
|
|
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
|
|
connection master;
|
|
--echo
|
|
--echo **** End Test Section test.t1 ****
|
|
--echo
|
|
|
|
--echo **** Create Table test.t2 ****
|
|
--echo
|
|
--disable_warnings
|
|
--replace_result $engine_type #
|
|
eval CREATE TABLE test.t2 (
|
|
c1 INT NOT NULL PRIMARY KEY,
|
|
c2 TEXT,
|
|
c3 INT,
|
|
c4 LONGBLOB,
|
|
KEY(c3))ENGINE=$engine_type;
|
|
--enable_warnings
|
|
--echo
|
|
|
|
--echo *** Setup Values For test.t2 ***
|
|
# x0 size 256 (current inline size)
|
|
set @x0 = '01234567012345670123456701234567';
|
|
set @x0 = concat(@x0,@x0,@x0,@x0,@x0,@x0,@x0,@x0);
|
|
|
|
# b1 length 2000+256 (blob part aligned)
|
|
set @b1 = 'b1';
|
|
set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
|
|
set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
|
|
set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
|
|
set @b1 = concat(@b1,@x0);
|
|
# d1 length 3000
|
|
set @d1 = 'dd1';
|
|
set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
|
|
set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
|
|
set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
|
|
|
|
# b2 length 20000
|
|
set @b2 = 'b2';
|
|
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
|
|
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
|
|
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
|
|
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
|
|
|
|
# d2 length 30000
|
|
set @d2 = 'dd2';
|
|
set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
|
|
set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
|
|
set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
|
|
set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
|
|
--echo
|
|
|
|
--echo **** Data Insert Section test.t2 *****
|
|
--echo
|
|
INSERT INTO test.t2 VALUES(1,@b1,111,@d1);
|
|
INSERT INTO test.t2 VALUES(2,@b2,222,@d2);
|
|
--echo
|
|
|
|
--echo **** Data Insert Validation Master Section test.t2 ****
|
|
--echo
|
|
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
|
|
FROM test.t2 WHERE c1=1;
|
|
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
|
|
FROM test.t2 WHERE c1=2;
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
sleep 5;
|
|
--echo
|
|
--echo **** Data Insert Validation Slave Section test.t2 ****
|
|
--echo
|
|
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
|
|
FROM test.t2 WHERE c1=1;
|
|
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
|
|
FROM test.t2 WHERE c1=2;
|
|
connection master;
|
|
--echo
|
|
|
|
--echo **** Data Update Section test.t2 ****
|
|
--echo
|
|
UPDATE test.t2 SET c2=@b2, c4=@d2 WHERE c1=1;
|
|
UPDATE test.t2 SET c2=@b1, c4=@d1 WHERE c1=2;
|
|
--echo
|
|
|
|
--echo **** Data Update Validation Master Section test.t2 ****
|
|
--echo
|
|
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
|
|
FROM test.t2 WHERE c1=1;
|
|
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
|
|
FROM test.t2 WHERE c1=2;
|
|
# Sleep is needed for NDB to allow time for
|
|
# Injector thread to populate the bin log.
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
sleep 5;
|
|
--echo
|
|
--echo **** Data Update Validation Slave Section test.t2 ****
|
|
--echo
|
|
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
|
|
FROM test.t2 WHERE c1=1;
|
|
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
|
|
FROM test.t2 WHERE c1=2;
|
|
connection master;
|
|
--echo
|
|
|
|
# Post test clean up section
|
|
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_row_blob_master.sql
|
|
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_row_blob_slave.sql
|
|
|
|
diff_files $MYSQLTEST_VARDIR/tmp/rpl_row_blob_master.sql $MYSQLTEST_VARDIR/tmp/rpl_row_blob_slave.sql;
|
|
|
|
DROP TABLE IF EXISTS test.t1;
|
|
DROP TABLE IF EXISTS test.t2;
|
|
# ensure cleanup on slave as well:
|
|
# ndb blob tables consist of several tables
|
|
# if cluster is shutdown while not all tables are
|
|
# properly dropped, the table becomes inconsistent
|
|
# and wrecks later test cases
|
|
--sync_slave_with_master
|