diff options
author | monty@mashka.mysql.fi <> | 2002-08-08 03:12:02 +0300 |
---|---|---|
committer | monty@mashka.mysql.fi <> | 2002-08-08 03:12:02 +0300 |
commit | 2c4fa340cccbf11dc7b7f944cf7ca30af48edf4f (patch) | |
tree | c44ce89903320c9d19cd6fe9767f75d997d2a1d0 /mysql-test | |
parent | bc035c71f1d94649253e4dac5fb8e5c981c7d834 (diff) | |
download | mariadb-git-2c4fa340cccbf11dc7b7f944cf7ca30af48edf4f.tar.gz |
Lots of code fixes to the replication code (especially the binary logging and index log file handling)
Fixed bugs in my last changeset that made MySQL hard to compile.
Added mutex around some data that could cause table cache corruptions when using OPTIMIZE TABLE / REPAIR TABLE or automatic repair of MyISAM tables.
Added mutex around some data in the slave start/stop code that could cause THD linked list corruptions
Extended my_chsize() to allow one to specify a filler character.
Extend vio_blocking to return the old state (This made some usage of this function much simpler)
Added testing for some functions that they caller have got the required mutexes before calling the function.
Use setrlimit() to ensure that we can write core file if one specifies --core-file.
Added --slave-compressed-protocol
Made 2 the minimum length for ft_min_word_len
Added variables foreign_key_checks & unique_checks.
Less logging from replication code (if not started with --log-warnings)
Changed that SHOW INNODB STATUS requre the SUPER privilege
More DBUG statements and a lot of new code comments
Diffstat (limited to 'mysql-test')
46 files changed, 101 insertions, 262 deletions
diff --git a/mysql-test/include/master-slave.inc b/mysql-test/include/master-slave.inc index 23392690239..474b1357e9e 100644 --- a/mysql-test/include/master-slave.inc +++ b/mysql-test/include/master-slave.inc @@ -7,6 +7,7 @@ connection slave; !slave stop; @r/slave-stopped.result show status like 'Slave_running'; connection master; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; connection slave; reset slave; @@ -14,3 +15,6 @@ reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; slave start; @r/slave-running.result show status like 'Slave_running'; + +# Set the default connection to 'master' +connection master; diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 66bc7f5069b..85cdc11eda9 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -234,6 +234,10 @@ while test $# -gt 0; do --skip-rpl) NO_SLAVE=1 ;; --skip-test=*) SKIP_TEST=`$ECHO "$1" | $SED -e "s;--skip-test=;;"`;; --do-test=*) DO_TEST=`$ECHO "$1" | $SED -e "s;--do-test=;;"`;; + --warnings | --log-warnings) + EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --log-warnings" + EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --log-warnings" + ;; --wait-timeout=*) START_WAIT_TIMEOUT=`$ECHO "$1" | $SED -e "s;--wait-timeout=;;"` STOP_WAIT_TIMEOUT=$START_WAIT_TIMEOUT;; @@ -456,10 +460,6 @@ XTERM=`which xterm` #++ # Function Definitions #-- -wait_for_server_start () -{ - $MYSQLADMIN --no-defaults -u $DBUSER --silent -O connect_timeout=10 -w2 --host=$hostname --port=$1 ping >/dev/null 2>&1 -} prompt_user () { @@ -845,7 +845,7 @@ start_slave() master_info="--master-user=root \ --master-connect-retry=1 \ --master-host=127.0.0.1 \ - --master-password= \ + --master-password="" \ --master-port=$MASTER_MYPORT \ --server-id=$slave_server_id --rpl-recovery-rank=$slave_rpl_rank" else diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result index a1eff07f4d5..b27cbb46210 100644 --- a/mysql-test/r/insert.result +++ b/mysql-test/r/insert.result @@ -19,25 +19,27 @@ insert into t1 values (0,"mysql a"); insert into t1 values (0,"r1manic"); insert into t1 values (0,"r1man"); drop table t1; -create table t1 (a int not null auto_increment, primary key (a), t timestamp, c char(10) default "hello"); -insert into t1 values (default,default,default), (default,default,default), (4,0,"a"),(default,default,default); -select a,t>0,c from t1; -a t>0 c -1 1 hello -2 1 hello -4 0 a -5 1 hello +create table t1 (a int not null auto_increment, primary key (a), t timestamp, c char(10) default "hello", i int); +insert into t1 values (default,default,default,default), (default,default,default,default), (4,0,"a",5),(default,default,default,default); +select a,t>0,c,i from t1; +a t>0 c i +1 1 hello NULL +2 1 hello NULL +4 0 a 5 +5 1 hello NULL truncate table t1; insert into t1 set a=default,t=default,c=default; -insert into t1 set a=default,t=default,c=default; -insert into t1 set a=4,t=0,c="a"; -insert into t1 set a=default,t=default,c=default; -select a,t>0,c from t1; -a t>0 c -1 1 hello -2 1 hello -4 0 a -5 1 hello +insert into t1 set a=default,t=default,c=default,i=default; +insert into t1 set a=4,t=0,c="a",i=5; +insert into t1 set a=5,t=0,c="a",i=null; +insert into t1 set a=default,t=default,c=default,i=default; +select a,t>0,c,i from t1; +a t>0 c i +1 1 hello NULL +2 1 hello NULL +4 0 a 5 +5 0 a NULL +6 1 hello NULL drop table t1; drop database if exists foo; create database foo; diff --git a/mysql-test/r/rpl000001.result b/mysql-test/r/rpl000001.result index 2c36df65ca9..2dc21e86152 100644 --- a/mysql-test/r/rpl000001.result +++ b/mysql-test/r/rpl000001.result @@ -1,10 +1,10 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; slave start; -use test; -drop table if exists t1,t3; +drop table if exists t1,t2,t3; create table t1 (word char(20) not null); load data infile '../../std_data/words.dat' into table t1; load data local infile 'MYSQL_TEST_DIR/std_data/words.dat' into table t1; @@ -30,11 +30,12 @@ abandoned abandoning abandonment abandons +slave stop; set password for root@"localhost" = password('foo'); +slave start; set password for root@"localhost" = password(''); create table t3(n int); insert into t3 values(1),(2); -use test; select * from t3; n 1 @@ -46,7 +47,6 @@ drop table t1,t3; reset master; slave stop; reset slave; -drop table if exists t1,t2; create table t1(n int); select get_lock("hold_slave",10); get_lock("hold_slave",10) @@ -58,8 +58,8 @@ release_lock("hold_slave") unlock tables; create table t2(id int); insert into t2 values(connection_id()); -create temporary table t1_temp(n int); -insert into t1_temp select get_lock('crash_lock%20C', 1) from t2; +create temporary table t3(n int); +insert into t3 select get_lock('crash_lock%20C', 1) from t2; update t1 set n = n + get_lock('crash_lock%20C', 2); select (@id := id) - id from t2; (@id := id) - id @@ -75,17 +75,15 @@ count(*) drop table t1; create table t1 (n int); insert into t1 values(3456); -use mysql; -insert into user (Host, User, Password) +insert into mysql.user (Host, User, Password) VALUES ("10.10.10.%", "blafasel2", password("blafasel2")); select select_priv,user from mysql.user where user = 'blafasel2'; select_priv user N blafasel2 -update user set Select_priv = "Y" where User="blafasel2"; +update mysql.user set Select_priv = "Y" where User="blafasel2"; select select_priv,user from mysql.user where user = 'blafasel2'; select_priv user Y blafasel2 -use test; select n from t1; n 3456 diff --git a/mysql-test/r/rpl000002.result b/mysql-test/r/rpl000002.result index 88228321897..4c2b3bdfde6 100644 --- a/mysql-test/r/rpl000002.result +++ b/mysql-test/r/rpl000002.result @@ -1,14 +1,13 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; slave start; -use test; 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); -use test; select * from t1; n 2000 @@ -16,7 +15,7 @@ n 2002 show slave hosts; Server_id Host Port Rpl_recovery_rank Master_id -2 127.0.0.1 $SLAVE_MYPORT 2 1 +2 127.0.0.1 9999 2 1 drop table t1; slave stop; drop table if exists t2; diff --git a/mysql-test/r/rpl000003.result b/mysql-test/r/rpl000003.result index eb64d1855b1..b123b3d98c5 100644 --- a/mysql-test/r/rpl000003.result +++ b/mysql-test/r/rpl000003.result @@ -1,4 +1,5 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; diff --git a/mysql-test/r/rpl000004.result b/mysql-test/r/rpl000004.result index e5dee880f73..82b208d0b58 100644 --- a/mysql-test/r/rpl000004.result +++ b/mysql-test/r/rpl000004.result @@ -1,9 +1,9 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; slave start; -use test; set SQL_LOG_BIN=0; drop table if exists t1; create table t1 (word char(20) not null, index(word)); @@ -12,7 +12,6 @@ drop table if exists t2; create table t2 (word char(20) not null); load data infile '../../std_data/words.dat' into table t2; create table t3 (word char(20) not null primary key); -use test; drop table if exists t1; load table t1 from master; drop table if exists t2; diff --git a/mysql-test/r/rpl000005.result b/mysql-test/r/rpl000005.result index 0c91f984db1..3e9028bf2cf 100644 --- a/mysql-test/r/rpl000005.result +++ b/mysql-test/r/rpl000005.result @@ -1,4 +1,5 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; diff --git a/mysql-test/r/rpl000006.result b/mysql-test/r/rpl000006.result index f4e965236af..e7fc5151ac4 100644 --- a/mysql-test/r/rpl000006.result +++ b/mysql-test/r/rpl000006.result @@ -1,4 +1,5 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; diff --git a/mysql-test/r/rpl000007.result b/mysql-test/r/rpl000007.result index 7b2b9939228..c2823bf1203 100644 --- a/mysql-test/r/rpl000007.result +++ b/mysql-test/r/rpl000007.result @@ -1,13 +1,12 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; slave start; -use test; drop table if exists foo; create table foo (n int); insert into foo values(4); -use test; drop table if exists foo; create table foo (s char(20)); load data infile '../../std_data/words.dat' into table foo; diff --git a/mysql-test/r/rpl000008.result b/mysql-test/r/rpl000008.result index 5ca156fecf0..a0230d55702 100644 --- a/mysql-test/r/rpl000008.result +++ b/mysql-test/r/rpl000008.result @@ -1,4 +1,5 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; diff --git a/mysql-test/r/rpl000009.result b/mysql-test/r/rpl000009.result index 5246dadc06b..afd566c366c 100644 --- a/mysql-test/r/rpl000009.result +++ b/mysql-test/r/rpl000009.result @@ -1,4 +1,5 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; diff --git a/mysql-test/r/rpl000010.result b/mysql-test/r/rpl000010.result index 95792a72a6d..49538ed148e 100644 --- a/mysql-test/r/rpl000010.result +++ b/mysql-test/r/rpl000010.result @@ -1,4 +1,5 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; diff --git a/mysql-test/r/rpl000011.result b/mysql-test/r/rpl000011.result index 1a46f479677..5d22c29bdba 100644 --- a/mysql-test/r/rpl000011.result +++ b/mysql-test/r/rpl000011.result @@ -1,9 +1,9 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; slave start; -use test; drop table if exists t1; create table t1 (n int); insert into t1 values(1); diff --git a/mysql-test/r/rpl000012.result b/mysql-test/r/rpl000012.result index c7f3ab8f578..45de6502bbd 100644 --- a/mysql-test/r/rpl000012.result +++ b/mysql-test/r/rpl000012.result @@ -1,4 +1,5 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; diff --git a/mysql-test/r/rpl000013.result b/mysql-test/r/rpl000013.result index 5e4b4159e3a..9e802da59c5 100644 --- a/mysql-test/r/rpl000013.result +++ b/mysql-test/r/rpl000013.result @@ -1,4 +1,5 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; diff --git a/mysql-test/r/rpl000014.result b/mysql-test/r/rpl000014.result index c9926c92a4f..8e0dfc3a117 100644 --- a/mysql-test/r/rpl000014.result +++ b/mysql-test/r/rpl000014.result @@ -1,4 +1,5 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; @@ -8,7 +9,7 @@ File Position Binlog_do_db Binlog_ignore_db master-bin.001 79 show slave status; Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.001 79 slave-relay-bin.002 120 master-bin.001 Yes Yes 0 0 79 128 +127.0.0.1 root MASTER_PORT 1 master-bin.001 79 slave-relay-bin.002 120 master-bin.001 Yes Yes 0 0 79 124 change master to master_log_pos=73; slave stop; change master to master_log_pos=73; diff --git a/mysql-test/r/rpl_alter.result b/mysql-test/r/rpl_alter.result index 2e42177c140..1dc73c6524a 100644 --- a/mysql-test/r/rpl_alter.result +++ b/mysql-test/r/rpl_alter.result @@ -1,9 +1,9 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; slave start; -use test; drop database if exists d1; create database d1; create table d1.t1 ( n int); diff --git a/mysql-test/r/rpl_compat.result b/mysql-test/r/rpl_compat.result deleted file mode 100644 index 5e497791771..00000000000 --- a/mysql-test/r/rpl_compat.result +++ /dev/null @@ -1,77 +0,0 @@ -slave stop; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -use test; -drop table if exists t1,t3; -create table t1 (word char(20) not null); -load data infile '../../std_data/words.dat' into table t1; -select * from t1; -word -Aarhus -Aaron -Ababa -aback -abaft -abandon -abandoned -abandoning -abandonment -abandons -set password for root@"localhost" = password('foo'); -set password for root@"localhost" = password(''); -create table t3(n int); -insert into t3 values(1),(2); -use test; -select * from t3; -n -1 -2 -select sum(length(word)) from t1; -sum(length(word)) -71 -drop table t1,t3; -reset master; -slave stop; -reset slave; -create table t1(n int); -insert into t1 values (1),(2),(3); -create table t2(id int); -insert into t2 values(connection_id()); -create temporary table t1_temp(n int); -insert into t1_temp select get_lock('crash_lock%20C', 1) from t2; - update t1 set n = n + get_lock('crash_lock%20C', 2); -select (@id := id) - id from t2; -(@id := id) - id -0 -kill @id; -drop table t2; -Server shutdown in progress -slave start; -set sql_slave_skip_counter=1; -slave start; -select count(*) from t1; -count(*) -3 -drop table t1; -create table t1 (n int); -insert into t1 values(3456); -use mysql; -insert into user (Host, User, Password) -VALUES ("10.10.10.%", "blafasel2", password("blafasel2")); -select select_priv,user from mysql.user where user = 'blafasel2'; -select_priv user -N blafasel2 -update user set Select_priv = "Y" where User="blafasel2"; -select select_priv,user from mysql.user where user = 'blafasel2'; -select_priv user -Y blafasel2 -use test; -select n from t1; -n -3456 -select select_priv,user from mysql.user where user = 'blafasel2'; -select_priv user -Y blafasel2 -drop table t1; diff --git a/mysql-test/r/rpl_empty_master_crash.result b/mysql-test/r/rpl_empty_master_crash.result index 6ae5d15031b..66e28b32312 100644 --- a/mysql-test/r/rpl_empty_master_crash.result +++ b/mysql-test/r/rpl_empty_master_crash.result @@ -1,9 +1,9 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; slave start; -use test; drop table if exists t1; show slave status; Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space diff --git a/mysql-test/r/rpl_get_lock.result b/mysql-test/r/rpl_get_lock.result index cfbf4351f32..a8e602be03f 100644 --- a/mysql-test/r/rpl_get_lock.result +++ b/mysql-test/r/rpl_get_lock.result @@ -1,4 +1,5 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; diff --git a/mysql-test/r/rpl_log.result b/mysql-test/r/rpl_log.result index f5885085dee..8948460e1bd 100644 --- a/mysql-test/r/rpl_log.result +++ b/mysql-test/r/rpl_log.result @@ -1,4 +1,5 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; @@ -75,7 +76,7 @@ slave-bin.002 115 Query 1 62 use test; insert into t1 values (1) slave-bin.002 175 Query 1 122 use test; drop table t1 show slave status; Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.002 170 slave-relay-bin.002 916 master-bin.002 Yes Yes 0 0 170 924 +127.0.0.1 root MASTER_PORT 1 master-bin.002 170 slave-relay-bin.002 916 master-bin.002 Yes Yes 0 0 170 920 show new master for slave with master_log_file='master-bin.001' and master_log_pos=4 and master_server_id=1; Log_name Log_pos diff --git a/mysql-test/r/rpl_magic.result b/mysql-test/r/rpl_magic.result index b30d40d04eb..743bef4a053 100644 --- a/mysql-test/r/rpl_magic.result +++ b/mysql-test/r/rpl_magic.result @@ -1,4 +1,5 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; diff --git a/mysql-test/r/rpl_mystery22.result b/mysql-test/r/rpl_mystery22.result index e798d774380..5dd665fe9d5 100644 --- a/mysql-test/r/rpl_mystery22.result +++ b/mysql-test/r/rpl_mystery22.result @@ -1,5 +1,5 @@ -drop table if exists t1; slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; diff --git a/mysql-test/r/rpl_skip_error.result b/mysql-test/r/rpl_skip_error.result index 9fe92292178..946d64ad7c5 100644 --- a/mysql-test/r/rpl_skip_error.result +++ b/mysql-test/r/rpl_skip_error.result @@ -1,4 +1,5 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; diff --git a/mysql-test/r/rpl_sporadic_master.result b/mysql-test/r/rpl_sporadic_master.result index ca74904889b..52c9cc41ed5 100644 --- a/mysql-test/r/rpl_sporadic_master.result +++ b/mysql-test/r/rpl_sporadic_master.result @@ -1,4 +1,5 @@ slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test index 85798ec57f6..2c912d94c70 100644 --- a/mysql-test/t/insert.test +++ b/mysql-test/t/insert.test @@ -27,15 +27,16 @@ drop table t1; # Test insert syntax # -create table t1 (a int not null auto_increment, primary key (a), t timestamp, c char(10) default "hello"); -insert into t1 values (default,default,default), (default,default,default), (4,0,"a"),(default,default,default); -select a,t>0,c from t1; +create table t1 (a int not null auto_increment, primary key (a), t timestamp, c char(10) default "hello", i int); +insert into t1 values (default,default,default,default), (default,default,default,default), (4,0,"a",5),(default,default,default,default); +select a,t>0,c,i from t1; truncate table t1; insert into t1 set a=default,t=default,c=default; -insert into t1 set a=default,t=default,c=default; -insert into t1 set a=4,t=0,c="a"; -insert into t1 set a=default,t=default,c=default; -select a,t>0,c from t1; +insert into t1 set a=default,t=default,c=default,i=default; +insert into t1 set a=4,t=0,c="a",i=5; +insert into t1 set a=5,t=0,c="a",i=null; +insert into t1 set a=default,t=default,c=default,i=default; +select a,t>0,c,i from t1; drop table t1; # diff --git a/mysql-test/t/rpl000001.test b/mysql-test/t/rpl000001.test index 6d46124d238..fb4255f27b3 100644 --- a/mysql-test/t/rpl000001.test +++ b/mysql-test/t/rpl000001.test @@ -1,21 +1,34 @@ -eval_result; source include/master-slave.inc; -connection master; -use test; -drop table if exists t1,t3; +drop table if exists t1,t2,t3; create table t1 (word char(20) not null); load data infile '../../std_data/words.dat' into table t1; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1; select * from t1; + +# +# Test slave with wrong password +# +save_master_pos; +connection slave; +sync_with_master; +slave stop; +connection master; set password for root@"localhost" = password('foo'); +connection slave; +slave start; +connection master; +# Give slave time to do at last one failed connect retry +sleep 2; set password for root@"localhost" = password(''); +# Give slave time to connect (will retry every second) +sleep 2; + create table t3(n int); insert into t3 values(1),(2); save_master_pos; connection slave; sync_with_master; -use test; select * from t3; select sum(length(word)) from t1; connection master; @@ -32,7 +45,6 @@ slave stop; reset slave; connection master; -drop table if exists t1,t2; create table t1(n int); #we want the log to exceed 16K to test deal with the log that is bigger than #IO_SIZE @@ -45,12 +57,12 @@ while ($1) } enable_query_log; -#try to cause a large relay log lag on the slave +# Try to cause a large relay log lag on the slave connection slave; select get_lock("hold_slave",10); slave start; #hope this is long enough for I/O thread to fetch over 16K relay log data -sleep 1; +sleep 3; select release_lock("hold_slave"); unlock tables; @@ -59,24 +71,24 @@ create table t2(id int); insert into t2 values(connection_id()); save_master_pos; - connection master1; -#avoid generating result -create temporary table t1_temp(n int); -insert into t1_temp select get_lock('crash_lock%20C', 1) from t2; +# Avoid generating result +create temporary table t3(n int); +insert into t3 select get_lock('crash_lock%20C', 1) from t2; connection master; send update t1 set n = n + get_lock('crash_lock%20C', 2); connection master1; -sleep 2; +sleep 3; select (@id := id) - id from t2; kill @id; +# We don't drop t3 as this is a temporary table drop table t2; connection master; --error 1053; reap; connection slave; -sync_with_master ; +sync_with_master; #give the slave a chance to exit wait_for_slave_to_stop; @@ -92,13 +104,11 @@ connection master1; drop table t1; create table t1 (n int); insert into t1 values(3456); -use mysql; -insert into user (Host, User, Password) +insert into mysql.user (Host, User, Password) VALUES ("10.10.10.%", "blafasel2", password("blafasel2")); select select_priv,user from mysql.user where user = 'blafasel2'; -update user set Select_priv = "Y" where User="blafasel2"; +update mysql.user set Select_priv = "Y" where User="blafasel2"; select select_priv,user from mysql.user where user = 'blafasel2'; -use test; save_master_pos; connection slave; sync_with_master; @@ -109,5 +119,3 @@ drop table t1; save_master_pos; connection slave; sync_with_master; - - diff --git a/mysql-test/t/rpl000002.test b/mysql-test/t/rpl000002.test index 420ae27a337..caf0b4ef6d8 100644 --- a/mysql-test/t/rpl000002.test +++ b/mysql-test/t/rpl000002.test @@ -1,17 +1,14 @@ source include/master-slave.inc; -eval_result; -connection master; -use test; 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; -use test; sync_with_master; select * from t1; connection master; +--replace_result $SLAVE_MYPORT 9999 show slave hosts; drop table t1; save_master_pos; diff --git a/mysql-test/t/rpl000003.test b/mysql-test/t/rpl000003.test index c4b120d31b0..f994ed94371 100644 --- a/mysql-test/t/rpl000003.test +++ b/mysql-test/t/rpl000003.test @@ -1,5 +1,4 @@ source include/master-slave.inc; -connection master; drop table if exists t1; create table t1(n int primary key); !insert into t1 values (1),(2),(2); diff --git a/mysql-test/t/rpl000004.test b/mysql-test/t/rpl000004.test index 5b2c41293a2..705e0d51b7b 100644 --- a/mysql-test/t/rpl000004.test +++ b/mysql-test/t/rpl000004.test @@ -1,6 +1,4 @@ source include/master-slave.inc; -connection master; -use test; set SQL_LOG_BIN=0; drop table if exists t1; create table t1 (word char(20) not null, index(word)); @@ -10,7 +8,6 @@ create table t2 (word char(20) not null); load data infile '../../std_data/words.dat' into table t2; create table t3 (word char(20) not null primary key); connection slave; -use test; drop table if exists t1; load table t1 from master; drop table if exists t2; diff --git a/mysql-test/t/rpl000005.test b/mysql-test/t/rpl000005.test index 92d954a6182..1cfea242b69 100644 --- a/mysql-test/t/rpl000005.test +++ b/mysql-test/t/rpl000005.test @@ -1,5 +1,4 @@ source include/master-slave.inc; -connection master; drop table if exists t1; CREATE TABLE t1 (name varchar(64), age smallint(3)); INSERT INTO t1 SET name='Andy', age=31; diff --git a/mysql-test/t/rpl000006.test b/mysql-test/t/rpl000006.test index 495f34bd5e7..ad8622c2a81 100644 --- a/mysql-test/t/rpl000006.test +++ b/mysql-test/t/rpl000006.test @@ -2,7 +2,6 @@ # Test forced timestamp # source include/master-slave.inc; -connection master; # Don't log table creating to the slave as we want to test LOAD TABLE set SQL_LOG_BIN=0,timestamp=200006; diff --git a/mysql-test/t/rpl000007.test b/mysql-test/t/rpl000007.test index 4425a5725e8..8ff1e1782cc 100644 --- a/mysql-test/t/rpl000007.test +++ b/mysql-test/t/rpl000007.test @@ -2,12 +2,10 @@ #the ones on bar source include/master-slave.inc; connection slave; -use test; drop table if exists foo; create table foo (n int); insert into foo values(4); connection master; -use test; drop table if exists foo; create table foo (s char(20)); load data infile '../../std_data/words.dat' into table foo; diff --git a/mysql-test/t/rpl000009.test b/mysql-test/t/rpl000009.test index d45fe0870ff..3d0827718ec 100644 --- a/mysql-test/t/rpl000009.test +++ b/mysql-test/t/rpl000009.test @@ -2,7 +2,6 @@ # the ones in database bar source include/master-slave.inc; -connection master; drop database if exists foo; create database foo; drop database if exists bar; diff --git a/mysql-test/t/rpl000011.test b/mysql-test/t/rpl000011.test index 7d99222b3c7..d75937e3f81 100644 --- a/mysql-test/t/rpl000011.test +++ b/mysql-test/t/rpl000011.test @@ -1,6 +1,4 @@ source include/master-slave.inc; -connection master; -use test; drop table if exists t1; create table t1 (n int); insert into t1 values(1); diff --git a/mysql-test/t/rpl000013.test b/mysql-test/t/rpl000013.test index a190d5324ae..14619796e01 100644 --- a/mysql-test/t/rpl000013.test +++ b/mysql-test/t/rpl000013.test @@ -1,5 +1,4 @@ source include/master-slave.inc; -connection master; save_master_pos; connection slave; sync_with_master; diff --git a/mysql-test/t/rpl000014.test b/mysql-test/t/rpl000014.test index df15fa6e600..0b75314ee6a 100644 --- a/mysql-test/t/rpl000014.test +++ b/mysql-test/t/rpl000014.test @@ -1,5 +1,4 @@ source include/master-slave.inc; -connection master; show master status; save_master_pos; connection slave; diff --git a/mysql-test/t/rpl_alter.test b/mysql-test/t/rpl_alter.test index a65605f703e..710dd2d09d6 100644 --- a/mysql-test/t/rpl_alter.test +++ b/mysql-test/t/rpl_alter.test @@ -1,6 +1,4 @@ source include/master-slave.inc; -connection master; -use test; drop database if exists d1; create database d1; create table d1.t1 ( n int); diff --git a/mysql-test/t/rpl_compat.test b/mysql-test/t/rpl_compat.test deleted file mode 100644 index 9c67cce1680..00000000000 --- a/mysql-test/t/rpl_compat.test +++ /dev/null @@ -1,86 +0,0 @@ -eval_result; -source include/master-slave.inc; -connection master; -require_version 3.23; -use test; -drop table if exists t1,t3; -create table t1 (word char(20) not null); -load data infile '../../std_data/words.dat' into table t1; -select * from t1; -set password for root@"localhost" = password('foo'); -set password for root@"localhost" = password(''); -create table t3(n int); -insert into t3 values(1),(2); -save_master_pos; -connection slave; -sync_with_master; -use test; -select * from t3; -select sum(length(word)) from t1; -connection master; -drop table t1,t3; -save_master_pos; -connection slave; -sync_with_master; - -#test handling of aborted connection in the middle of update -connection master; -reset master; -connection slave; -slave stop; -reset slave; - -connection master; -create table t1(n int); -insert into t1 values (1),(2),(3); -create table t2(id int); -insert into t2 values(connection_id()); -save_master_pos; - -connection master1; -#avoid generating result -create temporary table t1_temp(n int); -insert into t1_temp select get_lock('crash_lock%20C', 1) from t2; - -connection master; -send update t1 set n = n + get_lock('crash_lock%20C', 2); -connection master1; -sleep 2; -select (@id := id) - id from t2; -kill @id; -drop table t2; -connection master; ---error 1053; -reap; -connection slave; -slave start; -sync_with_master ; -#now slave will hit an error -wait_for_slave_to_stop; - -set global sql_slave_skip_counter=1; -slave start; -select count(*) from t1; -connection master1; -drop table t1; -create table t1 (n int); -insert into t1 values(3456); -use mysql; -insert into user (Host, User, Password) - VALUES ("10.10.10.%", "blafasel2", password("blafasel2")); -select select_priv,user from mysql.user where user = 'blafasel2'; -update user set Select_priv = "Y" where User="blafasel2"; -select select_priv,user from mysql.user where user = 'blafasel2'; -use test; -save_master_pos; -connection slave; -sync_with_master; -select n from t1; -select select_priv,user from mysql.user where user = 'blafasel2'; -connection master1; -drop table t1; -save_master_pos; -connection slave; -sync_with_master; - - diff --git a/mysql-test/t/rpl_empty_master_crash.test b/mysql-test/t/rpl_empty_master_crash.test index 158b59169ee..7923a29dcf1 100644 --- a/mysql-test/t/rpl_empty_master_crash.test +++ b/mysql-test/t/rpl_empty_master_crash.test @@ -1,6 +1,4 @@ source include/master-slave.inc; -connection master; -use test; drop table if exists t1; show slave status; --error 1218 diff --git a/mysql-test/t/rpl_get_lock.test b/mysql-test/t/rpl_get_lock.test index 1d98eb16bb0..e93268e6074 100644 --- a/mysql-test/t/rpl_get_lock.test +++ b/mysql-test/t/rpl_get_lock.test @@ -1,5 +1,5 @@ source include/master-slave.inc; -connection master; + create table t1(n int); insert into t1 values(get_lock("lock",2)); dirty_close master; diff --git a/mysql-test/t/rpl_magic.test b/mysql-test/t/rpl_magic.test index 376edc301d7..c93add93d9d 100644 --- a/mysql-test/t/rpl_magic.test +++ b/mysql-test/t/rpl_magic.test @@ -1,7 +1,6 @@ source include/master-slave.inc; #first, make sure the slave has had enough time to register -connection master; save_master_pos; connection slave; sync_with_master; diff --git a/mysql-test/t/rpl_mystery22.test b/mysql-test/t/rpl_mystery22.test index e987074697b..371c5ba21ed 100644 --- a/mysql-test/t/rpl_mystery22.test +++ b/mysql-test/t/rpl_mystery22.test @@ -1,8 +1,7 @@ # test case to make slave thread get ahead by 22 bytes -drop table if exists t1; 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; diff --git a/mysql-test/t/rpl_skip_error.test b/mysql-test/t/rpl_skip_error.test index 3303b45c1ca..d43c59ef024 100644 --- a/mysql-test/t/rpl_skip_error.test +++ b/mysql-test/t/rpl_skip_error.test @@ -1,6 +1,6 @@ source include/master-slave.inc; -connection master; drop table if exists t1; + create table t1 (n int not null primary key); save_master_pos; connection slave; diff --git a/mysql-test/t/rpl_sporadic_master.test b/mysql-test/t/rpl_sporadic_master.test index 0487f868436..2e86b53067c 100644 --- a/mysql-test/t/rpl_sporadic_master.test +++ b/mysql-test/t/rpl_sporadic_master.test @@ -2,8 +2,8 @@ # COM_BINLOG_DUMP and additionally limits the number of events per dump source include/master-slave.inc; -connection master; 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); |