2007-07-30 00:10:42 +02:00
|
|
|
#############################################################
|
2007-10-10 16:43:20 +02:00
|
|
|
# Author: Chuck
|
|
|
|
#############################################################
|
2007-07-30 00:10:42 +02:00
|
|
|
# Purpose: To test having extra columns on the master WL#3915
|
|
|
|
# engine inspecific sourced part
|
|
|
|
#############################################################
|
2007-10-10 16:43:20 +02:00
|
|
|
# Change Author: Jeb
|
|
|
|
# Change: Cleanup and extend testing
|
|
|
|
#############################################################
|
2007-07-30 00:10:42 +02:00
|
|
|
# TODO: partition specific
|
|
|
|
# -- source include/have_partition.inc
|
2007-10-10 16:43:20 +02:00
|
|
|
# Note: Will be done in different test due to NDB using this
|
|
|
|
# test case.
|
|
|
|
############################################################
|
2007-07-30 00:10:42 +02:00
|
|
|
|
|
|
|
########### Clean up ################
|
|
|
|
--disable_warnings
|
|
|
|
--disable_query_log
|
2007-10-10 16:43:20 +02:00
|
|
|
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t10,t11,t12,t13,t14,t15,t16,t17,t18,t31;
|
2007-07-30 00:10:42 +02:00
|
|
|
--enable_query_log
|
|
|
|
--enable_warnings
|
|
|
|
|
|
|
|
#
|
|
|
|
# Setup differently defined tables on master and slave
|
|
|
|
#
|
|
|
|
|
|
|
|
# Def on master: t (f_1 type_m_1,... f_s type_m_s, f_s1, f_m)
|
|
|
|
# Def on slave: t (f_1 type_s_1,... f_s type_s_s)
|
|
|
|
# where type_mi,type_si (0 < i-1 <s1) pairs are compatible types (WL#3228)
|
|
|
|
# Arbitrary paramaters of the test are:
|
|
|
|
# 1. the tables type
|
|
|
|
# 2. the types of the extra master's column f_s1,..., f_m
|
|
|
|
# 3. the numbers of common columns `s'
|
|
|
|
# 4. and extra columns `m' are par
|
|
|
|
#
|
|
|
|
# optionally
|
|
|
|
#
|
|
|
|
# 5. vary the common columns type within compatible ranges.
|
|
|
|
|
|
|
|
#
|
|
|
|
# constant size column type:
|
|
|
|
|
|
|
|
#BIGINT
|
|
|
|
#BLOB
|
|
|
|
#DATE
|
|
|
|
#DATETIME
|
|
|
|
#FLOAT
|
|
|
|
#INT, INTEGER
|
|
|
|
#LONGBLOB
|
|
|
|
#LONGTEXT
|
|
|
|
#MEDIUMBLOB
|
|
|
|
#MEDIUMINT
|
|
|
|
#MEDIUMTEXT
|
|
|
|
#REAL
|
|
|
|
#SMALLINT
|
|
|
|
#TEXT
|
|
|
|
#TIME
|
|
|
|
#TIMESTAMP
|
|
|
|
#TINYBLOB
|
|
|
|
#TINYINT
|
|
|
|
#TINYTEXT
|
|
|
|
#YEAR
|
|
|
|
|
|
|
|
# variable size column types:
|
|
|
|
|
|
|
|
#BINARY(M)
|
|
|
|
#BIT(M)
|
|
|
|
#CHAR(M)
|
|
|
|
#DECIMAL(M,D)
|
|
|
|
#DOUBLE[P]
|
|
|
|
#ENUM
|
|
|
|
#FLOAT(p)
|
|
|
|
#NUMERIC(M,D)
|
|
|
|
#SET
|
|
|
|
#VARBINARY(M)
|
|
|
|
#VARCHAR(M)
|
|
|
|
#
|
|
|
|
|
2007-10-10 16:43:20 +02:00
|
|
|
let $binformat = `SHOW VARIABLES LIKE '%binlog_format%'`;
|
|
|
|
--echo
|
|
|
|
--echo ***********************************************************
|
|
|
|
--echo ***********************************************************
|
|
|
|
--echo ***************** Start of Testing ************************
|
|
|
|
--echo ***********************************************************
|
|
|
|
--echo ***********************************************************
|
|
|
|
--echo * This test format == $binformat and engine == $engine_type
|
|
|
|
--echo ***********************************************************
|
|
|
|
--echo ***********************************************************
|
|
|
|
--echo
|
|
|
|
--echo ***** Testing more columns on the Master *****
|
|
|
|
--echo
|
2007-07-30 17:59:05 +02:00
|
|
|
connection master;
|
|
|
|
eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
|
2007-10-10 16:43:20 +02:00
|
|
|
/* extra */
|
|
|
|
f5 FLOAT DEFAULT '2.00',
|
|
|
|
f6 CHAR(4) DEFAULT 'TEST',
|
|
|
|
f7 INT DEFAULT '0',
|
|
|
|
f8 TEXT,
|
|
|
|
f9 LONGBLOB,
|
|
|
|
f10 BIT(63),
|
|
|
|
f11 VARBINARY(64))ENGINE=$engine_type;
|
|
|
|
--echo
|
|
|
|
--echo * Alter Table on Slave and drop columns f5 through f11 *
|
|
|
|
--echo
|
2007-07-30 17:59:05 +02:00
|
|
|
sync_slave_with_master;
|
2007-10-10 16:43:20 +02:00
|
|
|
alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
|
2007-07-30 17:59:05 +02:00
|
|
|
|
2007-10-10 16:43:20 +02:00
|
|
|
--echo
|
|
|
|
--echo * Insert data in Master then update and delete some rows*
|
|
|
|
--echo
|
2007-07-30 17:59:05 +02:00
|
|
|
connection master;
|
2007-10-10 16:43:20 +02:00
|
|
|
let $j= 50;
|
|
|
|
--disable_query_log
|
|
|
|
while ($j)
|
|
|
|
{
|
|
|
|
eval INSERT INTO t1 VALUES ($j, $j, $j, 'second', 2.0, 'kaks', 2,
|
|
|
|
'got stolen from the paradise',
|
|
|
|
'very fat blob', b'01010101010101',
|
|
|
|
0x123456);
|
|
|
|
dec $j;
|
|
|
|
}
|
|
|
|
let $j= 30;
|
|
|
|
while ($j)
|
|
|
|
{
|
|
|
|
eval update t1 set f4= 'next' where f1=$j;
|
|
|
|
dec $j;
|
|
|
|
dec $j;
|
|
|
|
eval delete from t1 where f1=$j;
|
|
|
|
dec $j;
|
|
|
|
}
|
|
|
|
--enable_query_log
|
2007-07-30 17:59:05 +02:00
|
|
|
|
2007-10-10 16:43:20 +02:00
|
|
|
--echo * Select count and 20 rows from Master *
|
|
|
|
--echo
|
|
|
|
SELECT COUNT(*) FROM t1;
|
|
|
|
--echo
|
|
|
|
SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
|
|
|
|
hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
|
2007-07-30 00:10:42 +02:00
|
|
|
|
|
|
|
#connection slave;
|
2007-10-10 16:43:20 +02:00
|
|
|
sync_slave_with_master;
|
|
|
|
--echo
|
|
|
|
--echo * Select count and 20 rows from Slave *
|
|
|
|
--echo
|
|
|
|
SELECT COUNT(*) FROM t1;
|
|
|
|
--echo
|
|
|
|
SELECT * FROM t1 ORDER BY f3 LIMIT 20;
|
2007-07-30 00:10:42 +02:00
|
|
|
|
2007-10-10 16:43:20 +02:00
|
|
|
--echo
|
|
|
|
--echo * Show Slave Status *
|
|
|
|
--echo
|
|
|
|
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
|
2007-07-30 00:10:42 +02:00
|
|
|
--query_vertical show slave status;
|
2007-10-10 16:43:20 +02:00
|
|
|
--echo
|
2007-07-30 00:10:42 +02:00
|
|
|
|
|
|
|
### Altering table def scenario
|
2007-10-10 16:43:20 +02:00
|
|
|
--echo
|
|
|
|
--echo ***** Testing Altering table def scenario *****
|
|
|
|
--echo
|
2007-07-30 00:10:42 +02:00
|
|
|
|
|
|
|
connection master;
|
|
|
|
|
|
|
|
eval CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
|
|
|
|
/* extra */
|
|
|
|
f5 DOUBLE DEFAULT '2.00',
|
|
|
|
f6 ENUM('a', 'b', 'c') default 'a',
|
|
|
|
f7 DECIMAL(17,9) default '1000.00',
|
|
|
|
f8 MEDIUMBLOB,
|
|
|
|
f9 NUMERIC(6,4) default '2000.00',
|
|
|
|
f10 VARCHAR(1024),
|
|
|
|
f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
|
|
|
|
f12 SET('a', 'b', 'c') default 'b')
|
|
|
|
ENGINE=$engine_type;
|
2007-10-10 16:43:20 +02:00
|
|
|
--echo
|
2007-07-30 00:10:42 +02:00
|
|
|
eval CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
|
|
|
|
/* extra */
|
|
|
|
f5 DOUBLE DEFAULT '2.00',
|
|
|
|
f6 ENUM('a', 'b', 'c') default 'a',
|
|
|
|
f8 MEDIUMBLOB,
|
|
|
|
f10 VARCHAR(1024),
|
|
|
|
f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
|
|
|
|
f12 SET('a', 'b', 'c') default 'b')
|
|
|
|
ENGINE=$engine_type;
|
|
|
|
|
2007-10-10 16:43:20 +02:00
|
|
|
--echo
|
2007-07-30 00:10:42 +02:00
|
|
|
# no ENUM and SET
|
|
|
|
eval CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
|
|
|
|
/* extra */
|
|
|
|
f5 DOUBLE DEFAULT '2.00',
|
|
|
|
f6 DECIMAL(17,9) default '1000.00',
|
|
|
|
f7 MEDIUMBLOB,
|
|
|
|
f8 NUMERIC(6,4) default '2000.00',
|
|
|
|
f9 VARCHAR(1024),
|
|
|
|
f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
|
|
|
|
f11 CHAR(255))
|
|
|
|
ENGINE=$engine_type;
|
|
|
|
|
2007-10-10 16:43:20 +02:00
|
|
|
--echo
|
2007-07-30 00:10:42 +02:00
|
|
|
eval CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
|
|
|
|
|
|
|
|
/* extra */
|
|
|
|
|
|
|
|
f5 BIGINT,
|
|
|
|
f6 BLOB,
|
|
|
|
f7 DATE,
|
|
|
|
f8 DATETIME,
|
|
|
|
f9 FLOAT,
|
|
|
|
f10 INT,
|
|
|
|
f11 LONGBLOB,
|
|
|
|
f12 LONGTEXT,
|
|
|
|
f13 MEDIUMBLOB,
|
|
|
|
f14 MEDIUMINT,
|
|
|
|
f15 MEDIUMTEXT,
|
|
|
|
f16 REAL,
|
|
|
|
f17 SMALLINT,
|
|
|
|
f18 TEXT,
|
|
|
|
f19 TIME,
|
|
|
|
f20 TIMESTAMP,
|
|
|
|
f21 TINYBLOB,
|
|
|
|
f22 TINYINT,
|
|
|
|
f23 TINYTEXT,
|
|
|
|
f24 YEAR,
|
|
|
|
f25 BINARY(255),
|
|
|
|
f26 BIT(64),
|
|
|
|
f27 CHAR(255),
|
|
|
|
f28 DECIMAL(30,7),
|
|
|
|
f29 DOUBLE,
|
|
|
|
f30 ENUM ('a','b', 'c') default 'a',
|
|
|
|
f31 FLOAT,
|
|
|
|
f32 NUMERIC(17,9),
|
|
|
|
f33 SET ('a', 'b', 'c') default 'b',
|
|
|
|
f34 VARBINARY(1025),
|
|
|
|
f35 VARCHAR(257)
|
|
|
|
) ENGINE=$engine_type;
|
2007-10-10 16:43:20 +02:00
|
|
|
--echo
|
|
|
|
--echo ** Alter tables on slave and drop columns **
|
|
|
|
--echo
|
2007-07-30 00:10:42 +02:00
|
|
|
#connection slave;
|
|
|
|
sync_slave_with_master;
|
|
|
|
alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop
|
|
|
|
f12;
|
|
|
|
alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12;
|
|
|
|
alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
|
|
|
|
|
|
|
|
alter table t31
|
|
|
|
drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11,
|
|
|
|
drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18,
|
|
|
|
drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25,
|
|
|
|
drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32,
|
|
|
|
drop f33, drop f34, drop f35;
|
|
|
|
|
2007-10-10 16:43:20 +02:00
|
|
|
--echo
|
|
|
|
--echo ** Insert Data into Master **
|
2007-07-30 00:10:42 +02:00
|
|
|
connection master;
|
|
|
|
INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10:
|
|
|
|
some var char';
|
|
|
|
INSERT into t2 values (2, 2, 2, 'second',
|
|
|
|
2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char',
|
|
|
|
'01234567', 'c'),
|
|
|
|
(3, 3, 3, 'third',
|
|
|
|
3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char',
|
|
|
|
'01234567', 'c');
|
|
|
|
INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char';
|
|
|
|
INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10:
|
|
|
|
binary data';
|
|
|
|
INSERT into t31 set f1=1, f2=1, f3=1, f4='first';
|
|
|
|
INSERT into t31 set f1=1, f2=1, f3=2, f4='second',
|
|
|
|
f9=2.2, f10='seven samurai', f28=222.222, f35='222';
|
|
|
|
INSERT into t31 values (1, 1, 3, 'third',
|
|
|
|
/* f5 BIGINT, */ 333333333333333333333333,
|
|
|
|
/* f6 BLOB, */ '3333333333333333333333',
|
|
|
|
/* f7 DATE, */ '2007-07-18',
|
|
|
|
/* f8 DATETIME, */ "2007-07-18",
|
|
|
|
/* f9 FLOAT, */ 3.33333333,
|
|
|
|
/* f10 INT, */ 333333333,
|
|
|
|
/* f11 LONGBLOB, */ '3333333333333333333',
|
|
|
|
/* f12 LONGTEXT, */ '3333333333333333333',
|
|
|
|
/* f13 MEDIUMBLOB, */ '3333333333333333333',
|
|
|
|
/* f14 MEDIUMINT, */ 33,
|
|
|
|
/* f15 MEDIUMTEXT, */ 3.3,
|
|
|
|
/* f16 REAL, */ 3.3,
|
|
|
|
/* f17 SMALLINT, */ 3,
|
|
|
|
/* f18 TEXT, */ '33',
|
|
|
|
/* f19 TIME, */ '2:59:58.999',
|
|
|
|
/* f20 TIMESTAMP, */ 20000303000000,
|
|
|
|
/* f21 TINYBLOB, */ '3333',
|
|
|
|
/* f22 TINYINT, */ 3,
|
|
|
|
/* f23 TINYTEXT, */ '3',
|
|
|
|
/* f24 YEAR, */ 3000,
|
|
|
|
/* f25 BINARY(255), */ 'three_33333',
|
|
|
|
/* f26 BIT(64), */ b'011',
|
|
|
|
/* f27 CHAR(255), */ 'three',
|
|
|
|
/* f28 DECIMAL(30,7), */ 3.333,
|
|
|
|
/* f29 DOUBLE, */ 3.333333333333333333333333333,
|
|
|
|
/* f30 ENUM ('a','b','c')*/ 'c',
|
|
|
|
/* f31 FLOAT, */ 3.0,
|
|
|
|
/* f32 NUMERIC(17,9), */ 3.3333,
|
|
|
|
/* f33 SET ('a','b','c'),*/ 'c',
|
|
|
|
/*f34 VARBINARY(1025),*/ '3333 minus 3',
|
|
|
|
/*f35 VARCHAR(257),*/ 'three times three'
|
|
|
|
);
|
|
|
|
|
|
|
|
INSERT into t31 values (1, 1, 4, 'fourth',
|
|
|
|
/* f5 BIGINT, */ 333333333333333333333333,
|
|
|
|
/* f6 BLOB, */ '3333333333333333333333',
|
|
|
|
/* f7 DATE, */ '2007-07-18',
|
|
|
|
/* f8 DATETIME, */ "2007-07-18",
|
|
|
|
/* f9 FLOAT, */ 3.33333333,
|
|
|
|
/* f10 INT, */ 333333333,
|
|
|
|
/* f11 LONGBLOB, */ '3333333333333333333',
|
|
|
|
/* f12 LONGTEXT, */ '3333333333333333333',
|
|
|
|
/* f13 MEDIUMBLOB, */ '3333333333333333333',
|
|
|
|
/* f14 MEDIUMINT, */ 33,
|
|
|
|
/* f15 MEDIUMTEXT, */ 3.3,
|
|
|
|
/* f16 REAL, */ 3.3,
|
|
|
|
/* f17 SMALLINT, */ 3,
|
|
|
|
/* f18 TEXT, */ '33',
|
|
|
|
/* f19 TIME, */ '2:59:58.999',
|
|
|
|
/* f20 TIMESTAMP, */ 20000303000000,
|
|
|
|
/* f21 TINYBLOB, */ '3333',
|
|
|
|
/* f22 TINYINT, */ 3,
|
|
|
|
/* f23 TINYTEXT, */ '3',
|
|
|
|
/* f24 YEAR, */ 3000,
|
|
|
|
/* f25 BINARY(255), */ 'three_33333',
|
|
|
|
/* f26 BIT(64), */ b'011',
|
|
|
|
/* f27 CHAR(255), */ 'three',
|
|
|
|
/* f28 DECIMAL(30,7), */ 3.333,
|
|
|
|
/* f29 DOUBLE, */ 3.333333333333333333333333333,
|
|
|
|
/* f30 ENUM ('a','b','c')*/ 'c',
|
|
|
|
/* f31 FLOAT, */ 3.0,
|
|
|
|
/* f32 NUMERIC(17,9), */ 3.3333,
|
|
|
|
/* f33 SET ('a','b','c'),*/ 'c',
|
|
|
|
/*f34 VARBINARY(1025),*/ '3333 minus 3',
|
|
|
|
/*f35 VARCHAR(257),*/ 'three times three'
|
|
|
|
),
|
|
|
|
(1, 1, 5, 'fifth',
|
|
|
|
/* f5 BIGINT, */ 333333333333333333333333,
|
|
|
|
/* f6 BLOB, */ '3333333333333333333333',
|
|
|
|
/* f7 DATE, */ '2007-07-18',
|
|
|
|
/* f8 DATETIME, */ "2007-07-18",
|
|
|
|
/* f9 FLOAT, */ 3.33333333,
|
|
|
|
/* f10 INT, */ 333333333,
|
|
|
|
/* f11 LONGBLOB, */ '3333333333333333333',
|
|
|
|
/* f12 LONGTEXT, */ '3333333333333333333',
|
|
|
|
/* f13 MEDIUMBLOB, */ '3333333333333333333',
|
|
|
|
/* f14 MEDIUMINT, */ 33,
|
|
|
|
/* f15 MEDIUMTEXT, */ 3.3,
|
|
|
|
/* f16 REAL, */ 3.3,
|
|
|
|
/* f17 SMALLINT, */ 3,
|
|
|
|
/* f18 TEXT, */ '33',
|
|
|
|
/* f19 TIME, */ '2:59:58.999',
|
|
|
|
/* f20 TIMESTAMP, */ 20000303000000,
|
|
|
|
/* f21 TINYBLOB, */ '3333',
|
|
|
|
/* f22 TINYINT, */ 3,
|
|
|
|
/* f23 TINYTEXT, */ '3',
|
|
|
|
/* f24 YEAR, */ 3000,
|
|
|
|
/* f25 BINARY(255), */ 'three_33333',
|
|
|
|
/* f26 BIT(64), */ b'011',
|
|
|
|
/* f27 CHAR(255), */ 'three',
|
|
|
|
/* f28 DECIMAL(30,7), */ 3.333,
|
|
|
|
/* f29 DOUBLE, */ 3.333333333333333333333333333,
|
|
|
|
/* f30 ENUM ('a','b','c')*/ 'c',
|
|
|
|
/* f31 FLOAT, */ 3.0,
|
|
|
|
/* f32 NUMERIC(17,9), */ 3.3333,
|
|
|
|
/* f33 SET ('a','b','c'),*/ 'c',
|
|
|
|
/*f34 VARBINARY(1025),*/ '3333 minus 3',
|
|
|
|
/*f35 VARCHAR(257),*/ 'three times three'
|
|
|
|
),
|
|
|
|
(1, 1, 6, 'sixth',
|
|
|
|
/* f5 BIGINT, */ NULL,
|
|
|
|
/* f6 BLOB, */ '3333333333333333333333',
|
|
|
|
/* f7 DATE, */ '2007-07-18',
|
|
|
|
/* f8 DATETIME, */ "2007-07-18",
|
|
|
|
/* f9 FLOAT, */ 3.33333333,
|
|
|
|
/* f10 INT, */ 333333333,
|
|
|
|
/* f11 LONGBLOB, */ '3333333333333333333',
|
|
|
|
/* f12 LONGTEXT, */ '3333333333333333333',
|
|
|
|
/* f13 MEDIUMBLOB, */ '3333333333333333333',
|
|
|
|
/* f14 MEDIUMINT, */ 33,
|
|
|
|
/* f15 MEDIUMTEXT, */ 3.3,
|
|
|
|
/* f16 REAL, */ 3.3,
|
|
|
|
/* f17 SMALLINT, */ 3,
|
|
|
|
/* f18 TEXT, */ '33',
|
|
|
|
/* f19 TIME, */ '2:59:58.999',
|
|
|
|
/* f20 TIMESTAMP, */ 20000303000000,
|
|
|
|
/* f21 TINYBLOB, */ '3333',
|
|
|
|
/* f22 TINYINT, */ 3,
|
|
|
|
/* f23 TINYTEXT, */ '3',
|
|
|
|
/* f24 YEAR, */ 3000,
|
|
|
|
/* f25 BINARY(255), */ 'three_33333',
|
|
|
|
/* f26 BIT(64), */ b'011',
|
|
|
|
/* f27 CHAR(255), */ 'three',
|
|
|
|
/* f28 DECIMAL(30,7), */ 3.333,
|
|
|
|
/* f29 DOUBLE, */ 3.333333333333333333333333333,
|
|
|
|
/* f30 ENUM ('a','b','c')*/ 'c',
|
|
|
|
/* f31 FLOAT, */ 3.0,
|
|
|
|
/* f32 NUMERIC(17,9), */ 3.3333,
|
|
|
|
/* f33 SET ('a','b','c'),*/ 'c',
|
|
|
|
/*f34 VARBINARY(1025),*/ '3333 minus 3',
|
|
|
|
/*f35 VARCHAR(257),*/ NULL
|
|
|
|
);
|
2007-10-10 16:43:20 +02:00
|
|
|
--echo
|
|
|
|
--echo ** Sync slave with master **
|
|
|
|
--echo ** Do selects from tables **
|
|
|
|
--echo
|
2007-07-30 00:10:42 +02:00
|
|
|
#connection slave;
|
|
|
|
sync_slave_with_master;
|
|
|
|
|
|
|
|
select * from t1 order by f3;
|
|
|
|
select * from t2 order by f1;
|
|
|
|
select * from t3 order by f1;
|
|
|
|
select * from t4 order by f1;
|
BUG#29549 (Endians: test failures on Solaris):
Refactoring code to add parameter to pack() and unpack() functions with
purpose of indicating if data should be packed in little-endian or
native order. Using new functions to always pack data for binary log
in little-endian order. The purpose of this refactoring is to allow
proper implementation of endian-agnostic pack() and unpack() functions.
Eliminating several versions of virtual pack() and unpack() functions
in favor for one single virtual function which is overridden in
subclasses.
Implementing pack() and unpack() functions for some field types that
packed data in native format regardless of the value of the
st_table_share::db_low_byte_first flag.
The field types that were packed in native format regardless are:
Field_real, Field_decimal, Field_tiny, Field_short, Field_medium,
Field_long, Field_longlong, and Field_blob.
Before the patch, row-based logging wrote the rows incorrectly on
big-endian machines where the storage engine defined its own
low_byte_first() to be FALSE on big-endian machines (the default
is TRUE), while little-endian machines wrote the fields in correct
order. The only known storage engine that does this is NDB. In effect,
this means that row-based replication from or to a big-endian
machine where the table was using NDB as storage engine failed if the
other engine was either non-NDB or on a little-endian machine.
With this patch, row-based logging is now always done in little-endian
order, while ORDER BY uses the native order if the storage engine
defines low_byte_first() to return FALSE for big-endian machines.
In addition, the max_data_length() function available in Field_blob
was generalized to the entire Field hierarchy to give the maximum
number of bytes that Field::pack() will write.
mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test:
Sorting by columns that produces deterministic order.
mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result:
Result change.
mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result:
Result change.
mysql-test/suite/rpl/r/rpl_row_extraColmaster_ndb.result:
Result change.
mysql-test/suite/rpl/t/disabled.def:
Enabling tests.
mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test:
Adding missing sync_slave_with_master causing slave to keep tables
after shutdown.
mysql-test/suite/rpl_ndb/t/disabled.def:
Enabling tests.
mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt:
Adding --new option
mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test:
Adding have_log_bin.
mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt:
Adding --new option
mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test:
Adding have_log_bin
mysql-test/t/partition.test:
Adding have_archive, since that is used in the test.
sql/field.cc:
Eliminating all two-argument pack() and unpack() functions and moving
functionality into the four-argument version. The four argument version
is introduced so that it is possible to avoid using the storage engine
default when writing and reading the packed format (the unpacked format
still uses the storage engine's default). This is used by row-based
replication to write the fields in a storage engine- and endian-agnostic
format.
Packing integral and floating-point numbers in little-endian format
(if requested).
Using pad_char for the field instead of spaces (0x20) when unpacking.
Adding some Doxygen documentation.
---
Adding max_data_length() to denote the maximum number of bytes that
pack() will write.
Adding casts to remove warnings for debug printouts.
sql/field.h:
Eliminating all virtual pack() and unpack() functions except the four-
argument version, which now is the function that shall be overridden.
The two-argument versions are convenience functions, to prevent changes
to code that uses these.
Adding code to pack integer numbers and floating-point numbers in
little-endian format, if requested.
---
Adding max_data_length() to denote the maximum number of bytes that
pack() will write.
sql/log.cc:
Removing debug printout causing crash when starting NDB on Solaris.
sql/log_event.cc:
Adding missing #ifndef causing compile failure. Adding debug printouts.
sql/rpl_record.cc:
Debriding code. Using new pack() and unpack() functions to always pack
fields little-endian. Adding debug printouts.
---
Using max_data_length() when packing field into row.
Adding casts to debug printouts.
sql/sql_show.cc:
Adding code that causes crash on Solaris machines since printf() cannot
handle NULL values for strings properly.
mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result:
New BitKeeper file ``mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result''
mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result:
New BitKeeper file ``mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result''
2007-10-11 18:18:05 +02:00
|
|
|
select * from t31 order by f3;
|
2007-07-30 00:10:42 +02:00
|
|
|
|
|
|
|
connection master;
|
2007-10-10 16:43:20 +02:00
|
|
|
--echo
|
|
|
|
--echo ** Do updates master **
|
|
|
|
--echo
|
2007-07-30 00:10:42 +02:00
|
|
|
update t31 set f5=555555555555555 where f3=6;
|
|
|
|
update t31 set f2=2 where f3=2;
|
|
|
|
update t31 set f1=NULL where f3=1;
|
2008-01-11 02:06:08 +01:00
|
|
|
update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
|
2007-07-30 00:10:42 +02:00
|
|
|
|
2007-10-10 16:43:20 +02:00
|
|
|
--echo
|
|
|
|
--echo ** Delete from Master **
|
|
|
|
--echo
|
|
|
|
|
2007-07-30 00:10:42 +02:00
|
|
|
delete from t1;
|
|
|
|
delete from t2;
|
|
|
|
delete from t3;
|
|
|
|
delete from t4;
|
|
|
|
delete from t31;
|
|
|
|
|
2007-10-10 16:43:20 +02:00
|
|
|
--echo
|
|
|
|
--echo ** Check slave status **
|
|
|
|
--echo
|
2007-07-30 00:10:42 +02:00
|
|
|
#connection slave;
|
|
|
|
sync_slave_with_master;
|
|
|
|
select * from t31;
|
|
|
|
|
|
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
2007-10-10 16:43:20 +02:00
|
|
|
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
|
2007-07-30 00:10:42 +02:00
|
|
|
--query_vertical show slave status;
|
|
|
|
|
|
|
|
#### Clean Up ####
|
|
|
|
|
|
|
|
connection master;
|
|
|
|
--disable_warnings
|
|
|
|
--disable_query_log
|
|
|
|
DROP TABLE t1,t2,t3,t4,t31;
|
|
|
|
|
2007-10-10 16:43:20 +02:00
|
|
|
######################################################
|
2007-07-30 00:10:42 +02:00
|
|
|
#connection slave;
|
|
|
|
sync_slave_with_master;
|
|
|
|
--enable_query_log
|
|
|
|
--enable_warnings
|
2007-10-10 16:43:20 +02:00
|
|
|
--echo
|
|
|
|
--echo ****************************************
|
|
|
|
--echo * columns in master at middle of table *
|
|
|
|
--echo * Expect: Proper error message *
|
|
|
|
--echo ****************************************
|
|
|
|
--echo
|
|
|
|
--echo ** Stop and Reset Slave **
|
|
|
|
--echo
|
|
|
|
STOP SLAVE;
|
|
|
|
RESET SLAVE;
|
|
|
|
--echo
|
|
|
|
--echo ** create table slave side **
|
|
|
|
eval CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
|
|
|
|
) ENGINE=$engine_type;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo ** Connect to master and create table **
|
|
|
|
--echo
|
|
|
|
--connection master
|
|
|
|
eval CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
|
|
|
|
c CHAR(5), e INT DEFAULT '1')ENGINE=$engine_type;
|
|
|
|
RESET MASTER;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Start Slave ***
|
|
|
|
connection slave;
|
|
|
|
START SLAVE;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Master Data Insert ***
|
|
|
|
connection master;
|
|
|
|
set @b1 = 'b1b1b1b1';
|
|
|
|
set @b1 = concat(@b1,@b1);
|
|
|
|
INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
|
|
|
|
(2,@b1,DEFAULT,'JOE',DEFAULT),
|
|
|
|
(3,@b1,DEFAULT,'QA',DEFAULT);
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo ********************************************
|
|
|
|
--echo *** Expect slave to fail with Error 1523 ***
|
|
|
|
--echo ********************************************
|
|
|
|
--echo
|
|
|
|
connection slave;
|
|
|
|
wait_for_slave_to_stop;
|
|
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
|
|
|
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
|
|
|
|
--query_vertical SHOW SLAVE STATUS
|
|
|
|
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
|
|
|
START SLAVE;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Drop t10 ***
|
|
|
|
connection master;
|
|
|
|
DROP TABLE t10;
|
|
|
|
sync_slave_with_master;
|
|
|
|
|
|
|
|
############################################
|
|
|
|
############## Continued ###################
|
|
|
|
############################################
|
|
|
|
--echo
|
|
|
|
--echo *********************************************
|
|
|
|
--echo * More columns in master at middle of table *
|
|
|
|
--echo * Expect: Proper error message *
|
|
|
|
--echo *********************************************
|
|
|
|
--echo
|
|
|
|
--echo *** Create t11 on slave ***
|
|
|
|
STOP SLAVE;
|
|
|
|
RESET SLAVE;
|
|
|
|
|
|
|
|
eval CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
|
|
|
|
) ENGINE=$engine_type;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Create t11 on Master ***
|
|
|
|
connection master;
|
|
|
|
eval CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
|
|
|
|
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
|
|
|
|
|
|
|
|
RESET MASTER;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Start Slave ***
|
|
|
|
connection slave;
|
|
|
|
START SLAVE;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Master Data Insert ***
|
|
|
|
connection master;
|
|
|
|
set @b1 = 'b1b1b1b1';
|
|
|
|
set @b1 = concat(@b1,@b1);
|
|
|
|
INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
|
|
|
|
(2,@b1,'Testing is cool','JOE',DEFAULT),
|
|
|
|
(3,@b1,DEFAULT,'QA',DEFAULT);
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo ********************************************
|
|
|
|
--echo *** Expect slave to fail with Error 1523 ***
|
|
|
|
--echo ********************************************
|
|
|
|
--echo
|
|
|
|
connection slave;
|
|
|
|
wait_for_slave_to_stop;
|
|
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
|
|
|
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
|
|
|
|
--query_vertical SHOW SLAVE STATUS
|
|
|
|
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
|
|
|
START SLAVE;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Drop t11 ***
|
|
|
|
connection master;
|
|
|
|
DROP TABLE t11;
|
|
|
|
sync_slave_with_master;
|
|
|
|
|
|
|
|
############################################
|
|
|
|
############## Continued ###################
|
|
|
|
############################################
|
|
|
|
--echo
|
|
|
|
--echo *********************************************
|
|
|
|
--echo * More columns in master at middle of table *
|
|
|
|
--echo * Expect: This one should pass blob-text *
|
|
|
|
--echo *********************************************
|
|
|
|
--echo
|
|
|
|
--echo *** Create t12 on slave ***
|
|
|
|
STOP SLAVE;
|
|
|
|
RESET SLAVE;
|
|
|
|
eval CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
|
|
|
|
) ENGINE=$engine_type;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Create t12 on Master ***
|
|
|
|
connection master;
|
|
|
|
eval CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
|
|
|
|
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
|
|
|
|
|
|
|
|
RESET MASTER;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Start Slave ***
|
|
|
|
connection slave;
|
|
|
|
START SLAVE;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Master Data Insert ***
|
|
|
|
connection master;
|
|
|
|
set @b1 = 'b1b1b1b1';
|
|
|
|
set @b1 = concat(@b1,@b1);
|
|
|
|
INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
|
|
|
|
(2,@b1,'JOE',DEFAULT,DEFAULT),
|
|
|
|
(3,@b1,'QA',DEFAULT,DEFAULT);
|
|
|
|
--echo
|
|
|
|
SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Select on Slave ***
|
|
|
|
sync_slave_with_master;
|
|
|
|
SELECT a,hex(b),c FROM t12 ORDER BY a;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Drop t12 ***
|
|
|
|
connection master;
|
|
|
|
DROP TABLE t12;
|
|
|
|
sync_slave_with_master;
|
|
|
|
|
|
|
|
############################################
|
|
|
|
############## Continued ###################
|
|
|
|
############################################
|
|
|
|
--echo
|
|
|
|
--echo ****************************************************
|
|
|
|
--echo * - Alter Master adding columns at middle of table *
|
|
|
|
--echo * Expect: columns added *
|
|
|
|
--echo ****************************************************
|
|
|
|
--echo
|
|
|
|
--echo
|
|
|
|
--echo *** Create t14 on slave ***
|
|
|
|
STOP SLAVE;
|
|
|
|
RESET SLAVE;
|
|
|
|
eval CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
|
|
|
|
) ENGINE=$engine_type;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Create t14 on Master ***
|
|
|
|
connection master;
|
|
|
|
eval CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
|
|
|
|
c6 INT DEFAULT '1',
|
|
|
|
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
|
|
|
)ENGINE=$engine_type;
|
|
|
|
|
|
|
|
RESET MASTER;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Start Slave ***
|
|
|
|
connection slave;
|
|
|
|
START SLAVE;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Master Data Insert ***
|
|
|
|
connection master;
|
|
|
|
ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
|
|
|
|
ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
|
|
|
|
--echo
|
|
|
|
set @b1 = 'b1b1b1b1';
|
|
|
|
set @b1 = concat(@b1,@b1);
|
|
|
|
INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT),
|
|
|
|
(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
|
|
|
|
(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
|
|
|
|
--echo
|
|
|
|
--replace_column 7 CURRENT_TIMESTAMP
|
|
|
|
SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Select on Slave ****
|
|
|
|
sync_slave_with_master;
|
|
|
|
SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
|
|
|
|
|
|
|
|
####################################################
|
|
|
|
--echo
|
|
|
|
--echo ****************************************************
|
|
|
|
--echo * - Alter Master Dropping columns from the middle. *
|
|
|
|
--echo * Expect: columns dropped *
|
|
|
|
--echo ****************************************************
|
|
|
|
--echo
|
|
|
|
--echo *** connect to master and drop columns ***
|
|
|
|
connection master;
|
|
|
|
ALTER TABLE t14 DROP COLUMN c2;
|
|
|
|
ALTER TABLE t14 DROP COLUMN c7;
|
|
|
|
--echo
|
|
|
|
--echo *** Select from Master ***
|
|
|
|
SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
|
|
|
|
--echo
|
|
|
|
|
|
|
|
--echo ************
|
|
|
|
--echo * Bug30415 *
|
|
|
|
--echo ************
|
|
|
|
# Uncomment below once fixed
|
|
|
|
|
|
|
|
#--echo *** Select from Slave ***
|
|
|
|
#sync_slave_with_master;
|
|
|
|
#SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
|
|
|
|
|
|
|
|
# Bug30415
|
|
|
|
# Remove below once fixed
|
|
|
|
#***************************
|
|
|
|
connection slave;
|
|
|
|
wait_for_slave_to_stop;
|
|
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
|
|
|
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
|
|
|
|
--query_vertical SHOW SLAVE STATUS
|
|
|
|
#***************************
|
|
|
|
|
|
|
|
STOP SLAVE;
|
|
|
|
RESET SLAVE;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Drop t14 ***
|
|
|
|
DROP TABLE t14;
|
|
|
|
|
|
|
|
connection master;
|
|
|
|
DROP TABLE t14;
|
|
|
|
RESET MASTER;
|
|
|
|
|
|
|
|
connection slave;
|
|
|
|
START SLAVE;
|
|
|
|
|
|
|
|
#################################################
|
|
|
|
--echo
|
|
|
|
--echo *************************************************
|
|
|
|
--echo * - Alter Master adding columns at end of table *
|
|
|
|
--echo * Expect: Error 1054 *
|
|
|
|
--echo *************************************************
|
|
|
|
--echo
|
|
|
|
--echo *** Create t15 on slave ***
|
|
|
|
STOP SLAVE;
|
|
|
|
RESET SLAVE;
|
|
|
|
eval CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
|
|
|
|
) ENGINE=$engine_type;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Create t15 on Master ***
|
|
|
|
connection master;
|
|
|
|
eval CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
|
|
|
|
c6 INT DEFAULT '1',
|
|
|
|
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
|
|
|
)ENGINE=$engine_type;
|
|
|
|
|
|
|
|
RESET MASTER;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Start Slave ***
|
|
|
|
connection slave;
|
|
|
|
START SLAVE;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Master Data Insert ***
|
|
|
|
connection master;
|
|
|
|
ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
|
|
|
|
set @b1 = 'b1b1b1b1';
|
|
|
|
set @b1 = concat(@b1,@b1);
|
|
|
|
INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
|
|
|
|
(2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
|
|
|
|
(3,@b1,'QA',DEFAULT,DEFAULT,3.00);
|
|
|
|
--replace_column 5 CURRENT_TIMESTAMP
|
|
|
|
SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo ********************************************
|
|
|
|
--echo *** Expect slave to fail with Error 1054 ***
|
|
|
|
--echo ********************************************
|
|
|
|
--echo
|
|
|
|
connection slave;
|
|
|
|
wait_for_slave_to_stop;
|
|
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
|
|
|
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
|
|
|
|
--query_vertical SHOW SLAVE STATUS
|
|
|
|
STOP SLAVE;
|
|
|
|
RESET SLAVE;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Drop t15 ***
|
|
|
|
DROP TABLE t15;
|
|
|
|
|
|
|
|
connection master;
|
|
|
|
DROP TABLE t15;
|
|
|
|
RESET MASTER;
|
|
|
|
|
|
|
|
connection slave;
|
|
|
|
START SLAVE;
|
|
|
|
|
|
|
|
####################################################
|
|
|
|
--echo
|
|
|
|
--echo ************************************************
|
|
|
|
--echo * - Create index on Master column not on slave *
|
|
|
|
--echo * Expect:Warning *
|
|
|
|
--echo ************************************************
|
|
|
|
--echo
|
|
|
|
--echo *** Create t16 on slave ***
|
|
|
|
STOP SLAVE;
|
|
|
|
RESET SLAVE;
|
|
|
|
eval CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
|
|
|
|
) ENGINE=$engine_type;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Create t16 on Master ***
|
|
|
|
connection master;
|
|
|
|
eval CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
|
|
|
|
c6 INT DEFAULT '1',
|
|
|
|
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
|
|
|
)ENGINE=$engine_type;
|
|
|
|
|
|
|
|
RESET MASTER;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Start Slave ***
|
|
|
|
connection slave;
|
|
|
|
START SLAVE;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Master Create Index and Data Insert ***
|
|
|
|
connection master;
|
|
|
|
CREATE INDEX part_of_c6 ON t16 (c6);
|
|
|
|
set @b1 = 'b1b1b1b1';
|
|
|
|
set @b1 = concat(@b1,@b1);
|
|
|
|
INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
|
|
|
|
(2,@b1,'JOE',2,DEFAULT),
|
|
|
|
(3,@b1,'QA',3,DEFAULT);
|
|
|
|
--replace_column 5 CURRENT_TIMESTAMP
|
|
|
|
SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
|
|
|
|
|
|
|
|
# Uncomment the below when bug 30434 is patched
|
|
|
|
|
|
|
|
#--echo *** Select on Slave ****
|
|
|
|
#sync_slave_with_master;
|
|
|
|
#SELECT c1,hex(c4),c5 FROM t16 ORDER BY c1;
|
|
|
|
#
|
|
|
|
#--echo *** Drop t16 ***
|
|
|
|
#connection master;
|
|
|
|
#DROP TABLE t16;
|
|
|
|
#sync_slave_with_master;
|
|
|
|
|
|
|
|
# Remove the below when bug 30434 is patched
|
|
|
|
#*******************************************
|
|
|
|
--echo
|
|
|
|
--echo *****************
|
|
|
|
--echo *** BUG 30434 ***
|
|
|
|
--echo *****************
|
|
|
|
--echo
|
|
|
|
connection slave;
|
|
|
|
wait_for_slave_to_stop;
|
|
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
|
|
|
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
|
|
|
|
--query_vertical SHOW SLAVE STATUS
|
|
|
|
STOP SLAVE;
|
|
|
|
RESET SLAVE;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Drop t16 ***
|
|
|
|
DROP TABLE t16;
|
|
|
|
|
|
|
|
connection master;
|
|
|
|
DROP TABLE t16;
|
|
|
|
RESET MASTER;
|
|
|
|
|
|
|
|
connection slave;
|
|
|
|
START SLAVE;
|
|
|
|
#*******************************************
|
|
|
|
|
|
|
|
####################################################
|
|
|
|
--echo
|
|
|
|
--echo *****************************************************
|
|
|
|
--echo * - Delete rows using column on Master not on slave *
|
|
|
|
--echo * Expect: Rows Deleted *
|
|
|
|
--echo *****************************************************
|
|
|
|
--echo
|
|
|
|
--echo *** Create t17 on slave ***
|
|
|
|
STOP SLAVE;
|
|
|
|
RESET SLAVE;
|
|
|
|
eval CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
|
|
|
|
) ENGINE=$engine_type;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Create t17 on Master ***
|
|
|
|
connection master;
|
|
|
|
eval CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
|
|
|
|
c6 INT DEFAULT '1',
|
|
|
|
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
|
|
|
)ENGINE=$engine_type;
|
|
|
|
|
|
|
|
RESET MASTER;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Start Slave ***
|
|
|
|
connection slave;
|
|
|
|
START SLAVE;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Master Data Insert ***
|
|
|
|
connection master;
|
|
|
|
set @b1 = 'b1b1b1b1';
|
|
|
|
set @b1 = concat(@b1,@b1);
|
|
|
|
INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
|
|
|
|
(2,@b1,'JOE',2,DEFAULT),
|
|
|
|
(3,@b1,'QA',3,DEFAULT);
|
|
|
|
--replace_column 5 CURRENT_TIMESTAMP
|
|
|
|
SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo ** Select * from Slave **
|
|
|
|
sync_slave_with_master;
|
|
|
|
SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo ** Delete from master **
|
|
|
|
connection master;
|
|
|
|
DELETE FROM t17 WHERE c6 = 3;
|
|
|
|
--replace_column 5 CURRENT_TIMESTAMP
|
|
|
|
SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo ** Check slave **
|
|
|
|
sync_slave_with_master;
|
|
|
|
SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
|
|
|
|
|
|
|
|
|
|
|
|
connection master;
|
|
|
|
DROP TABLE t17;
|
|
|
|
sync_slave_with_master;
|
|
|
|
--echo
|
|
|
|
|
|
|
|
####################################################
|
|
|
|
--echo
|
|
|
|
--echo *****************************************************
|
|
|
|
--echo * - Update row using column on Master not on slave *
|
|
|
|
--echo * Expect: Rows updated *
|
|
|
|
--echo *****************************************************
|
|
|
|
--echo
|
|
|
|
--echo ** Bug30674 **
|
|
|
|
--echo
|
|
|
|
--echo *** Create t18 on slave ***
|
|
|
|
--echo
|
|
|
|
|
|
|
|
STOP SLAVE;
|
|
|
|
RESET SLAVE;
|
|
|
|
eval CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
|
|
|
|
) ENGINE=$engine_type;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Create t18 on Master ***
|
|
|
|
connection master;
|
|
|
|
eval CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
|
|
|
|
c6 INT DEFAULT '1',
|
|
|
|
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
|
|
|
)ENGINE=$engine_type;
|
|
|
|
|
|
|
|
RESET MASTER;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Start Slave ***
|
|
|
|
connection slave;
|
|
|
|
START SLAVE;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Master Data Insert ***
|
|
|
|
connection master;
|
|
|
|
set @b1 = 'b1b1b1b1';
|
|
|
|
set @b1 = concat(@b1,@b1);
|
|
|
|
|
|
|
|
INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
|
|
|
|
(2,@b1,'JOE',2,DEFAULT),
|
|
|
|
(3,@b1,'QA',3,DEFAULT);
|
|
|
|
--replace_column 5 CURRENT_TIMESTAMP
|
|
|
|
SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo ** Select * from Slave **
|
|
|
|
sync_slave_with_master;
|
|
|
|
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo ** update from master **
|
|
|
|
connection master;
|
2007-12-10 13:29:23 +01:00
|
|
|
UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
|
2007-10-10 16:43:20 +02:00
|
|
|
|
|
|
|
--replace_column 5 CURRENT_TIMESTAMP
|
|
|
|
SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo ** Check slave **
|
|
|
|
sync_slave_with_master;
|
|
|
|
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
|
|
|
|
|
|
|
|
connection master;
|
|
|
|
DROP TABLE t18;
|
|
|
|
sync_slave_with_master;
|
|
|
|
--echo
|
|
|
|
|
|
|
|
####################################################
|
|
|
|
--echo
|
|
|
|
--echo *****************************************************
|
|
|
|
--echo * - Insert UUID column on Master not on slave *
|
|
|
|
--echo * Expect: Rows inserted *
|
|
|
|
--echo *****************************************************
|
|
|
|
--echo
|
|
|
|
--echo *** Create t5 on slave ***
|
|
|
|
STOP SLAVE;
|
|
|
|
RESET SLAVE;
|
|
|
|
eval CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
|
|
|
|
) ENGINE=$engine_type;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Create t5 on Master ***
|
|
|
|
connection master;
|
|
|
|
eval CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
|
|
|
|
c6 LONG,
|
|
|
|
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
|
|
|
|
)ENGINE=$engine_type;
|
|
|
|
|
|
|
|
RESET MASTER;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Start Slave ***
|
|
|
|
connection slave;
|
|
|
|
START SLAVE;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo *** Master Data Insert ***
|
|
|
|
connection master;
|
|
|
|
set @b1 = 'b1b1b1b1';
|
|
|
|
INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
|
|
|
|
(2,@b1,'JOE',UUID(),DEFAULT),
|
|
|
|
(3,@b1,'QA',UUID(),DEFAULT);
|
|
|
|
--replace_column 4 UUID 5 TIME
|
|
|
|
SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
|
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo ** Select * from Slave **
|
|
|
|
sync_slave_with_master;
|
|
|
|
SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
|
|
|
|
|
|
|
|
connection master;
|
|
|
|
DROP TABLE t5;
|
|
|
|
sync_slave_with_master;
|
|
|
|
--echo
|
2007-07-30 00:10:42 +02:00
|
|
|
|
2007-10-10 16:43:20 +02:00
|
|
|
# END of 5.1 tests case
|
2007-07-30 00:10:42 +02:00
|
|
|
|
|
|
|
|