mirror of
https://github.com/MariaDB/server.git
synced 2025-11-09 11:41:36 +03:00
Merge mysql.com:/home/pz/mysql/mysql-4.1-root
into mysql.com:/home/pz/mysql/mysql-4.1 BitKeeper/etc/logging_ok: auto-union include/mysql_com.h: Auto merged sql/item_strfunc.cc: Auto merged sql/item_strfunc.h: Auto merged sql/mysqld.cc: Auto merged sql/sql_yacc.yy: Auto merged
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
-- source include/have_bdb.inc
|
||||
|
||||
# test for bug reported by Mark Steele
|
||||
|
||||
drop table if exists t1;
|
||||
|
||||
@@ -12,11 +12,11 @@ select * from t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
slave stop;
|
||||
stop slave;
|
||||
connection master;
|
||||
set password for root@"localhost" = password('foo');
|
||||
connection slave;
|
||||
slave start;
|
||||
start slave;
|
||||
connection master;
|
||||
#
|
||||
# Give slave time to do at last one failed connect retry
|
||||
@@ -43,7 +43,7 @@ sync_with_master;
|
||||
connection master;
|
||||
reset master;
|
||||
connection slave;
|
||||
slave stop;
|
||||
stop slave;
|
||||
reset slave;
|
||||
|
||||
connection master;
|
||||
@@ -62,7 +62,7 @@ enable_query_log;
|
||||
# Try to cause a large relay log lag on the slave
|
||||
connection slave;
|
||||
select get_lock("hold_slave",10);
|
||||
slave start;
|
||||
start slave;
|
||||
#hope this is long enough for I/O thread to fetch over 16K relay log data
|
||||
sleep 3;
|
||||
select release_lock("hold_slave");
|
||||
@@ -100,7 +100,7 @@ wait_for_slave_to_stop;
|
||||
# show slave status;
|
||||
|
||||
set global sql_slave_skip_counter=1;
|
||||
slave start;
|
||||
start slave;
|
||||
select count(*) from t1;
|
||||
connection master1;
|
||||
drop table t1;
|
||||
|
||||
@@ -3,18 +3,14 @@ drop table if exists t1;
|
||||
create table t1 (n int auto_increment primary key);
|
||||
set insert_id = 2000;
|
||||
insert into t1 values (NULL),(NULL),(NULL);
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
select * from t1;
|
||||
connection master;
|
||||
--replace_result $SLAVE_MYPORT 9999
|
||||
show slave hosts;
|
||||
drop table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
slave stop;
|
||||
sync_slave_with_master;
|
||||
stop slave;
|
||||
connection master;
|
||||
drop table if exists t2;
|
||||
create table t2(id int auto_increment primary key, created datetime);
|
||||
@@ -23,11 +19,9 @@ insert into t2 set created=now();
|
||||
select * from t2;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
slave start;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
select * from t2;
|
||||
connection master;
|
||||
drop table t2;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
|
||||
@@ -2,20 +2,14 @@ source include/master-slave.inc;
|
||||
drop table if exists t1;
|
||||
create table t1 (n int);
|
||||
insert into t1 values(1);
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
slave stop;
|
||||
slave start;
|
||||
sync_slave_with_master;
|
||||
stop slave;
|
||||
start slave;
|
||||
connection master;
|
||||
insert into t1 values(2);
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
#let slave catch up
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
select * from t1;
|
||||
connection master;
|
||||
drop table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
|
||||
@@ -18,7 +18,7 @@ eval change master to master_host='127.0.0.1',master_user='root',
|
||||
master_password='',master_port=$MASTER_MYPORT;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
show slave status;
|
||||
slave start;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
show slave status;
|
||||
@@ -26,12 +26,8 @@ connection master;
|
||||
drop table if exists t1;
|
||||
create table t1 (n int);
|
||||
insert into t1 values (10),(45),(90);
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
select * from t1;
|
||||
connection master;
|
||||
drop table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
|
||||
@@ -5,17 +5,13 @@ reset master;
|
||||
grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
|
||||
grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
|
||||
connection slave;
|
||||
slave start;
|
||||
start slave;
|
||||
connection master;
|
||||
drop table if exists t1;
|
||||
create table t1(n int);
|
||||
insert into t1 values(24);
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
select * from t1;
|
||||
connection master;
|
||||
drop table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
|
||||
@@ -10,18 +10,14 @@ server_stop master;
|
||||
server_start master;
|
||||
connection slave;
|
||||
reset slave;
|
||||
slave start;
|
||||
start slave;
|
||||
connection master;
|
||||
show master logs;
|
||||
show binary logs;
|
||||
drop table if exists t1;
|
||||
create table t1(n int);
|
||||
insert into t1 values (3351);
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
select * from t1;
|
||||
connection master;
|
||||
drop table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
|
||||
@@ -7,18 +7,16 @@ show variables like 'rpl_recovery_rank';
|
||||
show status like 'Rpl_status';
|
||||
create table t1(n int);
|
||||
drop table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
show variables like 'rpl_recovery_rank';
|
||||
show status like 'Rpl_status';
|
||||
connection slave_sec;
|
||||
slave start;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
show variables like 'rpl_recovery_rank';
|
||||
show status like 'Rpl_status';
|
||||
connection slave_ter;
|
||||
slave start;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
show variables like 'rpl_recovery_rank';
|
||||
show status like 'Rpl_status';
|
||||
|
||||
@@ -7,13 +7,13 @@ connection slave;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
eval change master to master_host='127.0.0.1',master_user='root',
|
||||
master_password='',master_port=$MASTER_MYPORT;
|
||||
slave start;
|
||||
start slave;
|
||||
connection master;
|
||||
slave stop;
|
||||
stop slave;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval change master to master_host='127.0.0.1',master_user='root',
|
||||
master_password='',master_port=$SLAVE_MYPORT;
|
||||
slave start;
|
||||
start slave;
|
||||
flush logs;
|
||||
sleep 5;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
|
||||
@@ -2,7 +2,7 @@ source include/master-slave.inc;
|
||||
|
||||
#clean up slave binlogs
|
||||
connection slave;
|
||||
slave stop;
|
||||
stop slave;
|
||||
reset master;
|
||||
reset slave;
|
||||
let $VERSION=`select version()`;
|
||||
@@ -26,10 +26,10 @@ flush logs;
|
||||
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
slave start;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
flush logs;
|
||||
slave stop;
|
||||
stop slave;
|
||||
connection master;
|
||||
|
||||
# Create some entries for second log
|
||||
@@ -40,12 +40,12 @@ drop table t1;
|
||||
--replace_result $VERSION VERSION
|
||||
show binlog events;
|
||||
show binlog events in 'master-bin.002';
|
||||
show master logs;
|
||||
show binary logs;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
slave start;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
show master logs;
|
||||
show binary logs;
|
||||
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT $VERSION VERSION
|
||||
show binlog events in 'slave-bin.001' from 4;
|
||||
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT $VERSION VERSION
|
||||
|
||||
@@ -3,25 +3,23 @@
|
||||
#
|
||||
source include/master-slave.inc;
|
||||
show master status;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
|
||||
show slave status;
|
||||
change master to master_log_pos=73;
|
||||
sleep 5;
|
||||
slave stop;
|
||||
stop slave;
|
||||
|
||||
change master to master_log_pos=73;
|
||||
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
|
||||
show slave status;
|
||||
slave start;
|
||||
start slave;
|
||||
sleep 5;
|
||||
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
|
||||
show slave status;
|
||||
change master to master_log_pos=173;
|
||||
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
|
||||
slave start;
|
||||
start slave;
|
||||
sleep 2;
|
||||
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
|
||||
show slave status;
|
||||
@@ -34,11 +32,9 @@ insert into t1 values (1),(2),(3);
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
change master to master_log_pos=79;
|
||||
slave start;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
select * from t1;
|
||||
connection master;
|
||||
drop table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
|
||||
@@ -4,9 +4,7 @@ source include/master-slave.inc;
|
||||
|
||||
# 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;
|
||||
sync_slave_with_master;
|
||||
insert into t1 values (2);
|
||||
connection master;
|
||||
insert into t1 values(NULL);
|
||||
@@ -16,11 +14,11 @@ connection slave;
|
||||
sleep 3; # 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;
|
||||
start slave;
|
||||
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;
|
||||
stop slave;
|
||||
connection master;
|
||||
# to be able to really confuse the slave, we need some non-auto-increment
|
||||
# events in the log
|
||||
@@ -29,7 +27,7 @@ drop table t2;
|
||||
insert into t1 values(NULL);
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
slave start;
|
||||
start slave;
|
||||
#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;
|
||||
@@ -37,7 +35,5 @@ select * from t1;
|
||||
#clean up
|
||||
connection master;
|
||||
drop table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
|
||||
|
||||
@@ -15,10 +15,10 @@ system cat /dev/null > var/slave-data/master.info;
|
||||
system chmod 000 var/slave-data/master.info;
|
||||
connection slave;
|
||||
--error 1201
|
||||
slave start;
|
||||
start slave;
|
||||
system chmod 600 var/slave-data/master.info;
|
||||
--error 1201
|
||||
slave start;
|
||||
start slave;
|
||||
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
|
||||
# Will get error 13 on Unix systems becasue file is not readable
|
||||
!eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
|
||||
@@ -28,7 +28,7 @@ eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master
|
||||
connection master;
|
||||
reset master;
|
||||
connection slave;
|
||||
slave start;
|
||||
start slave;
|
||||
connection master;
|
||||
|
||||
drop table if exists t1, t2, t3, t4;
|
||||
@@ -40,9 +40,7 @@ create temporary table temp_table (a char(80) not null);
|
||||
insert into temp_table values ("testing temporary tables");
|
||||
create table t1 (s text);
|
||||
insert into t1 values('Could not break slave'),('Tried hard');
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
|
||||
show slave status;
|
||||
select * from t1;
|
||||
@@ -52,12 +50,10 @@ drop table if exists t2;
|
||||
create table t2(m int not null auto_increment primary key);
|
||||
insert into t2 values (34),(67),(123);
|
||||
flush logs;
|
||||
show master logs;
|
||||
show binary logs;
|
||||
create table t3 select * from temp_table;
|
||||
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
|
||||
select * from t3;
|
||||
connection master;
|
||||
@@ -83,21 +79,17 @@ wait_for_slave_to_stop;
|
||||
|
||||
#restart slave skipping one event
|
||||
set global sql_slave_skip_counter=1;
|
||||
slave start;
|
||||
start slave;
|
||||
|
||||
connection master;
|
||||
save_master_pos;
|
||||
|
||||
#let slave catch up
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
connection master;
|
||||
purge master logs to 'master-bin.003';
|
||||
show master logs;
|
||||
show binary logs;
|
||||
insert into t2 values (65);
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
|
||||
show slave status;
|
||||
select * from t2;
|
||||
@@ -121,12 +113,12 @@ while ($1)
|
||||
}
|
||||
enable_query_log;
|
||||
create table t4 select * from temp_table;
|
||||
show master logs;
|
||||
show binary logs;
|
||||
show master status;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
#slave stop;
|
||||
#slave start;
|
||||
#stop slave;
|
||||
#start slave;
|
||||
sync_with_master;
|
||||
select * from t4;
|
||||
|
||||
@@ -140,6 +132,4 @@ unlock tables;
|
||||
#clean up
|
||||
connection master;
|
||||
drop table if exists t1,t2,t3,t4;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
|
||||
@@ -9,22 +9,16 @@ insert into t1 values (NULL),(NULL);
|
||||
truncate table t1;
|
||||
# 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;
|
||||
sync_slave_with_master;
|
||||
stop slave;
|
||||
start slave;
|
||||
connection master;
|
||||
insert into t1 values (NULL),(NULL);
|
||||
flush logs;
|
||||
truncate table t1;
|
||||
insert into t1 values (10),(NULL),(NULL),(NULL),(NULL),(NULL);
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
select * from t1;
|
||||
connection master;
|
||||
drop table t1,t2;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sync_slave_with_master;
|
||||
|
||||
@@ -108,4 +108,10 @@ INSERT INTO searchconthardwarefr3 (topic,date,pseudo) VALUES
|
||||
('43506','2002-10-02','joce'),('40143','2002-08-03','joce');
|
||||
EXPLAIN SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03';
|
||||
EXPLAIN SELECT (SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03');
|
||||
SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03';
|
||||
SELECT (SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03');
|
||||
SELECT 1 FROM searchconthardwarefr3 WHERE 1=(SELECT 1 UNION SELECT 1) UNION ALL SELECT 1;
|
||||
-- error 1240
|
||||
SELECT 1 FROM searchconthardwarefr3 WHERE 1=(SELECT 1 UNION ALL SELECT 1) UNION SELECT 1;
|
||||
EXPLAIN SELECT 1 FROM searchconthardwarefr3 WHERE 1=(SELECT 1 UNION SELECT 1);
|
||||
drop table searchconthardwarefr3;
|
||||
Reference in New Issue
Block a user