mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
merge
This commit is contained in:
@ -55,3 +55,8 @@ ordid ord
|
||||
2 sdj
|
||||
3 sdj
|
||||
1 zzz
|
||||
a
|
||||
0
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check warning Found row where the auto_increment column has the value 0
|
||||
test.t1 check status OK
|
||||
|
@ -511,3 +511,14 @@ id id3
|
||||
100 2
|
||||
KINMU_DATE
|
||||
KINMU_DATE
|
||||
a b
|
||||
1 1
|
||||
1 2
|
||||
a b a b
|
||||
1 1 1 1
|
||||
1 1 1 2
|
||||
1 2 1 1
|
||||
1 2 1 2
|
||||
a b
|
||||
1 1
|
||||
1 2
|
||||
|
@ -20,3 +20,6 @@ a b
|
||||
a b
|
||||
2 2
|
||||
3 4
|
||||
i
|
||||
2
|
||||
1
|
||||
|
@ -4,3 +4,7 @@ Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
Table Op Msg_type Msg_text
|
||||
test.t2 check error Table 't2' was not locked with LOCK TABLES
|
||||
n
|
||||
4
|
||||
n
|
||||
1
|
||||
|
4
mysql-test/r/rpl_mystery22.result
Normal file
4
mysql-test/r/rpl_mystery22.result
Normal file
@ -0,0 +1,4 @@
|
||||
n
|
||||
1
|
||||
2
|
||||
3
|
@ -1,7 +1,7 @@
|
||||
n
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
|
@ -64,3 +64,14 @@ create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null
|
||||
insert into t1 values (NULL,'sdj'),(NULL,'sdj'),(NULL,"abc"),(NULL,'abc'),(NULL,'zzz'),(NULL,'sdj'),(NULL,'abc');
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test of auto_increment columns when they are set to 0
|
||||
#
|
||||
|
||||
create table t1 (a int not null primary key auto_increment);
|
||||
insert into t1 values (0);
|
||||
update t1 set a=0;
|
||||
select * from t1;
|
||||
check table t1;
|
||||
drop table t1;
|
||||
|
@ -715,3 +715,18 @@ CREATE TABLE t2 ( SYAIN_NO char(5) NOT NULL default '',STR_DATE char(8) NOT NULL
|
||||
select T1.KINMU_DATE from t1 T1 ,t2 T2 where T1.SYAIN_NO = '12345' and T1.KINMU_DATE = '200106' and T2.SYAIN_NO = T1.SYAIN_NO;
|
||||
select T1.KINMU_DATE from t1 T1 ,t2 T2 where T1.SYAIN_NO = '12345' and T1.KINMU_DATE = '200106' and T2.SYAIN_NO = T1.SYAIN_NO;
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
#
|
||||
# Test problem with joining table to itself on a multi-part unique key
|
||||
#
|
||||
|
||||
drop table if exists t;
|
||||
create table t (a int(11) not null, b int(11) not null, unique (a,b)) type=bdb;
|
||||
|
||||
insert into t values (1,1), (1,2);
|
||||
|
||||
select * from t where a = 1;
|
||||
select t1.*, t2.* from t t1, t t2 where t1.a = t2.a and t2.a = 1;
|
||||
select * from t where a = 1;
|
||||
|
||||
drop table t;
|
||||
|
@ -17,3 +17,14 @@ select * from t1;
|
||||
delete from t1 limit 1;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
create table t1 (i int);
|
||||
insert into t1 (i) values(1);
|
||||
insert into t1 (i) values(1);
|
||||
insert into t1 (i) values(1);
|
||||
delete from t1 limit 1;
|
||||
update t1 set i=2 limit 1;
|
||||
delete from t1 limit 0;
|
||||
update t1 set i=3 limit 0;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
@ -53,3 +53,45 @@ lock tables t1 write;
|
||||
check table t2;
|
||||
unlock tables;
|
||||
drop table t1,t2;
|
||||
|
||||
#test to see if select will get the lock ahead of low priority update
|
||||
connect (locker,localhost,root,,);
|
||||
connect (reader,localhost,root,,);
|
||||
connect (writer,localhost,root,,);
|
||||
|
||||
connection locker;
|
||||
create table t1(n int);
|
||||
insert into t1 values (1);
|
||||
lock tables t1 write;
|
||||
connection writer;
|
||||
send update low_priority t1 set n = 4;
|
||||
connection reader;
|
||||
--sleep 2
|
||||
send select n from t1;
|
||||
connection locker;
|
||||
--sleep 2
|
||||
unlock tables;
|
||||
connection writer;
|
||||
reap;
|
||||
connection reader;
|
||||
reap;
|
||||
drop table t1;
|
||||
|
||||
connection locker;
|
||||
create table t1(n int);
|
||||
insert into t1 values (1);
|
||||
lock tables t1 read;
|
||||
connection writer;
|
||||
send update low_priority t1 set n = 4;
|
||||
connection reader;
|
||||
--sleep 2
|
||||
send select n from t1;
|
||||
connection locker;
|
||||
--sleep 2
|
||||
unlock tables;
|
||||
connection writer;
|
||||
reap;
|
||||
connection reader;
|
||||
reap;
|
||||
drop table t1;
|
||||
|
||||
|
43
mysql-test/t/rpl_mystery22.test
Normal file
43
mysql-test/t/rpl_mystery22.test
Normal file
@ -0,0 +1,43 @@
|
||||
# test case to make slave thread get ahead by 22 bytes
|
||||
|
||||
source include/master-slave.inc;
|
||||
connection master;
|
||||
# first, cause a duplicate key problem on the slave
|
||||
create table t1(n int auto_increment primary key);
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
insert into t1 values (2);
|
||||
connection master;
|
||||
insert into t1 values(NULL);
|
||||
insert into t1 values(NULL);
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sleep 1; # there is no way around this sleep - we have to wait until
|
||||
# the slave tries to run the query, fails and aborts slave thread
|
||||
delete from t1 where n = 2;
|
||||
slave start;
|
||||
sync_with_master;
|
||||
#now the buggy slave would be confused on the offset but it can replicate
|
||||
#in order to make it break, we need to stop/start the slave one more time
|
||||
slave stop;
|
||||
connection master;
|
||||
# to be able to really confuse the slave, we need some non-auto-increment
|
||||
# events in the log
|
||||
create table t2(n int);
|
||||
drop table t2;
|
||||
insert into t1 values(NULL);
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
slave start;
|
||||
#now the truth comes out - if the slave is buggy, it will never sync because
|
||||
#the slave thread is not able to read events
|
||||
sync_with_master;
|
||||
select * from t1;
|
||||
#clean up
|
||||
connection master;
|
||||
drop table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
|
@ -1,24 +1,33 @@
|
||||
#test to see if replication can continue when master sporadically fails on
|
||||
# test to see if replication can continue when master sporadically fails on
|
||||
# COM_BINLOG_DUMP and additionally limits the number of events per dump
|
||||
|
||||
source include/master-slave.inc;
|
||||
connection master;
|
||||
drop table if exists t1;
|
||||
drop table if exists t1,t2;
|
||||
create table t2(n int);
|
||||
create table t1(n int not null auto_increment primary key);
|
||||
insert into t1 values (NULL),(NULL);
|
||||
truncate table t1;
|
||||
insert into t1 values (NULL),(NULL);
|
||||
# We have to use 4 in the following to make this test work with all table types
|
||||
insert into t1 values (4),(NULL);
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
slave stop;
|
||||
slave start;
|
||||
connection master;
|
||||
insert into t1 values (NULL),(NULL);
|
||||
flush logs;
|
||||
truncate table t1;
|
||||
insert into t1 values (NULL),(NULL);
|
||||
insert into t1 values (NULL),(NULL);
|
||||
insert into t1 values (10),(NULL);
|
||||
insert into t1 values (NULL),(NULL)
|
||||
insert into t1 values (NULL),(NULL);
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
select * from t1;
|
||||
connection master;
|
||||
drop table t1;
|
||||
drop table t1,t2;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
|
Reference in New Issue
Block a user