Commit 1a3321b6 authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

[MDEV-6877] Added basic tests for binlog_row_image using minimal and noblob values

parent 4d856e36
# WL#5096
#
# Description
# ===========
#
# This test case checks replication between hosts with same index
# structure but may differ on engines.
#
# Usage
# =====
#
# Before including this file the following variables should be set:
# * $server_1_engine
# * $server_2_engine
# * $server_3_engine
#
# Example:
#
# -- let $server_1_engine= Falcon
# -- let $server_2_engine= MyISAM
# -- let $server_3_engine= InnoDB
#
# -- source extra/rpl_tests/rpl_row_img.test
#
-- connection server_1
-- let $diff_table=test.t
let $i= 12;
while($i)
{
let $step= "";
-- connection server_1
SET SQL_LOG_BIN=0;
-- connection server_2
SET SQL_LOG_BIN=0;
-- connection server_3
SET SQL_LOG_BIN=0;
if ($i == 1) {
let $step= No keys;
--echo ******* TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= $server_3_engine;
}
if ($i == 2)
{
let $step= One key;
--echo ******* TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= $server_3_engine;
}
if ($i == 3)
{
let $step= One Composite key;
--echo ****** TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= $server_3_engine;
}
if ($i == 4)
{
let $step= One Unique key;
--echo ****** TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= $server_3_engine;
}
if ($i == 5)
{
let $step= One Composite Unique key;
--echo ****** TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= $server_3_engine;
}
if ($i == 6)
{
let $step= One Primary key;
--echo ****** TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= $server_3_engine;
}
if ($i == 7)
{
let $step= One Composite Primary Key;
--echo ****** TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= $server_3_engine;
}
if ($i == 8)
{
let $step= One Composite key with holes;
--echo ****** TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= $server_3_engine;
}
if ($i == 9)
{
let $step= One Composite Unique key with holes;
--echo ****** TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= $server_3_engine;
}
if ($i == 10)
{
let $step= One Composite Primary Key with holes;
--echo ****** TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= $server_3_engine;
}
if ($i == 11)
{
let $step= One Composite NOT NULL Unique key with holes;
--echo ****** TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= $server_3_engine;
}
if ($i == 12)
{
let $step= One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave;
--echo ****** TEST: $step
-- connection server_1
--eval CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= $server_1_engine;
-- connection server_2
--eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= $server_2_engine;
-- connection server_3
--eval CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= $server_3_engine;
}
-- connection server_1
SET SQL_LOG_BIN=1;
-- connection server_2
SET SQL_LOG_BIN=1;
-- connection server_3
SET SQL_LOG_BIN=1;
-- connection server_1
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
-- source include/rpl_sync.inc
-- connection server_1
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
UPDATE t SET c1 = '5' WHERE c1 = 1;
UPDATE t SET c4 = '8' WHERE c2 = '4';
UPDATE t SET c1 = '8' WHERE c2 = '4';
UPDATE t SET c2 = '8' WHERE c2 = '4';
UPDATE t SET c3 = '0' WHERE c4 = NULL;
UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
-- source include/rpl_sync.inc
-- let $diff_tables= server_1:$diff_table, server_2:$diff_table, server_3:$diff_table
-- source include/diff_tables.inc
-- connection server_1
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
-- source include/rpl_sync.inc
-- let $diff_tables= server_1:$diff_table, server_2:$diff_table, server_3:$diff_table
-- source include/diff_tables.inc
-- connection server_1
DROP TABLE t;
-- source include/rpl_sync.inc
dec $i;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
!include include/default_mysqld.cnf
[mysqld.1]
log-slave-updates
innodb
innodb_flush_log_at_trx_commit= 0
[mysqld.2]
log-slave-updates
innodb
innodb_flush_log_at_trx_commit= 0
[mysqld.3]
log-slave-updates
innodb
innodb_flush_log_at_trx_commit= 0
[ENV]
SERVER_MYPORT_1= @mysqld.1.port
SERVER_MYPORT_2= @mysqld.2.port
SERVER_MYPORT_3= @mysqld.3.port
!include suite/rpl/t/rpl_row_img.cnf
#Want to skip this test from daily Valgrind execution
--source include/no_valgrind_without_big.inc
#
# This file contains tests for WL#5096 and bug fixes.
#
--let $rpl_topology= 1->2->3
--source include/rpl_init.inc
-- source include/have_binlog_format_row.inc
-- connection server_1
-- source include/have_innodb.inc
-- connection server_2
-- source include/have_innodb.inc
-- connection server_3
-- source include/have_innodb.inc
-- connection server_1
#
# WL#5096
#
#
# Tests for different storage engines on each server,
# but same index structure on tables. The tests are conducted
# using MINIMAL binlog-row-image on all servers.
#
-- let $row_img_set=server_1:MINIMAL:N,server_2:MINIMAL:Y,server_3:MINIMAL:Y
-- source include/rpl_row_img_set.inc
-- let $row_img_test_script= extra/rpl_tests/rpl_row_img.test
-- source include/rpl_row_img_general_loop.inc
-- let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y
-- source include/rpl_row_img_set.inc
--source include/rpl_end.inc
!include suite/rpl/t/rpl_row_img.cnf
#Want to skip this test from daily Valgrind execution
--source include/no_valgrind_without_big.inc
#
# This file contains tests for WL#5096 and bug fixes.
#
--let $rpl_topology= 1->2->3
--source include/rpl_init.inc
-- source include/have_binlog_format_row.inc
-- connection server_1
-- source include/have_innodb.inc
-- connection server_2
-- source include/have_innodb.inc
-- connection server_3
-- source include/have_innodb.inc
-- connection server_1
#
# WL#5096
#
#
# Tests for different storage engines on each server,
# but same index structure on tables. The tests are conducted
# using NOBLOB binlog-row-image on all servers.
#
-- let $row_img_set=server_1:NOBLOB:N,server_2:NOBLOB:Y,server_3:NOBLOB:Y
-- source include/rpl_row_img_set.inc
-- let $row_img_test_script= extra/rpl_tests/rpl_row_img.test
-- source include/rpl_row_img_general_loop.inc
-- let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y
-- source include/rpl_row_img_set.inc
--source include/rpl_end.inc
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