mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge of 5.1-main into 5.1-maria. There were no changes to storage/myisam, or mysql-test/t/*myisam*.
However there were three new tests mysql-test/suite/parts/t/partition*myisam.test, of which I make here copies for Maria.
This commit is contained in:
@ -20,7 +20,7 @@
|
||||
|
||||
eval create table t1 (a int) engine=$engine_type;
|
||||
flush tables;
|
||||
system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
|
||||
remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
|
||||
drop table if exists t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
|
32
mysql-test/extra/rpl_tests/rpl_blackhole.test
Normal file
32
mysql-test/extra/rpl_tests/rpl_blackhole.test
Normal file
@ -0,0 +1,32 @@
|
||||
# Check replication of one statement assuming that the engine on the
|
||||
# slave is a blackhole engine.
|
||||
|
||||
# Input:
|
||||
# $statement Statement to evaluate, it is assumed to change t1
|
||||
|
||||
# 1. Evaluate statement on master, it is assumed to change t1
|
||||
# 2. Wait for statement to be processed on slave
|
||||
# 3. SELECT from table t1 to see what was written
|
||||
# 4. Compare position on slave before executing statement and after
|
||||
# executing statement. If difference is >0, then something was
|
||||
# written to the binary log on the slave.
|
||||
|
||||
connection slave;
|
||||
let $before = query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
|
||||
--echo [on master]
|
||||
connection master;
|
||||
eval $statement;
|
||||
|
||||
--echo [on slave]
|
||||
sync_slave_with_master;
|
||||
--echo # Expect 0
|
||||
SELECT COUNT(*) FROM t1;
|
||||
let $after = query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
let $something_written = `select $after - $before != 0`;
|
||||
if ($something_written) {
|
||||
--echo >>> Something was written to binary log <<<
|
||||
}
|
||||
if (!$something_written) {
|
||||
--echo >>> Nothing was written to binary log <<<
|
||||
}
|
@ -442,8 +442,6 @@ SELECT f1();
|
||||
INSERT INTO t1 VALUES (NULL, f2()), (NULL, LAST_INSERT_ID()),
|
||||
(NULL, LAST_INSERT_ID()), (NULL, f2()), (NULL, f2());
|
||||
INSERT INTO t1 VALUES (NULL, f2());
|
||||
INSERT INTO t1 VALUES (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID(5)),
|
||||
(NULL, @@LAST_INSERT_ID);
|
||||
# Test replication of substitution "IS NULL" -> "= LAST_INSERT_ID".
|
||||
INSERT INTO t1 VALUES (NULL, 0), (NULL, LAST_INSERT_ID());
|
||||
UPDATE t1 SET j= -1 WHERE i IS NULL;
|
||||
|
@ -471,3 +471,184 @@ source include/diff_tables.inc;
|
||||
connection master;
|
||||
drop table t1;
|
||||
sync_slave_with_master;
|
||||
|
||||
#
|
||||
# Bug #38230 Differences between master and slave after
|
||||
# UPDATE or DELETE with LIMIT with pk
|
||||
#
|
||||
# the regression test verifies consistency via selecting
|
||||
|
||||
--disable_abort_on_error
|
||||
|
||||
--connection master
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
|
||||
eval CREATE TABLE t1 (
|
||||
`pk` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`int_nokey` int(11) NOT NULL,
|
||||
`int_key` int(11) NOT NULL,
|
||||
`date_key` date NOT NULL,
|
||||
`date_nokey` date NOT NULL,
|
||||
`time_key` time NOT NULL,
|
||||
`time_nokey` time NOT NULL,
|
||||
`datetime_key` datetime NOT NULL,
|
||||
`datetime_nokey` datetime NOT NULL,
|
||||
`varchar_key` varchar(1) NOT NULL,
|
||||
`varchar_nokey` varchar(1) NOT NULL,
|
||||
PRIMARY KEY (`pk`),
|
||||
KEY `int_key` (`int_key`),
|
||||
KEY `date_key` (`date_key`),
|
||||
KEY `time_key` (`time_key`),
|
||||
KEY `datetime_key` (`datetime_key`),
|
||||
KEY `varchar_key` (`varchar_key`)
|
||||
) ENGINE=$type;
|
||||
|
||||
INSERT INTO t1 VALUES (1,8,5,'0000-00-00','0000-00-00','10:37:38','10:37:38','0000-00-00 00:00:00','0000-00-00 00:00:00','p','p'),(2,0,9,'0000-00-00','0000-00-00','00:00:00','00:00:00','2007-10-14 00:00:00','2007-10-14 00:00:00','d','d');
|
||||
|
||||
eval CREATE TABLE t2 (
|
||||
`pk` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`int_nokey` int(11) NOT NULL,
|
||||
`int_key` int(11) NOT NULL,
|
||||
`date_key` date NOT NULL,
|
||||
`date_nokey` date NOT NULL,
|
||||
`time_key` time NOT NULL,
|
||||
`time_nokey` time NOT NULL,
|
||||
`datetime_key` datetime NOT NULL,
|
||||
`datetime_nokey` datetime NOT NULL,
|
||||
`varchar_key` varchar(1) NOT NULL,
|
||||
`varchar_nokey` varchar(1) NOT NULL,
|
||||
PRIMARY KEY (`pk`),
|
||||
KEY `int_key` (`int_key`),
|
||||
KEY `date_key` (`date_key`),
|
||||
KEY `time_key` (`time_key`),
|
||||
KEY `datetime_key` (`datetime_key`),
|
||||
KEY `varchar_key` (`varchar_key`)
|
||||
) ENGINE=$type;
|
||||
|
||||
INSERT INTO t2 VALUES (1,1,6,'2005-12-23','2005-12-23','02:24:28','02:24:28','0000-00-00 00:00:00','0000-00-00 00:00:00','g','g'),(2,0,3,'2009-09-14','2009-09-14','00:00:00','00:00:00','2000-01-30 16:39:40','2000-01-30 16:39:40','q','q'),(3,0,3,'0000-00-00','0000-00-00','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','c','c'),(4,1,6,'2007-03-29','2007-03-29','15:49:00','15:49:00','0000-00-00 00:00:00','0000-00-00 00:00:00','m','m'),(5,4,0,'2002-12-04','2002-12-04','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','o','o'),(6,9,0,'2005-01-28','2005-01-28','00:00:00','00:00:00','2001-05-18 00:00:00','2001-05-18 00:00:00','w','w'),(7,6,0,'0000-00-00','0000-00-00','06:57:25','06:57:25','0000-00-00 00:00:00','0000-00-00 00:00:00','m','m'),(8,0,0,'0000-00-00','0000-00-00','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','z','z'),(9,4,6,'2006-08-15','2006-08-15','00:00:00','00:00:00','2002-04-12 14:44:25','2002-04-12 14:44:25','j','j'),(10,0,5,'2006-12-20','2006-12-20','10:13:53','10:13:53','2008-07-22 00:00:00','2008-07-22 00:00:00','y','y'),(11,9,7,'0000-00-00','0000-00-00','00:00:00','00:00:00','2004-07-05 00:00:00','2004-07-05 00:00:00','{','{'),(12,4,3,'2007-01-26','2007-01-26','23:00:51','23:00:51','2001-05-16 00:00:00','2001-05-16 00:00:00','f','f'),(13,7,0,'2004-03-27','2004-03-27','00:00:00','00:00:00','2005-01-24 03:30:37','2005-01-24 03:30:37','',''),(14,6,0,'2006-07-26','2006-07-26','18:43:57','18:43:57','0000-00-00 00:00:00','0000-00-00 00:00:00','{','{'),(15,0,6,'2000-01-14','2000-01-14','00:00:00','00:00:00','2000-09-21 00:00:00','2000-09-21 00:00:00','o','o'),(16,9,8,'0000-00-00','0000-00-00','21:15:08','21:15:08','0000-00-00 00:00:00','0000-00-00 00:00:00','a','a'),(17,2,0,'2004-10-27','2004-10-27','00:00:00','00:00:00','2004-03-24 22:13:43','2004-03-24 22:13:43','',''),(18,7,4,'0000-00-00','0000-00-00','08:38:27','08:38:27','2002-03-18 19:51:44','2002-03-18 19:51:44','t','t'),(19,5,3,'2008-03-07','2008-03-07','03:29:07','03:29:07','2007-12-01 18:44:44','2007-12-01 18:44:44','t','t'),(20,0,0,'2002-04-09','2002-04-09','16:06:03','16:06:03','2009-04-22 00:00:00','2009-04-22 00:00:00','n','n');
|
||||
|
||||
DELETE FROM t2 WHERE `int_key` < 3 LIMIT 1;
|
||||
UPDATE t1 SET `int_key` = 3 ORDER BY `pk` LIMIT 4;
|
||||
DELETE FROM t2 WHERE `int_key` < 3 LIMIT 1;
|
||||
DELETE FROM t2 WHERE `pk` < 6 LIMIT 1;
|
||||
UPDATE t1 SET `int_key` = 6 ORDER BY `pk` LIMIT 3;
|
||||
DELETE FROM t2 WHERE `pk` < 6 LIMIT 1;
|
||||
UPDATE t1 SET `pk` = 6 ORDER BY `int_key` LIMIT 6;
|
||||
DELETE FROM t2 WHERE `pk` < 7 LIMIT 1;
|
||||
UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
|
||||
|
||||
--sync_slave_with_master
|
||||
--echo *** results: t2 must be consistent ****
|
||||
|
||||
let $diff_table_1=master:test.t2;
|
||||
let $diff_table_2=master:test.t2;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
--connection master
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--enable_abort_on_error
|
||||
|
||||
--echo EOF OF TESTS
|
||||
|
||||
#
|
||||
# BUG#40004: Replication failure with no PK + no indexes
|
||||
#
|
||||
|
||||
# The test cases are taken from the bug report. It is difficult to
|
||||
# produce a test case that generates a HA_ERR_RECORD_DELETED, so we go
|
||||
# with the test cases we have.
|
||||
|
||||
connection master;
|
||||
|
||||
eval CREATE TABLE t1 (a int) ENGINE=$type;
|
||||
|
||||
INSERT IGNORE INTO t1 VALUES (NULL);
|
||||
INSERT INTO t1 ( a ) VALUES ( 0 );
|
||||
INSERT INTO t1 ( a ) VALUES ( 9 );
|
||||
INSERT INTO t1 ( a ) VALUES ( 2 );
|
||||
INSERT INTO t1 ( a ) VALUES ( 9 );
|
||||
INSERT INTO t1 ( a ) VALUES ( 5 );
|
||||
|
||||
UPDATE t1 SET a = 5 WHERE a = 9;
|
||||
DELETE FROM t1 WHERE a < 6;
|
||||
UPDATE t1 SET a = 9 WHERE a < 3;
|
||||
INSERT INTO t1 ( a ) VALUES ( 3 );
|
||||
UPDATE t1 SET a = 0 WHERE a < 4;
|
||||
UPDATE t1 SET a = 8 WHERE a < 5;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
let $diff_table_1=master:test.t1;
|
||||
let $diff_table_2=slave:test.t1;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
connection master;
|
||||
drop table t1;
|
||||
sync_slave_with_master;
|
||||
|
||||
#
|
||||
# Bug #39752: Replication failure on RBR + MyISAM + no PK
|
||||
#
|
||||
|
||||
# The test cases are taken from the bug report. It is difficult to
|
||||
# produce a test case that generates a HA_ERR_RECORD_DELETED, so we go
|
||||
# with the test cases we have.
|
||||
|
||||
connection master;
|
||||
|
||||
--disable_warnings
|
||||
eval CREATE TABLE t1 (a bit) ENGINE=$type;
|
||||
INSERT IGNORE INTO t1 VALUES (NULL);
|
||||
INSERT INTO t1 ( a ) VALUES ( 0 );
|
||||
UPDATE t1 SET a = 0 WHERE a = 1 LIMIT 3;
|
||||
INSERT INTO t1 ( a ) VALUES ( 5 );
|
||||
DELETE FROM t1 WHERE a < 2 LIMIT 4;
|
||||
DELETE FROM t1 WHERE a < 9 LIMIT 4;
|
||||
INSERT INTO t1 ( a ) VALUES ( 9 );
|
||||
UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
|
||||
INSERT INTO t1 ( a ) VALUES ( 8 );
|
||||
UPDATE t1 SET a = 0 WHERE a < 6 LIMIT 0;
|
||||
INSERT INTO t1 ( a ) VALUES ( 4 );
|
||||
INSERT INTO t1 ( a ) VALUES ( 3 );
|
||||
UPDATE t1 SET a = 0 WHERE a = 7 LIMIT 6;
|
||||
DELETE FROM t1 WHERE a = 4 LIMIT 7;
|
||||
UPDATE t1 SET a = 9 WHERE a < 2 LIMIT 9;
|
||||
UPDATE t1 SET a = 0 WHERE a < 9 LIMIT 2;
|
||||
DELETE FROM t1 WHERE a < 0 LIMIT 5;
|
||||
INSERT INTO t1 ( a ) VALUES ( 5 );
|
||||
UPDATE t1 SET a = 4 WHERE a < 6 LIMIT 4;
|
||||
INSERT INTO t1 ( a ) VALUES ( 5 );
|
||||
UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 8;
|
||||
DELETE FROM t1 WHERE a < 8 LIMIT 8;
|
||||
INSERT INTO t1 ( a ) VALUES ( 6 );
|
||||
DELETE FROM t1 WHERE a < 6 LIMIT 7;
|
||||
UPDATE t1 SET a = 7 WHERE a = 3 LIMIT 7;
|
||||
UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
|
||||
INSERT INTO t1 ( a ) VALUES ( 7 );
|
||||
DELETE FROM t1 WHERE a < 9 LIMIT 4;
|
||||
INSERT INTO t1 ( a ) VALUES ( 7 );
|
||||
INSERT INTO t1 ( a ) VALUES ( 6 );
|
||||
UPDATE t1 SET a = 8 WHERE a = 3 LIMIT 4;
|
||||
DELETE FROM t1 WHERE a = 2 LIMIT 9;
|
||||
DELETE FROM t1 WHERE a = 1 LIMIT 4;
|
||||
UPDATE t1 SET a = 4 WHERE a = 2 LIMIT 7;
|
||||
INSERT INTO t1 ( a ) VALUES ( 0 );
|
||||
DELETE FROM t1 WHERE a < 3 LIMIT 0;
|
||||
UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
|
||||
INSERT INTO t1 ( a ) VALUES ( 1 );
|
||||
UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
|
||||
--enable_warnings
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
let $diff_table_1=master:test.t1;
|
||||
let $diff_table_2=slave:test.t1;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
connection master;
|
||||
drop table t1;
|
||||
sync_slave_with_master;
|
||||
|
Reference in New Issue
Block a user