mirror of
https://github.com/MariaDB/server.git
synced 2025-03-22 15:08:38 +01:00
Added test case for bug in replace with replication that existed in MySQL 5.1:
Replace with an auto_increment primary key and another unique key didn't replicate correctly with REPLACE
This commit is contained in:
parent
2d78ef1d3b
commit
b917fdb9f1
2 changed files with 46 additions and 0 deletions
mysql-test/suite/rpl
22
mysql-test/suite/rpl/r/replace.result
Normal file
22
mysql-test/suite/rpl/r/replace.result
Normal file
|
@ -0,0 +1,22 @@
|
|||
include/master-slave.inc
|
||||
[connection master]
|
||||
drop table if exists t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
CREATE TABLE t1 (pr_id int(10) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, pr_page int(11) NOT NULL, pr_type varbinary(60) NOT NULL, test int, UNIQUE KEY pr_pagetype (pr_page,pr_type)) ENGINE=myisam AUTO_INCREMENT=136;
|
||||
insert into t1 (pr_page, pr_type, test) values(1,"one",0),(2,"two",0);
|
||||
select * from t1;
|
||||
pr_id pr_page pr_type test
|
||||
136 1 one 0
|
||||
137 2 two 0
|
||||
replace into t1 (pr_page, pr_type,test) values(1,"one",2);
|
||||
select * from t1;
|
||||
pr_id pr_page pr_type test
|
||||
138 1 one 2
|
||||
137 2 two 0
|
||||
select * from t1;
|
||||
pr_id pr_page pr_type test
|
||||
138 1 one 2
|
||||
137 2 two 0
|
||||
drop table t1;
|
||||
include/rpl_end.inc
|
24
mysql-test/suite/rpl/t/replace.test
Normal file
24
mysql-test/suite/rpl/t/replace.test
Normal file
|
@ -0,0 +1,24 @@
|
|||
#
|
||||
# Test of REPLACE with replication
|
||||
#
|
||||
|
||||
source include/master-slave.inc;
|
||||
|
||||
#
|
||||
# Test of doing replace on unique key on table with auto_increment
|
||||
#
|
||||
|
||||
drop table if exists t1;
|
||||
CREATE TABLE t1 (pr_id int(10) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, pr_page int(11) NOT NULL, pr_type varbinary(60) NOT NULL, test int, UNIQUE KEY pr_pagetype (pr_page,pr_type)) ENGINE=myisam AUTO_INCREMENT=136;
|
||||
insert into t1 (pr_page, pr_type, test) values(1,"one",0),(2,"two",0);
|
||||
select * from t1;
|
||||
replace into t1 (pr_page, pr_type,test) values(1,"one",2);
|
||||
select * from t1;
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
select * from t1;
|
||||
connection master;
|
||||
drop table t1;
|
||||
|
||||
# End of 5.5 tests
|
||||
--source include/rpl_end.inc
|
Loading…
Add table
Reference in a new issue