diff options
author | unknown <lars@mysql.com> | 2006-02-08 10:37:47 +0100 |
---|---|---|
committer | unknown <lars@mysql.com> | 2006-02-08 10:37:47 +0100 |
commit | 05330c2cb143a8ab04347b2aaa462d8b36bbc178 (patch) | |
tree | f4b8dc7552f7a015e045c641bde0d99da60c16df /mysql-test/t | |
parent | e039e481cb5b6a0488198e00101587d2f42e2aee (diff) | |
parent | 2f3705752a08c561d68e9676d6e9506468fa4bb3 (diff) | |
download | mariadb-git-05330c2cb143a8ab04347b2aaa462d8b36bbc178.tar.gz |
Merge lthalmann@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into mysql.com:/users/lthalmann/bkroot/mysql-5.1-new
mysql-test/r/mysqltest.result:
Auto merged
mysql-test/t/mysqltest.test:
Auto merged
Diffstat (limited to 'mysql-test/t')
70 files changed, 397 insertions, 312 deletions
diff --git a/mysql-test/t/analyze.test b/mysql-test/t/analyze.test index 656ff752c9b..a8fd0a4283e 100644 --- a/mysql-test/t/analyze.test +++ b/mysql-test/t/analyze.test @@ -61,5 +61,6 @@ prepare stmt1 from "SELECT * FROM t1 PROCEDURE ANALYSE()"; execute stmt1; execute stmt1; deallocate prepare stmt1; +drop table t1; # End of 4.1 tests diff --git a/mysql-test/t/backup-master.sh b/mysql-test/t/backup-master.sh index 99da5857afe..c099064f6b7 100755 --- a/mysql-test/t/backup-master.sh +++ b/mysql-test/t/backup-master.sh @@ -1,5 +1,5 @@ #!/bin/sh if [ "$MYSQL_TEST_DIR" ] then - rm -f $MYSQL_TEST_DIR/var/tmp/*.frm $MYSQL_TEST_DIR/var/tmp/*.MY? + rm -f $MYSQLTEST_VARDIR/tmp/*.frm $MYSQLTEST_VARDIR/tmp/*.MY? fi diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test index 64de3a426b2..917c3f98ebb 100644 --- a/mysql-test/t/backup.test +++ b/mysql-test/t/backup.test @@ -13,10 +13,10 @@ set SQL_LOG_BIN=0; drop table if exists t1, t2, t3, t4; --enable_warnings create table t4(n int); ---replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQL_TEST_DIR MYSQL_TEST_DIR +--replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR backup table t4 to '../bogus'; backup table t4 to '../tmp'; ---replace_result ": 7" ": X" ": 17" ": X" $MYSQL_TEST_DIR MYSQL_TEST_DIR +--replace_result ": 7" ": X" ": 17" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR backup table t4 to '../tmp'; drop table t4; restore table t4 from '../tmp'; @@ -26,7 +26,7 @@ create table t1(n int); insert into t1 values (23),(45),(67); backup table t1 to '../tmp'; drop table t1; ---replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQL_TEST_DIR MYSQL_TEST_DIR +--replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR restore table t1 from '../bogus'; restore table t1 from '../tmp'; select n from t1; @@ -55,6 +55,6 @@ unlock tables; connection con1; reap; drop table t5; ---system rm $MYSQL_TEST_DIR/var/tmp/t?.* +--system rm $MYSQLTEST_VARDIR/tmp/t?.* # End of 4.1 tests diff --git a/mysql-test/t/create_select_tmp.test b/mysql-test/t/create_select_tmp.test index dad83942806..144bccc5871 100644 --- a/mysql-test/t/create_select_tmp.test +++ b/mysql-test/t/create_select_tmp.test @@ -30,5 +30,6 @@ select * from t2; CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1; --error 1146 select * from t2; +drop table t1; # End of 4.1 tests diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test index 5648cea7fd3..2d6b55600b1 100644 --- a/mysql-test/t/ctype_recoding.test +++ b/mysql-test/t/ctype_recoding.test @@ -186,5 +186,5 @@ select rpad(c1,3,'ö'), rpad('ö',3,c1) from t1; # TODO #select case c1 when 'ß' then 'ß' when 'ö' then 'ö' else 'c' end from t1; #select export_set(5,c1,'ö'), export_set(5,'ö',c1) from t1; - +drop table t1; # End of 4.1 tests diff --git a/mysql-test/t/fulltext_var.test b/mysql-test/t/fulltext_var.test index 6b0b8aa463b..a048dab7f40 100644 --- a/mysql-test/t/fulltext_var.test +++ b/mysql-test/t/fulltext_var.test @@ -5,6 +5,9 @@ drop table if exists t1; --enable_warnings +# Save ft_boolean_syntax variable +let $saved_ft_boolean_syntax=`select @@global.ft_boolean_syntax`; + show variables like "ft\_%"; create table t1 (b text not null); @@ -25,4 +28,9 @@ set global ft_boolean_syntax='@ -><()~*:""@|'; set global ft_boolean_syntax='+ -><()~*:""@!|'; drop table t1; +# Restore ft_boolean_syntax variable +--disable_query_log +eval set global ft_boolean_syntax='$saved_ft_boolean_syntax'; +--enable_query_log + # End of 4.1 tests diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test index c19bb1482d6..430a3a5dd4a 100644 --- a/mysql-test/t/grant2.test +++ b/mysql-test/t/grant2.test @@ -286,6 +286,7 @@ drop user 'mysqltest_1b', 'mysqltest_2b', 'mysqltest_3b'; create user 'mysqltest_2' identified by 'Mysqltest-2'; --error 1064 drop user 'mysqltest_2' identified by 'Mysqltest-2'; +drop user 'mysqltest_2'; # # Strange user names create user '%@b'@'b'; @@ -325,6 +326,7 @@ insert into mysql.user set host='%', user='mysqltest_B'; create user mysqltest_A@'%'; rename user mysqltest_B@'%' to mysqltest_C@'%'; drop user mysqltest_C@'%'; +drop user mysqltest_A@'%'; disconnect user4; connection default; drop user mysqltest_3@localhost; diff --git a/mysql-test/t/im_daemon_life_cycle-im.opt b/mysql-test/t/im_daemon_life_cycle-im.opt index 6bfd9a24107..21c01191e4c 100644 --- a/mysql-test/t/im_daemon_life_cycle-im.opt +++ b/mysql-test/t/im_daemon_life_cycle-im.opt @@ -1,2 +1,2 @@ --run-as-service ---log=$MYSQL_TEST_DIR/var/log/im.log +--log=$MYSQLTEST_VARDIR/log/im.log diff --git a/mysql-test/t/im_options_set.imtest b/mysql-test/t/im_options_set.imtest index 785c6d05fef..a9b64861f99 100644 --- a/mysql-test/t/im_options_set.imtest +++ b/mysql-test/t/im_options_set.imtest @@ -48,7 +48,7 @@ # - check the configuration file; ---exec grep server_id $MYSQL_TEST_DIR/var/im.cnf ; +--exec grep server_id $MYSQLTEST_VARDIR/im.cnf ; # - check the running instances. @@ -79,7 +79,7 @@ SET mysqld1.server_id = 11; # - check that the configuration file has been updated (i.e. contains # server_id=SERVER_ID for the instance); ---exec grep server_id $MYSQL_TEST_DIR/var/im.cnf ; +--exec grep server_id $MYSQLTEST_VARDIR/im.cnf ; # - (for mysqld1) check that the running instance has not been affected: # connect to the instance and check that 'SHOW VARIABLES LIKE 'server_id'' @@ -104,7 +104,7 @@ SET mysqld2.server_id = 12; # - check that the configuration file has been updated (i.e. contains # server_id=SERVER_ID for the instance); ---exec grep server_id $MYSQL_TEST_DIR/var/im.cnf ; +--exec grep server_id $MYSQLTEST_VARDIR/im.cnf ; # - check that internal cache of Instance Manager has not been affected # (i.e. SHOW INSTANCE OPTIONS <instance> does not contain updated value). @@ -122,7 +122,7 @@ FLUSH INSTANCES; # - check that the configuration file has not been updated; ---exec grep server_id $MYSQL_TEST_DIR/var/im.cnf ; +--exec grep server_id $MYSQLTEST_VARDIR/im.cnf ; # - (for mysqld1) check that the running instance has not been affected: # connect to the instance and check that 'SHOW VARIABLES LIKE 'server_id'' diff --git a/mysql-test/t/im_options_unset.imtest b/mysql-test/t/im_options_unset.imtest index 74ec42ac3f9..40629805d45 100644 --- a/mysql-test/t/im_options_unset.imtest +++ b/mysql-test/t/im_options_unset.imtest @@ -55,7 +55,7 @@ # - check the configuration file; ---exec grep server_id $MYSQL_TEST_DIR/var/im.cnf ; +--exec grep server_id $MYSQLTEST_VARDIR/im.cnf ; # - check the running instances. @@ -86,7 +86,7 @@ UNSET mysqld1.server_id; # - check that the configuration file has been updated (i.e. does not # contain 'server_id=' line for the instance); ---exec grep server_id $MYSQL_TEST_DIR/var/im.cnf ; +--exec grep server_id $MYSQLTEST_VARDIR/im.cnf ; # - check that the running instance has not been affected: connect to the # instance and check that 'SHOW VARIABLES LIKE 'server_id'' returns non-zero @@ -111,7 +111,7 @@ UNSET mysqld2.server_id; # - check that the configuration file has been updated (i.e. does not # contain 'server_id=' line for the instance); ---exec grep server_id $MYSQL_TEST_DIR/var/im.cnf || true; +--exec grep server_id $MYSQLTEST_VARDIR/im.cnf || true; # - check that internal cache of Instance Manager is not affected (i.e. SHOW # INSTANCE OPTIONS <instance> contains non-zero value for server_id); @@ -130,7 +130,7 @@ FLUSH INSTANCES; # - check that the configuration file has not been updated (i.e. does not # contain 'server_id=' for the instance); ---exec grep server_id $MYSQL_TEST_DIR/var/im.cnf || true; +--exec grep server_id $MYSQLTEST_VARDIR/im.cnf || true; # - (for mysqld1) check that the running instance has not been affected: # connect to the instance and check that 'SHOW VARIABLES LIKE 'server_id'' diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 36374683e24..ce5c4f71c8c 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -800,9 +800,9 @@ DROP FUNCTION func2; # create database mysqltest; create table mysqltest.t1(a int); ---exec chmod -r $MYSQL_TEST_DIR/var/master-data/mysqltest +--exec chmod -r $MYSQLTEST_VARDIR/master-data/mysqltest select table_schema from information_schema.tables where table_schema='mysqltest'; ---exec chmod +r $MYSQL_TEST_DIR/var/master-data/mysqltest +--exec chmod +r $MYSQLTEST_VARDIR/master-data/mysqltest drop database mysqltest; # diff --git a/mysql-test/t/innodb_cache.test b/mysql-test/t/innodb_cache.test index a811d660bd7..8ed2853e4f7 100644 --- a/mysql-test/t/innodb_cache.test +++ b/mysql-test/t/innodb_cache.test @@ -63,6 +63,7 @@ drop table t1; # # one statement roll back inside transation # +let $save_query_cache_size=`select @@global.query_cache_size`; set GLOBAL query_cache_size=1355776; CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a)) ENGINE=innodb; CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b)) ENGINE=innodb; @@ -79,5 +80,8 @@ insert into t3 VALUES ( NULL, 1, 1, 2 ); commit; select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc; drop table t3,t2,t1; +--disable_query_log +eval set GLOBAL query_cache_size=$save_query_cache_size; +--enable_query_log # End of 4.1 tests diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test index 51d936f5b4f..ddde6cfa5d3 100644 --- a/mysql-test/t/insert.test +++ b/mysql-test/t/insert.test @@ -99,27 +99,22 @@ create table t1(number int auto_increment primary key, original_value varchar(50 set @value= "aa"; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); ---replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= "1aa"; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); ---replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= "aa1"; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); ---replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= "1e+1111111111a"; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); ---replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= "-1e+1111111111a"; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); ---replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() --error 1367 @@ -130,22 +125,18 @@ set @value= -1e+1111111111; set @value= 1e+111; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); ---replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= -1e+111; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); ---replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= 1; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); ---replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= -1; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); ---replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() drop table t1; diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index 367b98f2485..03ad56ed2b6 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -700,6 +700,7 @@ SELECT COALESCE(t2.EMPNUM,t1.EMPNUM) AS EMPNUM, NAME, GRP SELECT * FROM v1; SELECT * FROM v1 WHERE EMPNUM < 10; +DROP VIEW v1; DROP TABLE t1,t2; # diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index 014d09da746..34d2e7dbd54 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -7,25 +7,25 @@ drop table if exists t1, t2; --enable_warnings create table t1 (a date, b date, c date not null, d date); -load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ','; -load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; +load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ','; +load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; SELECT * from t1; truncate table t1; -load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d); +load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d); SELECT * from t1; drop table t1; create table t1 (a text, b text); -load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by ''''; +load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by ''''; select concat('|',a,'|'), concat('|',b,'|') from t1; drop table t1; create table t1 (a int, b char(10)); -load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines; +load data infile '../std_data_ln/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines; select * from t1; truncate table t1; -load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines; +load data infile '../std_data_ln/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines; # The empty line last comes from the end line field in the file select * from t1; @@ -38,23 +38,23 @@ SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO; create table t1(id integer not null auto_increment primary key); insert into t1 values(0); disable_query_log; -eval SELECT * INTO OUTFILE '$MYSQL_TEST_DIR/var/tmp/t1' from t1; +eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' from t1; delete from t1; -eval load data infile '$MYSQL_TEST_DIR/var/tmp/t1' into table t1; +eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1; enable_query_log; select * from t1; ---exec rm $MYSQL_TEST_DIR/var/tmp/t1 +--exec rm $MYSQLTEST_VARDIR/tmp/t1 disable_query_log; -eval SELECT * INTO OUTFILE '$MYSQL_TEST_DIR/var/tmp/t1' +eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n' FROM t1; delete from t1; -eval load data infile '$MYSQL_TEST_DIR/var/tmp/t1' into table t1 +eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1 FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'; enable_query_log; select * from t1; ---exec rm $MYSQL_TEST_DIR/var/tmp/t1 +--exec rm $MYSQLTEST_VARDIR/tmp/t1 SET @@SQL_MODE=@OLD_SQL_MODE; drop table t1; @@ -63,7 +63,7 @@ drop table t1; # ENCLOSED # create table t1 (a varchar(20), b varchar(20)); -load data infile '../../std_data/loaddata_dq.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b); +load data infile '../std_data_ln/loaddata_dq.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b); select * from t1; drop table t1; @@ -74,40 +74,40 @@ drop table t1; # create table t1 (a int default 100, b int, c varchar(60)); # we can do something like this -load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b); +load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b); select * from t1; truncate table t1; # we can use filled fields in expressions # we also assigning NULL value to field with non-NULL default here -load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set c= if(a is null,"oops",a); +load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set c= if(a is null,"oops",a); select * from t1; truncate table t1; # we even can use variables in set clause, and missed columns will be set # with default values set @c:=123; -load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, b) set c= if(@a is null,@c,b); +load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, b) set c= if(@a is null,@c,b); select * from t1; # let us test side-effect of such load -load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, @b); +load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, @b); select * from t1; select @a, @b; truncate table t1; # now going to test fixed field-row file format -load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow"; +load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow"; select * from t1; truncate table t1; # this also should work -load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c=concat(a,"+",b,"+",@c,"+",b,"+",if(c is null,"NIL",c)); +load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c=concat(a,"+",b,"+",@c,"+",b,"+",if(c is null,"NIL",c)); select * from t1; # and this should bark --error 1409 -load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, @b); +load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, @b); # Now let us test LOAD DATA with subselect create table t2 (num int primary key, str varchar(10)); insert into t2 values (10,'Ten'), (15,'Fifteen'); truncate table t1; -load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n); +load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n); select * from t1; # cleanup diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index fb90c16bb86..4f07df4e4f2 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -711,14 +711,14 @@ eval set storage_engine=$default; # Test how DROP TABLE works if the index or data file doesn't exists create table t1 (a int) engine=myisam; -system rm ./var/master-data/test/t1.MYI ; +system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYI ; drop table if exists t1; create table t1 (a int) engine=myisam; -system rm ./var/master-data/test/t1.MYI ; +system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYI ; --error 1051,6 drop table t1; create table t1 (a int) engine=myisam; -system rm ./var/master-data/test/t1.MYD ; +system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYD ; --error 1105,6,29 drop table t1; --error 1051 diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 30af9fd8126..dbe80c84ede 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -24,11 +24,11 @@ insert into t2 values (); # test for load data and load data distributed among the several # files (we need to fill up first binlog) -load data infile '../../std_data/words.dat' into table t1; -load data infile '../../std_data/words.dat' into table t1; -load data infile '../../std_data/words.dat' into table t1; -load data infile '../../std_data/words.dat' into table t1; -load data infile '../../std_data/words.dat' into table t1; +load data infile '../std_data_ln/words.dat' into table t1; +load data infile '../std_data_ln/words.dat' into table t1; +load data infile '../std_data_ln/words.dat' into table t1; +load data infile '../std_data_ln/words.dat' into table t1; +load data infile '../std_data_ln/words.dat' into table t1; # simple query to show more in second binlog insert into t1 values ("Alas"); flush logs; @@ -43,29 +43,29 @@ select "--- Local --" as ""; # be time dependend. Better than nothing. # ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ $MYSQL_TEST_DIR/var/log/master-bin.000001 +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000001 # this should not fail but shouldn't produce any working statements --disable_query_log select "--- Broken LOAD DATA --" as ""; --enable_query_log ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ $MYSQL_TEST_DIR/var/log/master-bin.000002 +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000002 # this should show almost nothing --disable_query_log select "--- --database --" as ""; --enable_query_log ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --database=nottest $MYSQL_TEST_DIR/var/log/master-bin.000001 +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --database=nottest $MYSQLTEST_VARDIR/log/master-bin.000001 # this test for position option --disable_query_log select "--- --position --" as ""; --enable_query_log ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --position=235 $MYSQL_TEST_DIR/var/log/master-bin.000002 +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=235 $MYSQLTEST_VARDIR/log/master-bin.000002 # These are tests for remote binlog. # They should return the same as previous test. @@ -75,29 +75,29 @@ select "--- Remote --" as ""; --enable_query_log # This is broken now ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 # This is broken too --disable_query_log select "--- Broken LOAD DATA --" as ""; --enable_query_log ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 # And this too ! (altough it is documented) --disable_query_log select "--- --database --" as ""; --enable_query_log ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --database=nottest master-bin.000001 +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --database=nottest master-bin.000001 # Strangely but this works --disable_query_log select "--- --position --" as ""; --enable_query_log ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --position=235 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=235 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 # Bug#7853 (mysqlbinlog does not accept input from stdin) --disable_query_log diff --git a/mysql-test/t/mysqlbinlog2.test b/mysql-test/t/mysqlbinlog2.test index 89af8e33a03..91da502da02 100644 --- a/mysql-test/t/mysqlbinlog2.test +++ b/mysql-test/t/mysqlbinlog2.test @@ -43,28 +43,28 @@ select "--- Local --" as ""; # be time dependent (the Start events). Better than nothing. # ---exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001 --disable_query_log select "--- offset --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --offset=2 $MYSQL_TEST_DIR/var/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --offset=2 $MYSQLTEST_VARDIR/log/master-bin.000001 --disable_query_log select "--- start-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=604 $MYSQL_TEST_DIR/var/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --start-position=604 $MYSQLTEST_VARDIR/log/master-bin.000001 --disable_query_log select "--- stop-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --stop-position=604 $MYSQL_TEST_DIR/var/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --stop-position=604 $MYSQLTEST_VARDIR/log/master-bin.000001 --disable_query_log select "--- start-datetime --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQL_TEST_DIR/var/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001 --disable_query_log select "--- stop-datetime --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQL_TEST_DIR/var/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001 --disable_query_log select "--- Local with 2 binlogs on command line --" as ""; @@ -72,28 +72,28 @@ select "--- Local with 2 binlogs on command line --" as ""; # This is to verify that some options apply only to first, or last binlog ---exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002 +--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 --disable_query_log select "--- offset --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --offset=2 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002 +--exec $MYSQL_BINLOG --short-form --offset=2 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 --disable_query_log select "--- start-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=604 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002 +--exec $MYSQL_BINLOG --short-form --start-position=604 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 --disable_query_log select "--- stop-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --stop-position=130 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002 +--exec $MYSQL_BINLOG --short-form --stop-position=130 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 --disable_query_log select "--- start-datetime --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002 +--exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 --disable_query_log select "--- stop-datetime --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002 +--exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 --disable_query_log select "--- Remote --" as ""; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index e688e89ad05..592bc289d05 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -125,14 +125,14 @@ drop table t1; create table t1(a int); insert into t1 values (1),(2),(3); ---exec $MYSQL_DUMP --skip-comments --tab=$MYSQL_TEST_DIR/var/tmp/ test ---exec cat $MYSQL_TEST_DIR/var/tmp/t1.sql ---exec cat $MYSQL_TEST_DIR/var/tmp/t1.txt ---exec rm $MYSQL_TEST_DIR/var/tmp/t1.sql ---exec rm $MYSQL_TEST_DIR/var/tmp/t1.txt ---exec $MYSQL_DUMP --tab=$MYSQL_TEST_DIR/var/tmp/ test ---exec rm $MYSQL_TEST_DIR/var/tmp/t1.sql ---exec rm $MYSQL_TEST_DIR/var/tmp/t1.txt +--exec $MYSQL_DUMP --skip-comments --tab=$MYSQLTEST_VARDIR/tmp/ test +--exec cat $MYSQLTEST_VARDIR/tmp/t1.sql +--exec cat $MYSQLTEST_VARDIR/tmp/t1.txt +--exec rm $MYSQLTEST_VARDIR/tmp/t1.sql +--exec rm $MYSQLTEST_VARDIR/tmp/t1.txt +--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ test +--exec rm $MYSQLTEST_VARDIR/tmp/t1.sql +--exec rm $MYSQLTEST_VARDIR/tmp/t1.txt drop table t1; # @@ -587,7 +587,7 @@ create view v1 as select * from t2; create view v2 as select * from t1; # dump tables and view from db2 ---exec $MYSQL_DUMP db2 > var/tmp/bug10713.sql +--exec $MYSQL_DUMP db2 > $MYSQLTEST_VARDIR/tmp/bug10713.sql # drop the db, tables and views drop table t1, t2; @@ -597,7 +597,7 @@ drop database db2; # create db1 and reload dump create database db1; use db1; ---exec $MYSQL db1 < var/tmp/bug10713.sql +--exec $MYSQL db1 < $MYSQLTEST_VARDIR/tmp/bug10713.sql # check that all tables and views could be created show tables; @@ -705,9 +705,9 @@ drop table t1, t2; create table t1 (a text character set utf8, b text character set latin1); insert t1 values (0x4F736E616272C3BC636B, 0x4BF66C6E); select * from t1; ---exec $MYSQL_DUMP --tab=$MYSQL_TEST_DIR/var/tmp/ test ---exec $MYSQL test < $MYSQL_TEST_DIR/var/tmp/t1.sql ---exec $MYSQL_IMPORT test $MYSQL_TEST_DIR/var/tmp/t1.txt +--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ test +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/t1.sql +--exec $MYSQL_IMPORT test $MYSQLTEST_VARDIR/tmp/t1.txt select * from t1; drop table t1; @@ -827,9 +827,9 @@ update t1 set a = 4 where a=3; # Skip dumping triggers --exec $MYSQL_DUMP --skip-comments --databases --skip-triggers test # Dump and reload... ---exec $MYSQL_DUMP --skip-comments --databases test > var/tmp/mysqldump.sql +--exec $MYSQL_DUMP --skip-comments --databases test > $MYSQLTEST_VARDIR/tmp/mysqldump.sql drop table t1; ---exec $MYSQL test < var/tmp/mysqldump.sql +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mysqldump.sql # Check that tables have been reloaded show tables; --replace_column 6 # @@ -840,11 +840,11 @@ DROP TABLE t1, t2; # Bugs #9136, #12917: problems with --defaults-extra-file option # ---exec echo "[mysqltest1]" > $MYSQL_TEST_DIR/var/tmp/tmp.cnf ---exec echo "port=1234" >> $MYSQL_TEST_DIR/var/tmp/tmp.cnf ---exec $MYSQL_MY_PRINT_DEFAULTS -c $MYSQL_TEST_DIR/var/tmp/tmp.cnf mysqltest1 ---exec $MYSQL_MY_PRINT_DEFAULTS -e $MYSQL_TEST_DIR/var/tmp/tmp.cnf mysqltest1 mysqltest1 ---exec rm $MYSQL_TEST_DIR/var/tmp/tmp.cnf +--exec echo "[mysqltest1]" > $MYSQLTEST_VARDIR/tmp/tmp.cnf +--exec echo "port=1234" >> $MYSQLTEST_VARDIR/tmp/tmp.cnf +--exec $MYSQL_MY_PRINT_DEFAULTS -c $MYSQLTEST_VARDIR/tmp/tmp.cnf mysqltest1 +--exec $MYSQL_MY_PRINT_DEFAULTS -e $MYSQLTEST_VARDIR/tmp/tmp.cnf mysqltest1 mysqltest1 +--exec rm $MYSQLTEST_VARDIR/tmp/tmp.cnf # # Test of fix to BUG 12597 @@ -869,13 +869,13 @@ INSERT INTO `test1` VALUES (1); SELECT * FROM `test2`; # dump ---exec $MYSQL_DUMP --skip-comments --databases test > var/tmp/mysqldump.sql +--exec $MYSQL_DUMP --skip-comments --databases test > $MYSQLTEST_VARDIR/tmp/mysqldump.sql #DROP TRIGGER testref; #DROP TABLE test1; #DROP TABLE test2; # restore ---exec $MYSQL test < var/tmp/mysqldump.sql +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mysqldump.sql SHOW TRIGGERS; SELECT * FROM `test1`; SELECT * FROM `test2`; diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index d8bbec5d7d4..271d6fb783e 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -360,20 +360,20 @@ select 3 from t1 ; # Missing delimiter # The comment will be "sucked into" the sleep command since # delimiter is missing until after "show status" ---system echo "sleep 4" > var/tmp/mysqltest.sql ---system echo "# A comment" >> var/tmp/mysqltest.sql ---system echo "show status;" >> var/tmp/mysqltest.sql +--system echo "sleep 4" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql +--system echo "# A comment" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql +--system echo "show status;" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql --error 1 ---exec $MYSQL_TEST < var/tmp/mysqltest.sql 2>&1 +--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1 # # Missing delimiter until eof # The comment will be "sucked into" the sleep command since # delimiter is missing ---system echo "sleep 7" > var/tmp/mysqltest.sql ---system echo "# Another comment" >> var/tmp/mysqltest.sql +--system echo "sleep 7" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql +--system echo "# Another comment" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql --error 1 ---exec $MYSQL_TEST < var/tmp/mysqltest.sql 2>&1 +--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1 # # Extra delimiter @@ -587,25 +587,26 @@ echo $var3_var3; --exec echo "source non_existingFile;" | $MYSQL_TEST 2>&1 # Too many source ---exec echo "source var/tmp/recursive.sql;" > var/tmp/recursive.sql +--exec echo "source $MYSQLTEST_VARDIR/tmp/recursive.sql;" > $MYSQLTEST_VARDIR/tmp/recursive.sql +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --error 1 ---exec echo "source var/tmp/recursive.sql;" | $MYSQL_TEST 2>&1 +--exec echo "source $MYSQLTEST_VARDIR/tmp/recursive.sql;" | $MYSQL_TEST 2>&1 # Source a file with error ---exec echo "garbage ;" > var/tmp/error.sql +--exec echo "garbage ;" > $MYSQLTEST_VARDIR/tmp/error.sql +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --error 1 ---exec echo "source var/tmp/error.sql;" | $MYSQL_TEST 2>&1 +--exec echo "source $MYSQLTEST_VARDIR/tmp/error.sql;" | $MYSQL_TEST 2>&1 # Test execution of source in a while loop ---exec echo "echo here is the sourced script;" > var/tmp/sourced.sql --disable_query_log let $outer= 2; # Number of outer loops while ($outer) { eval SELECT '$outer = outer loop variable after while' AS ""; - --source var/tmp/sourced.sql + --source include/sourced.inc eval SELECT '$outer = outer loop variable before dec' AS ""; dec $outer; @@ -626,7 +627,6 @@ while ($outer) # Test execution of source in a while loop ---exec echo "--source var/tmp/sourced.sql" > var/tmp/sourced1.sql --disable_abort_on_error # Sourcing of a file within while loop, sourced file will # source other file @@ -634,7 +634,7 @@ let $num= 9; while ($num) { SELECT 'In loop' AS ""; - --source var/tmp/sourced1.sql + --source include/sourced1.inc dec $num; } --enable_abort_on_error @@ -772,20 +772,20 @@ while ($i) --error 1 --exec echo "{;" | $MYSQL_TEST 2>&1 ---system echo "while (0)" > var/tmp/mysqltest.sql ---system echo "echo hej;" >> var/tmp/mysqltest.sql +--system echo "while (0)" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql +--system echo "echo hej;" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql --error 1 ---exec $MYSQL_TEST < var/tmp/mysqltest.sql 2>&1 +--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1 ---system echo "while (0)" > var/tmp/mysqltest.sql ---system echo "{echo hej;" >> var/tmp/mysqltest.sql +--system echo "while (0)" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql +--system echo "{echo hej;" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql --error 1 ---exec $MYSQL_TEST < var/tmp/mysqltest.sql 2>&1 +--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1 ---system echo "while (0){" > var/tmp/mysqltest.sql ---system echo "echo hej;" >> var/tmp/mysqltest.sql +--system echo "while (0){" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql +--system echo "echo hej;" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql --error 1 ---exec $MYSQL_TEST < var/tmp/mysqltest.sql 2>&1 +--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1 # ---------------------------------------------------------------------------- # Test error messages returned from comments starting with a command @@ -876,38 +876,41 @@ select "a" as col1, "c" as col2; --exec echo "connect (con1,localhost,root,,,,,SMTP POP);" | $MYSQL_TEST 2>&1 # Repeat connect/disconnect ---exec echo "let \$i=100;" > var/tmp/con.sql ---exec echo "while (\$i)" >> var/tmp/con.sql ---exec echo "{" >> var/tmp/con.sql ---exec echo " connect (test_con1,localhost,root,,); " >> var/tmp/con.sql ---exec echo " disconnect test_con1; " >> var/tmp/con.sql ---exec echo " dec \$i; " >> var/tmp/con.sql ---exec echo "}" >> var/tmp/con.sql ---exec echo "source var/tmp/con.sql; echo OK;" | $MYSQL_TEST 2>&1 +--exec echo "let \$i=100;" > $MYSQLTEST_VARDIR/tmp/con.sql +--exec echo "while (\$i)" >> $MYSQLTEST_VARDIR/tmp/con.sql +--exec echo "{" >> $MYSQLTEST_VARDIR/tmp/con.sql +--exec echo " connect (test_con1,localhost,root,,); " >> $MYSQLTEST_VARDIR/tmp/con.sql +--exec echo " disconnect test_con1; " >> $MYSQLTEST_VARDIR/tmp/con.sql +--exec echo " dec \$i; " >> $MYSQLTEST_VARDIR/tmp/con.sql +--exec echo "}" >> $MYSQLTEST_VARDIR/tmp/con.sql +--exec echo "source $MYSQLTEST_VARDIR/tmp/con.sql; echo OK;" | $MYSQL_TEST 2>&1 # Repeat connect/disconnect, exceed max number of connections ---exec echo "let \$i=200;" > var/tmp/con.sql ---exec echo "while (\$i)" >> var/tmp/con.sql ---exec echo "{" >> var/tmp/con.sql ---exec echo " connect (test_con1,localhost,root,,); " >> var/tmp/con.sql ---exec echo " disconnect test_con1; " >> var/tmp/con.sql ---exec echo " dec \$i; " >> var/tmp/con.sql ---exec echo "}" >> var/tmp/con.sql +--exec echo "let \$i=200;" > $MYSQLTEST_VARDIR/tmp/con.sql +--exec echo "while (\$i)" >> $MYSQLTEST_VARDIR/tmp/con.sql +--exec echo "{" >> $MYSQLTEST_VARDIR/tmp/con.sql +--exec echo " connect (test_con1,localhost,root,,); " >> $MYSQLTEST_VARDIR/tmp/con.sql +--exec echo " disconnect test_con1; " >> $MYSQLTEST_VARDIR/tmp/con.sql +--exec echo " dec \$i; " >> $MYSQLTEST_VARDIR/tmp/con.sql +--exec echo "}" >> $MYSQLTEST_VARDIR/tmp/con.sql +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --error 1 ---exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1 +--exec echo "source $MYSQLTEST_VARDIR/tmp/con.sql;" | $MYSQL_TEST 2>&1 # Select disconnected connection ---exec echo "connect (test_con1,localhost,root,,);" > var/tmp/con.sql ---exec echo "disconnect test_con1; " >> var/tmp/con.sql ---exec echo "connection test_con1;" >> var/tmp/con.sql +--exec echo "connect (test_con1,localhost,root,,);" > $MYSQLTEST_VARDIR/tmp/con.sql +--exec echo "disconnect test_con1; " >> $MYSQLTEST_VARDIR/tmp/con.sql +--exec echo "connection test_con1;" >> $MYSQLTEST_VARDIR/tmp/con.sql +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --error 1 ---exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1 +--exec echo "source $MYSQLTEST_VARDIR/tmp/con.sql;" | $MYSQL_TEST 2>&1 # Connection name already used ---exec echo "connect (test_con1,localhost,root,,);" > var/tmp/con.sql ---exec echo "connect (test_con1,localhost,root,,);" >> var/tmp/con.sql +--exec echo "connect (test_con1,localhost,root,,);" > $MYSQLTEST_VARDIR/tmp/con.sql +--exec echo "connect (test_con1,localhost,root,,);" >> $MYSQLTEST_VARDIR/tmp/con.sql +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --error 1 ---exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1 +--exec echo "source $MYSQLTEST_VARDIR/tmp/con.sql;" | $MYSQL_TEST 2>&1 # connect when "disable_abort_on_error" caused "connection not found" --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT @@ -999,26 +1002,26 @@ select "this will be executed"; # # Test zero length result file. Should not pass # ---exec touch $MYSQL_TEST_DIR/var/tmp/zero_length_file.result ---exec echo "echo ok;" > $MYSQL_TEST_DIR/var/tmp/query.sql +--exec touch $MYSQLTEST_VARDIR/tmp/zero_length_file.result +--exec echo "echo ok;" > $MYSQLTEST_VARDIR/tmp/query.sql --error 1 ---exec $MYSQL_TEST -x var/tmp/query.sql -R var/tmp/zero_length_file.result 2>&1 +--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql -R $MYSQLTEST_VARDIR/tmp/zero_length_file.result 2>&1 # # Test that a test file that does not generate any output fails. # ---exec echo "let \$i= 1;" > $MYSQL_TEST_DIR/var/tmp/query.sql +--exec echo "let \$i= 1;" > $MYSQLTEST_VARDIR/tmp/query.sql --error 1 ---exec $MYSQL_TEST -x var/tmp/query.sql 2>&1 +--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql 2>&1 # # Test that mysqltest fails when there are no queries executed # but a result file exist # NOTE! This will never happen as long as it's not allowed to have # test files that does not produce any output -#--exec echo "something" > $MYSQL_TEST_DIR/var/tmp/result_file.result -#--exec echo "let \$i= 1;" > $MYSQL_TEST_DIR/var/tmp/query.sql +#--exec echo "something" > $MYSQLTEST_VARDIR/tmp/result_file.result +#--exec echo "let \$i= 1;" > $MYSQLTEST_VARDIR/tmp/query.sql #--error 1 -#--exec $MYSQL_TEST -x var/tmp/query.sql -R var/tmp/result_file.result 2>&1 +#--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql -R $MYSQLTEST_VARDIR/tmp/result_file.result 2>&1 # # Bug #11731 mysqltest in multi-statement queries ignores errors in @@ -1027,43 +1030,43 @@ select "this will be executed"; echo Failing multi statement query; # PS does not support multi statement ---exec echo "--disable_ps_protocol" > var/tmp/bug11731.sql ---exec echo "delimiter ||||;" >> var/tmp/bug11731.sql ---exec echo "create table t1 (a int primary key);" >> var/tmp/bug11731.sql ---exec echo "insert into t1 values (1);" >> var/tmp/bug11731.sql ---exec echo "select 'select-me';" >> var/tmp/bug11731.sql ---exec echo "insertz 'error query'||||" >> var/tmp/bug11731.sql ---exec echo "delimiter ;||||" >> var/tmp/bug11731.sql +--exec echo "--disable_ps_protocol" > $MYSQLTEST_VARDIR/tmp/bug11731.sql +--exec echo "delimiter ||||;" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql +--exec echo "create table t1 (a int primary key);" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql +--exec echo "insert into t1 values (1);" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql +--exec echo "select 'select-me';" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql +--exec echo "insertz 'error query'||||" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql +--exec echo "delimiter ;||||" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql --error 1 ---exec $MYSQL_TEST -x $MYSQL_TEST_DIR/var/tmp/bug11731.sql 2>&1 +--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/bug11731.sql 2>&1 drop table t1; --error 1 ---exec $MYSQL_TEST --record -x $MYSQL_TEST_DIR/var/tmp/bug11731.sql -R $MYSQL_TEST_DIR/var/tmp/bug11731.out 2>&1 +--exec $MYSQL_TEST --record -x $MYSQLTEST_VARDIR/tmp/bug11731.sql -R $MYSQLTEST_VARDIR/tmp/bug11731.out 2>&1 # The .out file should be non existent ---exec test ! -s $MYSQL_TEST_DIR/var/tmp/bug11731.out +--exec test ! -s $MYSQLTEST_VARDIR/tmp/bug11731.out drop table t1; echo Multi statement using expected error; # PS does not support multi statement ---exec echo "--disable_ps_protocol" > var/tmp/bug11731.sql ---exec echo "delimiter ||||;" >> var/tmp/bug11731.sql ---exec echo "--error 1064" >> var/tmp/bug11731.sql ---exec echo "create table t1 (a int primary key);" >> var/tmp/bug11731.sql ---exec echo "insert into t1 values (1);" >> var/tmp/bug11731.sql ---exec echo "select 'select-me';" >> var/tmp/bug11731.sql ---exec echo "insertz "error query"||||" >> var/tmp/bug11731.sql ---exec echo "delimiter ;||||" >> var/tmp/bug11731.sql +--exec echo "--disable_ps_protocol" > $MYSQLTEST_VARDIR/tmp/bug11731.sql +--exec echo "delimiter ||||;" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql +--exec echo "--error 1064" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql +--exec echo "create table t1 (a int primary key);" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql +--exec echo "insert into t1 values (1);" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql +--exec echo "select 'select-me';" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql +--exec echo "insertz "error query"||||" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql +--exec echo "delimiter ;||||" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql # These two should work since the error is expected ---exec $MYSQL_TEST -x $MYSQL_TEST_DIR/var/tmp/bug11731.sql 2>&1 +--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/bug11731.sql 2>&1 drop table t1; ---exec $MYSQL_TEST --record -x $MYSQL_TEST_DIR/var/tmp/bug11731.sql -R $MYSQL_TEST_DIR/var/tmp/bug11731.out 2>&1 +--exec $MYSQL_TEST --record -x $MYSQLTEST_VARDIR/tmp/bug11731.sql -R $MYSQLTEST_VARDIR/tmp/bug11731.out 2>&1 # The .out file should exist ---exec test -s $MYSQL_TEST_DIR/var/tmp/bug11731.out +--exec test -s $MYSQLTEST_VARDIR/tmp/bug11731.out drop table t1; diff --git a/mysql-test/t/ndb_autodiscover.test b/mysql-test/t/ndb_autodiscover.test index 7192cc89a07..7424687cd8a 100644 --- a/mysql-test/t/ndb_autodiscover.test +++ b/mysql-test/t/ndb_autodiscover.test @@ -24,7 +24,7 @@ create table t1( insert into t1 values(1, "Autodiscover"); flush tables; -system rm var/master-data/test/t1.frm ; +system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ; select * from t1; show status like 'handler_discover%'; @@ -33,13 +33,13 @@ show status like 'handler_discover%'; # flush tables; -system rm var/master-data/test/t1.frm ; +system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ; insert into t1 values (2, "Auto 2"); show status like 'handler_discover%'; insert into t1 values (3, "Discover 3"); show status like 'handler_discover%'; flush tables; -system rm var/master-data/test/t1.frm ; +system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ; select * from t1 order by id; show status like 'handler_discover%'; @@ -48,7 +48,7 @@ show status like 'handler_discover%'; # flush tables; -system rm var/master-data/test/t1.frm ; +system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ; update t1 set name="Autodiscover" where id = 2; show status like 'handler_discover%'; select * from t1 order by id; @@ -59,7 +59,7 @@ show status like 'handler_discover%'; # flush tables; -system rm var/master-data/test/t1.frm ; +system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ; delete from t1 where id = 3; select * from t1 order by id; show status like 'handler_discover%'; @@ -85,7 +85,7 @@ show status like 'handler_discover%'; flush tables; # Modify the frm file on disk -system echo "blaj" >> var/master-data/test/t2.frm ; +system echo "blaj" >> $MYSQLTEST_VARDIR/master-data/test/t2.frm ; select * from t2; show status like 'handler_discover%'; @@ -111,7 +111,7 @@ show status like 'handler_discover%'; flush tables; # Remove the frm file from disk -system rm var/master-data/test/t3.frm ; +system rm $MYSQLTEST_VARDIR/master-data/test/t3.frm ; --error 1050 create table t3( @@ -168,14 +168,14 @@ show status like 'handler_discover%'; # Remove the frm file from disk flush tables; -system rm var/master-data/test/t7.frm ; +system rm $MYSQLTEST_VARDIR/master-data/test/t7.frm ; show tables from test; show status like 'handler_discover%'; # Remove the frm file from disk again flush tables; -system rm var/master-data/test/t7.frm ; +system rm $MYSQLTEST_VARDIR/master-data/test/t7.frm ; --replace_column 6 # 7 # 8 # 9 # 12 # 13 # 15 # 18 # show table status; @@ -290,8 +290,8 @@ insert into t9 values (9); system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t3 >> $NDB_TOOLS_OUTPUT ; system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 >> $NDB_TOOLS_OUTPUT ; # Remove t6, t7 from disk -system rm var/master-data/test/t6.frm > /dev/null ; -system rm var/master-data/test/t7.frm > /dev/null ; +system rm $MYSQLTEST_VARDIR/master-data/test/t6.frm > /dev/null ; +system rm $MYSQLTEST_VARDIR/master-data/test/t7.frm > /dev/null ; SHOW TABLES; @@ -332,8 +332,8 @@ insert into t9 values (9); system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t3 > /dev/null ; system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 > /dev/null ; # Remove t6, t7 from disk -system rm var/master-data/test/t6.frm > /dev/null ; -system rm var/master-data/test/t7.frm > /dev/null ; +system rm $MYSQLTEST_VARDIR/master-data/test/t6.frm > /dev/null ; +system rm $MYSQLTEST_VARDIR/master-data/test/t7.frm > /dev/null ; SHOW TABLES LIKE 't6'; @@ -375,9 +375,9 @@ insert into t3 values (3, "ndb table 3"); insert into t4 values (4); # Remove t1, t2, t3 from disk -system rm var/master-data/test/t1.frm > /dev/null ; -system rm var/master-data/test/t2.frm > /dev/null ; -system rm var/master-data/test/t3.frm > /dev/null ; +system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm > /dev/null ; +system rm $MYSQLTEST_VARDIR/master-data/test/t2.frm > /dev/null ; +system rm $MYSQLTEST_VARDIR/master-data/test/t3.frm > /dev/null ; flush tables; # Select from the table which only exists in NDB. @@ -530,7 +530,7 @@ CREATE TABLE t9 ( insert t9 values(1, 2), (2,3), (3, 4), (4, 5); #Don't drop the table, instead remove the frm file -system rm var/master-data/test/t9.frm ; +system rm $MYSQLTEST_VARDIR/master-data/test/t9.frm ; # Now leave test case, when ndb_autodiscover2 will run, this # MySQL Server will have been restarted because it has a diff --git a/mysql-test/t/ndb_binlog_ddl_multi.test b/mysql-test/t/ndb_binlog_ddl_multi.test index 17d304db0b1..3aa3b9469fd 100644 --- a/mysql-test/t/ndb_binlog_ddl_multi.test +++ b/mysql-test/t/ndb_binlog_ddl_multi.test @@ -33,10 +33,12 @@ create table t1 (a int primary key) engine=ndb; --connection server2 create table t2 (a int primary key) engine=ndb; +--replace_result $binlog_start <binlog_start> --replace_column 2 # 4 # 5 # --eval show binlog events from $binlog_start --connection server1 +--replace_result $binlog_start <binlog_start> --replace_column 2 # 4 # 5 # --eval show binlog events from $binlog_start @@ -51,6 +53,7 @@ reset master; alter table t2 add column (b int); --connections server1 +--replace_result $binlog_start <binlog_start> --replace_column 2 # 4 # 5 # --eval show binlog events from $binlog_start @@ -70,6 +73,7 @@ ALTER DATABASE mysqltest CHARACTER SET latin1; drop table mysqltest.t1; --connection server1 +--replace_result $binlog_start <binlog_start> --replace_column 2 # 4 # 5 # --eval show binlog events from $binlog_start @@ -87,6 +91,7 @@ drop database mysqltest; create table t1 (a int primary key) engine=ndb; --connection server2 +--replace_result $binlog_start <binlog_start> --replace_column 2 # 4 # 5 # --eval show binlog events from $binlog_start @@ -139,5 +144,6 @@ ENGINE =NDB; drop table t1; --connection server2 +--replace_result $binlog_start <binlog_start> --replace_column 2 # 4 # 5 # --eval show binlog events from $binlog_start diff --git a/mysql-test/t/ndb_binlog_ignore_db-master.opt b/mysql-test/t/ndb_binlog_ignore_db-master.opt new file mode 100644 index 00000000000..e3947c0eeed --- /dev/null +++ b/mysql-test/t/ndb_binlog_ignore_db-master.opt @@ -0,0 +1 @@ +--binlog-ignore-db=mysqltest diff --git a/mysql-test/t/ndb_binlog_ignore_db.test b/mysql-test/t/ndb_binlog_ignore_db.test new file mode 100644 index 00000000000..a46266f209a --- /dev/null +++ b/mysql-test/t/ndb_binlog_ignore_db.test @@ -0,0 +1,19 @@ +-- source include/have_ndb.inc +-- source include/have_binlog_format_row.inc + +--let $binlog_start=102 + +--disable_warnings +drop table if exists t1; +drop database if exists mysqltest; +--enable_warnings + +create database mysqltest; +use mysqltest; +create table t1 (a int primary key, b int) engine=ndb; +insert into t1 values (1, 1); +--replace_result $binlog_start <binlog_start> +--replace_column 2 # 4 # 5 # +--eval show binlog events from $binlog_start + +drop database mysqltest; diff --git a/mysql-test/t/outfile.test b/mysql-test/t/outfile.test index 37e96d9d38d..d404a6fff9f 100644 --- a/mysql-test/t/outfile.test +++ b/mysql-test/t/outfile.test @@ -1,6 +1,7 @@ disable_query_log; -- source include/test_outfile.inc -eval set @tmpdir="$MYSQL_TEST_DIR/var/tmp"; +# Server are started in "var/master-data", so "../tmp" will be "var/tmp" +eval set @tmpdir="../tmp"; enable_query_log; -- source include/have_outfile.inc @@ -15,42 +16,43 @@ drop table if exists t1; create table t1 (`a` blob); insert into t1 values("hello world"),("Hello mars"),(NULL); disable_query_log; -eval select * into outfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.1" from t1; +eval select * into outfile "../tmp/outfile-test.1" from t1; enable_query_log; select load_file(concat(@tmpdir,"/outfile-test.1")); disable_query_log; -eval select * into dumpfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.2" from t1 limit 1; +eval select * into dumpfile "../tmp/outfile-test.2" from t1 limit 1; enable_query_log; select load_file(concat(@tmpdir,"/outfile-test.2")); disable_query_log; -eval select * into dumpfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.3" from t1 where a is null; +eval select * into dumpfile "../tmp/outfile-test.3" from t1 where a is null; enable_query_log; select load_file(concat(@tmpdir,"/outfile-test.3")); # the following should give errors -#disabled as error message has variable path -#disable_query_log; -#--error 1086 -#eval select * into outfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.1" from t1; -#--error 1086 -#eval select * into dumpfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.2" from t1; -#--error 1086 -#eval select * into dumpfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.3" from t1; -#enable_query_log; +disable_query_log; +--error 1086 +eval select * into outfile "../tmp/outfile-test.1" from t1; + +--error 1086 +eval select * into dumpfile "../tmp/outfile-test.2" from t1; + +--error 1086 +eval select * into dumpfile "../tmp/outfile-test.3" from t1; +enable_query_log; --error 13,2 select load_file(concat(@tmpdir,"/outfile-test.not-exist")); ---exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.1 ---exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.2 ---exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.3 +--exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.1 +--exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.2 +--exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.3 drop table t1; # Bug#8191 disable_query_log; -eval select 1 into outfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.4"; +eval select 1 into outfile "../tmp/outfile-test.4"; enable_query_log; select load_file(concat(@tmpdir,"/outfile-test.4")); ---exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.4 +--exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.4 # # Bug #5382: 'explain select into outfile' crashes the server @@ -70,16 +72,16 @@ DROP TABLE t1; # Bug#13202 SELECT * INTO OUTFILE ... FROM information_schema.schemata now fails # disable_query_log; -eval SELECT * INTO OUTFILE "$MYSQL_TEST_DIR/var/tmp/outfile-test.4" +eval SELECT * INTO OUTFILE "../tmp/outfile-test.4" FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' FROM information_schema.schemata LIMIT 0, 5; # enable_query_log; ---exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.4 +--exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.4 use information_schema; # disable_query_log; -eval SELECT * INTO OUTFILE "$MYSQL_TEST_DIR/var/tmp/outfile-test.4" +eval SELECT * INTO OUTFILE "../tmp/outfile-test.4" FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' FROM schemata LIMIT 0, 5; enable_query_log; ---exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.4 +--exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.4 diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index fa844f02ace..6b168711de8 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -834,7 +834,7 @@ execute stmt1 ; --disable_metadata --horizontal_results -drop table t5, t9; +drop table t1, t5, t9; ##### RULES OF THUMB TO PRESERVE THE SYSTEMATICS OF THE PS TEST CASES ##### # diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index a99d802e5a5..15559d75d6c 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -787,6 +787,7 @@ begin end// call p1()// drop procedure p1// +drop function f1// drop table t1// delimiter ;// diff --git a/mysql-test/t/read_only.test b/mysql-test/t/read_only.test index 1e92e438122..175a5bba6fa 100644 --- a/mysql-test/t/read_only.test +++ b/mysql-test/t/read_only.test @@ -104,3 +104,5 @@ insert into t1 values(1); connection default; drop table t1,t2; drop user test@localhost; + +set global read_only=0; diff --git a/mysql-test/t/repair.test b/mysql-test/t/repair.test index 5e39e0b6a50..16e1d76d460 100644 --- a/mysql-test/t/repair.test +++ b/mysql-test/t/repair.test @@ -29,7 +29,7 @@ repair table t1 use_frm; create table t1 engine=myisam SELECT 1,"table 1"; flush tables; -system echo 1 > $MYSQL_TEST_DIR/var/master-data/test/t1.MYI ; +system echo 1 > $MYSQLTEST_VARDIR/master-data/test/t1.MYI ; repair table t1; repair table t1 use_frm; drop table t1; diff --git a/mysql-test/t/rpl000004.test b/mysql-test/t/rpl000004.test index f2a02bd4dd6..9c8c535c67d 100644 --- a/mysql-test/t/rpl000004.test +++ b/mysql-test/t/rpl000004.test @@ -2,9 +2,9 @@ source include/master-slave.inc; set SQL_LOG_BIN=0; create table t1 (word char(20) not null, index(word)); -load data infile '../../std_data/words.dat' into table t1; +load data infile '../std_data_ln/words.dat' into table t1; create table t2 (word char(20) not null); -load data infile '../../std_data/words.dat' into table t2; +load data infile '../std_data_ln/words.dat' into table t2; create table t3 (word char(20) not null primary key); connection slave; load table t1 from master; diff --git a/mysql-test/t/rpl000009.test b/mysql-test/t/rpl000009.test index 81e9860c186..161e01ad293 100644 --- a/mysql-test/t/rpl000009.test +++ b/mysql-test/t/rpl000009.test @@ -138,10 +138,10 @@ select * from mysqltest.t1; # DISABLED FOR NOW AS chmod IS NOT PORTABLE ON NON-UNIX # insert into mysqltest.t1 values(10, 'should be there'); # flush tables; -# system chmod 500 var/slave-data/mysqltest/; +# system chmod 500 $MYSQLTEST_VARDIR/slave-data/mysqltest/; # --error 6 # load data from master; # should fail (errno 13) -# system chmod 700 var/slave-data/mysqltest/; +# system chmod 700 $MYSQLTEST_VARDIR/slave-data/mysqltest/; # select * from mysqltest.t1; # should contain the row (10, ...) diff --git a/mysql-test/t/rpl000017-slave.sh b/mysql-test/t/rpl000017-slave.sh index 4dbbaec31ce..17188aba0db 100755 --- a/mysql-test/t/rpl000017-slave.sh +++ b/mysql-test/t/rpl000017-slave.sh @@ -1,6 +1,6 @@ -rm -f $MYSQL_TEST_DIR/var/log/*relay* -rm -f $MYSQL_TEST_DIR/var/slave-data/relay-log.info -cat > $MYSQL_TEST_DIR/var/slave-data/master.info <<EOF +rm -f $MYSQLTEST_VARDIR/log/*relay* +rm -f $MYSQLTEST_VARDIR/slave-data/relay-log.info +cat > $MYSQLTEST_VARDIR/slave-data/master.info <<EOF master-bin.000001 4 127.0.0.1 diff --git a/mysql-test/t/rpl000017.test b/mysql-test/t/rpl000017.test index 792801dd3d2..2ba321cd8c3 100644 --- a/mysql-test/t/rpl000017.test +++ b/mysql-test/t/rpl000017.test @@ -16,6 +16,7 @@ sync_slave_with_master; select * from t1; connection master; drop table t1; +delete from mysql.user where user="replicate"; sync_slave_with_master; # End of 4.1 tests diff --git a/mysql-test/t/rpl_000015-slave.sh b/mysql-test/t/rpl_000015-slave.sh index 62748605af1..7deeca3d2d6 100755 --- a/mysql-test/t/rpl_000015-slave.sh +++ b/mysql-test/t/rpl_000015-slave.sh @@ -1 +1 @@ -rm -f $MYSQL_TEST_DIR/var/slave-data/master.info +rm -f $MYSQLTEST_VARDIR/slave-data/master.info diff --git a/mysql-test/t/rpl_drop_db.test b/mysql-test/t/rpl_drop_db.test index 548009b758e..df17ec88aaa 100644 --- a/mysql-test/t/rpl_drop_db.test +++ b/mysql-test/t/rpl_drop_db.test @@ -54,5 +54,5 @@ sync_slave_with_master; #cleanup connection slave; stop slave; -#system rm -rf var/master-data/mysqltest1; +#system rm -rf $MYSQLTEST_VARDIR/master-data/mysqltest1; diff --git a/mysql-test/t/rpl_flushlog_loop-master.opt b/mysql-test/t/rpl_flushlog_loop-master.opt index 4f6e0f3d00c..a4d1d403dc9 100644 --- a/mysql-test/t/rpl_flushlog_loop-master.opt +++ b/mysql-test/t/rpl_flushlog_loop-master.opt @@ -1 +1 @@ --O max_binlog_size=1M --relay-log=$MYSQL_TEST_DIR/var/master-data/relay-log +-O max_binlog_size=1M --relay-log=$MYSQLTEST_VARDIR/master-data/relay-log diff --git a/mysql-test/t/rpl_flushlog_loop-master.sh b/mysql-test/t/rpl_flushlog_loop-master.sh index 9e56af99f5c..a321dd690cd 100755 --- a/mysql-test/t/rpl_flushlog_loop-master.sh +++ b/mysql-test/t/rpl_flushlog_loop-master.sh @@ -1,5 +1,5 @@ -rm -f $MYSQL_TEST_DIR/var/slave-data/*-bin.* -rm -f $MYSQL_TEST_DIR/var/slave-data/master.info -rm -f $MYSQL_TEST_DIR/var/slave-data/*.index +rm -f $MYSQLTEST_VARDIR/slave-data/*-bin.* +rm -f $MYSQLTEST_VARDIR/slave-data/master.info +rm -f $MYSQLTEST_VARDIR/slave-data/*.index diff --git a/mysql-test/t/rpl_flushlog_loop-slave.opt b/mysql-test/t/rpl_flushlog_loop-slave.opt index d1373f139b1..95839c831c9 100644 --- a/mysql-test/t/rpl_flushlog_loop-slave.opt +++ b/mysql-test/t/rpl_flushlog_loop-slave.opt @@ -1 +1 @@ --O max_binlog_size=1M --relay-log=$MYSQL_TEST_DIR/var/slave-data/relay-log +-O max_binlog_size=1M --relay-log=$MYSQLTEST_VARDIR/slave-data/relay-log diff --git a/mysql-test/t/rpl_flushlog_loop-slave.sh b/mysql-test/t/rpl_flushlog_loop-slave.sh index b8814e059a9..e46ea6d400b 100755 --- a/mysql-test/t/rpl_flushlog_loop-slave.sh +++ b/mysql-test/t/rpl_flushlog_loop-slave.sh @@ -1,4 +1,4 @@ -rm -f $MYSQL_TEST_DIR/var/master-data/master.info -rm -f $MYSQL_TEST_DIR/var/master-data/*-bin.* -rm -f $MYSQL_TEST_DIR/var/master-data/*.index +rm -f $MYSQLTEST_VARDIR/master-data/master.info +rm -f $MYSQLTEST_VARDIR/master-data/*-bin.* +rm -f $MYSQLTEST_VARDIR/master-data/*.index diff --git a/mysql-test/t/rpl_ignore_revoke.test b/mysql-test/t/rpl_ignore_revoke.test index e5b5bafb3c5..cdeb40df069 100644 --- a/mysql-test/t/rpl_ignore_revoke.test +++ b/mysql-test/t/rpl_ignore_revoke.test @@ -41,3 +41,7 @@ connection slave; --disable_abort_on_error revoke select on *.* FROM 'user_foo'; --enable_abort_on_error + +connection master; +delete from mysql.user where user="user_foo"; +sync_slave_with_master; diff --git a/mysql-test/t/rpl_innodb.test b/mysql-test/t/rpl_innodb.test index 551657fd7e3..b88276e2107 100644 --- a/mysql-test/t/rpl_innodb.test +++ b/mysql-test/t/rpl_innodb.test @@ -18,7 +18,7 @@ CREATE TABLE t4 ( --disable_warnings LOAD DATA - INFILE '../../std_data/loaddata_pair.dat' + INFILE '../std_data_ln/loaddata_pair.dat' REPLACE INTO TABLE t4 (name,number); --enable_warnings @@ -30,7 +30,7 @@ SELECT * FROM t4; connection master; --disable_warnings LOAD DATA - INFILE '../../std_data/loaddata_pair.dat' + INFILE '../std_data_ln/loaddata_pair.dat' REPLACE INTO TABLE t4 (name,number); --enable_warnings diff --git a/mysql-test/t/rpl_loaddata_s.test b/mysql-test/t/rpl_loaddata_s.test index c49fe461d7b..fc3e3d128a6 100644 --- a/mysql-test/t/rpl_loaddata_s.test +++ b/mysql-test/t/rpl_loaddata_s.test @@ -12,7 +12,7 @@ reset master; connection master; # 'test' is the current database create table test.t1(a int, b int, unique(b)); -load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; +load data infile '../std_data_ln/rpl_loaddata.dat' into table test.t1; # Test logging on slave; diff --git a/mysql-test/t/rpl_loaddatalocal.test b/mysql-test/t/rpl_loaddatalocal.test index 0b54de8462e..af4fd0106bd 100644 --- a/mysql-test/t/rpl_loaddatalocal.test +++ b/mysql-test/t/rpl_loaddatalocal.test @@ -14,17 +14,18 @@ disable_query_log; set SQL_LOG_BIN=0; while ($1) { -#eval means expand $ expressions - eval insert into t1 values(1); + insert into t1 values(1); dec $1; } set SQL_LOG_BIN=1; enable_query_log; -select * into outfile '../../var/master-data/rpl_loaddatalocal.select_outfile' from t1; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval select * into outfile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' from t1; #This will generate a 20KB file, now test LOAD DATA LOCAL truncate table t1; -load data local infile './var/master-data/rpl_loaddatalocal.select_outfile' into table t1; -system rm ./var/master-data/rpl_loaddatalocal.select_outfile ; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval load data local infile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1; +system rm $MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile ; save_master_pos; connection slave; sync_with_master; @@ -45,11 +46,13 @@ sync_with_master; connection master; create table t1(a int); insert into t1 values (1), (2), (2), (3); -select * into outfile '../../var/master-data/rpl_loaddatalocal.select_outfile' from t1; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval select * into outfile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' from t1; drop table t1; create table t1(a int primary key); -load data local infile './var/master-data/rpl_loaddatalocal.select_outfile' into table t1; -system rm ./var/master-data/rpl_loaddatalocal.select_outfile ; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval load data local infile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1; +system rm $MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile ; select * from t1; save_master_pos; connection slave; diff --git a/mysql-test/t/rpl_misc_functions-slave.sh b/mysql-test/t/rpl_misc_functions-slave.sh index c293715e16f..8ce79797822 100755 --- a/mysql-test/t/rpl_misc_functions-slave.sh +++ b/mysql-test/t/rpl_misc_functions-slave.sh @@ -1 +1 @@ -rm -f $MYSQL_TEST_DIR/var/master-data/test/rpl_misc_functions.outfile +rm -f $MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile diff --git a/mysql-test/t/rpl_misc_functions.test b/mysql-test/t/rpl_misc_functions.test index f20d0aa83e4..6e0bda90503 100644 --- a/mysql-test/t/rpl_misc_functions.test +++ b/mysql-test/t/rpl_misc_functions.test @@ -24,9 +24,14 @@ select * into outfile 'rpl_misc_functions.outfile' from t1; sync_slave_with_master; create table t2 like t1; # read the values from the master table -load data local infile './var/master-data/test/rpl_misc_functions.outfile' into table t2; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval load data local infile '$MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile' into table t2; # compare them with the replica; the SELECT below should return no row select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p); stop slave; +drop table t1; + +connection master; +drop table t1; # End of 4.1 tests diff --git a/mysql-test/t/rpl_replicate_do.test b/mysql-test/t/rpl_replicate_do.test index 5a2cb50d53a..31948105686 100644 --- a/mysql-test/t/rpl_replicate_do.test +++ b/mysql-test/t/rpl_replicate_do.test @@ -11,7 +11,7 @@ create table t2 (n int); insert into t2 values(4); connection master; create table t2 (s char(20)); -load data infile '../../std_data/words.dat' into table t2; +load data infile '../std_data_ln/words.dat' into table t2; insert into t2 values('five'); create table t1 (m int); insert into t1 values(15),(16),(17); @@ -53,4 +53,8 @@ connection slave; set one_shot time_zone='met'; select * from t1; +connection master; +drop table t1; +sync_slave_with_master; + # End of 4.1 tests diff --git a/mysql-test/t/rpl_rewrt_db.test b/mysql-test/t/rpl_rewrt_db.test index c66ced46717..8acc05f6ff5 100644 --- a/mysql-test/t/rpl_rewrt_db.test +++ b/mysql-test/t/rpl_rewrt_db.test @@ -34,8 +34,8 @@ create database rewrite; connection master; use test; create table t1 (a date, b date, c date not null, d date); -load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ','; -load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; +load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ','; +load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; sync_slave_with_master; connection slave; @@ -43,7 +43,7 @@ select * from rewrite.t1; connection master; truncate table t1; -load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d); +load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d); sync_slave_with_master; connection slave; @@ -52,7 +52,7 @@ select * from rewrite.t1; connection master; drop table t1; create table t1 (a text, b text); -load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by ''''; +load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by ''''; sync_slave_with_master; connection slave; @@ -61,7 +61,7 @@ select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1; connection master; drop table t1; create table t1 (a int, b char(10)); -load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines; +load data infile '../std_data_ln/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines; sync_slave_with_master; connection slave; @@ -69,7 +69,7 @@ select * from rewrite.t1; connection master; truncate table t1; -load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines; +load data infile '../std_data_ln/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines; sync_slave_with_master; connection slave; diff --git a/mysql-test/t/rpl_rotate_logs-slave.sh b/mysql-test/t/rpl_rotate_logs-slave.sh index 9259f593e54..81490a54b4b 100755 --- a/mysql-test/t/rpl_rotate_logs-slave.sh +++ b/mysql-test/t/rpl_rotate_logs-slave.sh @@ -1,2 +1,2 @@ -rm -f $MYSQL_TEST_DIR/var/slave-data/master.info -rm -f $MYSQL_TEST_DIR/var/slave-data/*relay* +rm -f $MYSQLTEST_VARDIR/slave-data/master.info +rm -f $MYSQLTEST_VARDIR/slave-data/*relay* diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test index 1f5f4ebbed2..7f76aaf3355 100644 --- a/mysql-test/t/rpl_rotate_logs.test +++ b/mysql-test/t/rpl_rotate_logs.test @@ -17,8 +17,8 @@ connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); drop table if exists t1, t2, t3, t4; --enable_warnings connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock); -system cat /dev/null > var/slave-data/master.info; -system chmod 000 var/slave-data/master.info; +system cat /dev/null > $MYSQLTEST_VARDIR/slave-data/master.info; +system chmod 000 $MYSQLTEST_VARDIR/slave-data/master.info; connection slave; --disable_warnings drop table if exists t1, t2, t3, t4; @@ -29,7 +29,7 @@ drop table if exists t1, t2, t3, t4; --replace_result $MYSQL_TEST_DIR TESTDIR --error 1105,1105,29 start slave; -system chmod 600 var/slave-data/master.info; +system chmod 600 $MYSQLTEST_VARDIR/slave-data/master.info; # It will fail again because the file is empty so the slave cannot get valuable # info about how to connect to the master from it (failure in # init_strvar_from_file() in init_master_info()). diff --git a/mysql-test/t/rpl_skip_error.test b/mysql-test/t/rpl_skip_error.test index e0e569a65b7..f6fc73f58f2 100644 --- a/mysql-test/t/rpl_skip_error.test +++ b/mysql-test/t/rpl_skip_error.test @@ -13,4 +13,7 @@ connection slave; sync_with_master; select * from t1; +connection master; +drop table t1; +sync_with_master; # End of 4.1 tests diff --git a/mysql-test/t/rpl_slave_status.test b/mysql-test/t/rpl_slave_status.test index 67d3816f443..985cebabe7e 100644 --- a/mysql-test/t/rpl_slave_status.test +++ b/mysql-test/t/rpl_slave_status.test @@ -29,4 +29,8 @@ start slave; --vertical_results show slave status; +connection master; +drop table t1; +sync_with_master; + # end of 4.1 tests diff --git a/mysql-test/t/rpl_timezone.test b/mysql-test/t/rpl_timezone.test index b3fabdb016f..5a6c1cd06f8 100644 --- a/mysql-test/t/rpl_timezone.test +++ b/mysql-test/t/rpl_timezone.test @@ -56,15 +56,15 @@ connection master; # Change Author: JBM # Change Date: 2005-12-22 # Change: Comment out the exec of the binlog so test works for both SBR and RBR -#--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR -#--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 +#--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +#--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001 # Let us check with LOAD DATA INFILE # (we do it after mysqlbinlog because the temp files names are not constant) connection master; delete from t1; set time_zone='UTC'; -load data infile '../../std_data/rpl_timezone2.dat' into table t1; +load data infile '../std_data_ln/rpl_timezone2.dat' into table t1; SELECT * FROM t1 ORDER BY n; sync_slave_with_master; set time_zone='UTC'; diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 7ffafe1374a..9cfe85d3bd4 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -387,7 +387,7 @@ DROP TABLE t1; flush tables; # Create a junk frm file on disk -system echo "this is a junk file for test" >> var/master-data/test/t1.frm ; +system echo "this is a junk file for test" >> $MYSQLTEST_VARDIR/master-data/test/t1.frm ; --replace_column 6 # 7 # 8 # 9 # SHOW TABLE STATUS like 't1'; --error 1033 diff --git a/mysql-test/t/sp-destruct.test b/mysql-test/t/sp-destruct.test index bb61f3383bc..25f87f9e661 100644 --- a/mysql-test/t/sp-destruct.test +++ b/mysql-test/t/sp-destruct.test @@ -16,9 +16,9 @@ --source include/not_windows.inc # Backup proc table ---system rm -rf var/master-data/mysql/backup ---system mkdir var/master-data/mysql/backup ---system cp var/master-data/mysql/proc.* var/master-data/mysql/backup/ +--system rm -rf $MYSQLTEST_VARDIR/master-data/mysql/backup +--system mkdir $MYSQLTEST_VARDIR/master-data/mysql/backup +--system cp $MYSQLTEST_VARDIR/master-data/mysql/proc.* $MYSQLTEST_VARDIR/master-data/mysql/backup/ use test; @@ -53,7 +53,7 @@ insert into t1 values (0); flush table mysql.proc; # Thrashing the .frm file ---system echo 'saljdlfa' > var/master-data/mysql/proc.frm +--system echo 'saljdlfa' > $MYSQLTEST_VARDIR/master-data/mysql/proc.frm --error ER_NOT_FORM_FILE call bug14233(); --error ER_NOT_FORM_FILE @@ -65,7 +65,7 @@ insert into t1 values (0); flush table mysql.proc; # Drop the mysql.proc table ---system rm var/master-data/mysql/proc.* +--system rm $MYSQLTEST_VARDIR/master-data/mysql/proc.* --error ER_NO_SUCH_TABLE call bug14233(); --error ER_NO_SUCH_TABLE @@ -74,8 +74,8 @@ create view v1 as select bug14233_f(); insert into t1 values (0); # Restore mysql.proc ---system mv var/master-data/mysql/backup/* var/master-data/mysql/ ---system rmdir var/master-data/mysql/backup +--system mv $MYSQLTEST_VARDIR/master-data/mysql/backup/* $MYSQLTEST_VARDIR/master-data/mysql/ +--system rmdir $MYSQLTEST_VARDIR/master-data/mysql/backup flush table mysql.proc; flush privileges; diff --git a/mysql-test/t/sp-prelocking.test b/mysql-test/t/sp-prelocking.test index bae144f51ac..edb8ae5b92d 100644 --- a/mysql-test/t/sp-prelocking.test +++ b/mysql-test/t/sp-prelocking.test @@ -234,9 +234,9 @@ select f3() // call sp1() // delimiter ;// -drop table t1,t2,t3; +drop view v1; +drop table t1,t2,t3,t4; drop function f1; drop function f2; drop function f3; drop procedure sp1; -drop view v1; diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test index 0b24881a056..223bc09b9fc 100644 --- a/mysql-test/t/sp-security.test +++ b/mysql-test/t/sp-security.test @@ -196,7 +196,6 @@ use db2; call q(); select * from t2; - # # BUG#6030: Stored procedure has no appropriate DROP privilege # (or ALTER for that matter) @@ -233,9 +232,13 @@ drop database db2; select type,db,name from mysql.proc; # Get rid of the users delete from mysql.user where user='user1' or user='user2'; +delete from mysql.user where user='' and host='%'; # And any routine privileges delete from mysql.procs_priv where user='user1' or user='user2'; - +# Delete the grants to user ''@'%' that was created above +delete from mysql.procs_priv where user='' and host='%'; +delete from mysql.db where user='user2'; +flush privileges; # # Test the new security acls # @@ -304,6 +307,9 @@ use test; drop database sptest; delete from mysql.user where user='usera' or user='userb' or user='userc'; delete from mysql.procs_priv where user='usera' or user='userb' or user='userc'; +delete from mysql.tables_priv where user='usera'; +flush privileges; +drop table t1; # # BUG#9503: reseting correct parameters of thread after error in SP function diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test index 4bfc4d17588..573fe0c1810 100644 --- a/mysql-test/t/subselect_innodb.test +++ b/mysql-test/t/subselect_innodb.test @@ -236,4 +236,5 @@ delimiter ;// call p1(); call p1(); call p1(); +drop procedure p1; drop tables t1,t2,t3; diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test index 6a6dd305006..19a720a4fb8 100644 --- a/mysql-test/t/symlink.test +++ b/mysql-test/t/symlink.test @@ -43,7 +43,7 @@ drop table t2; # disable_query_log; -eval create table t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="$MYSQL_TEST_DIR/var/tmp" index directory="$MYSQL_TEST_DIR/var/run"; +eval create table t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="$MYSQLTEST_VARDIR/tmp" index directory="$MYSQLTEST_VARDIR/run"; enable_query_log; insert into t9 select * from t1; @@ -52,7 +52,7 @@ optimize table t9; repair table t9; alter table t9 add column c int not null; ---replace_result $MYSQL_TEST_DIR TEST_DIR +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR show create table t9; # Test renames @@ -67,7 +67,7 @@ drop table t1; # Note that we are using the above table t9 here! # ---replace_result $MYSQL_TEST_DIR TEST_DIR +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR SHOW CREATE TABLE t9; disable_query_log; @@ -86,11 +86,11 @@ create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, p # Should fail becasue the file t9.MYI already exist in 'run' --error 1,1,1105 -eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="$MYSQL_TEST_DIR/var/run"; +eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="$MYSQLTEST_VARDIR/run"; # Should fail becasue the file t9.MYD already exist in 'tmp' --error 1,1 -eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="$MYSQL_TEST_DIR/var/tmp"; +eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="$MYSQLTEST_VARDIR/tmp"; enable_query_log; # Check moving table t9 from default database to mysqltest; @@ -98,7 +98,7 @@ enable_query_log; alter table t9 rename mysqltest.t9; select count(*) from mysqltest.t9; ---replace_result $MYSQL_TEST_DIR TEST_DIR +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR show create table mysqltest.t9; drop database mysqltest; @@ -108,18 +108,18 @@ drop database mysqltest; create table t1 (a int not null) engine=myisam; disable_query_log; -eval alter table t1 data directory="$MYSQL_TEST_DIR/var/tmp"; +eval alter table t1 data directory="$MYSQLTEST_VARDIR/tmp"; enable_query_log; ---replace_result $MYSQL_TEST_DIR TEST_DIR +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR show create table t1; alter table t1 add b int; disable_query_log; -eval alter table t1 data directory="$MYSQL_TEST_DIR/var/log"; +eval alter table t1 data directory="$MYSQLTEST_VARDIR/log"; enable_query_log; ---replace_result $MYSQL_TEST_DIR TEST_DIR +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR show create table t1; disable_query_log; -eval alter table t1 index directory="$MYSQL_TEST_DIR/var/log"; +eval alter table t1 index directory="$MYSQLTEST_VARDIR/log"; enable_query_log; show create table t1; drop table t1; @@ -129,12 +129,12 @@ drop table t1; # have been chosen. (Bug #8707) # disable_query_log; -eval create table t1 (i int) data directory = "$MYSQL_TEST_DIR/var/master-data/test/"; +eval create table t1 (i int) data directory = "$MYSQLTEST_VARDIR/master-data/test/"; enable_query_log; show create table t1; drop table t1; disable_query_log; -eval create table t1 (i int) index directory = "$MYSQL_TEST_DIR/var/master-data/test/"; +eval create table t1 (i int) index directory = "$MYSQLTEST_VARDIR/master-data/test/"; enable_query_log; show create table t1; drop table t1; diff --git a/mysql-test/t/temp_table-master.opt b/mysql-test/t/temp_table-master.opt index 026d3d4640c..5ac2ca8495b 100644 --- a/mysql-test/t/temp_table-master.opt +++ b/mysql-test/t/temp_table-master.opt @@ -1 +1 @@ ---tmpdir=$MYSQL_TEST_DIR/var//tmp +--tmpdir=$MYSQLTEST_VARDIR//tmp diff --git a/mysql-test/t/trigger-compat.test b/mysql-test/t/trigger-compat.test index 5b2483cc3ea..9f7fd8bc505 100644 --- a/mysql-test/t/trigger-compat.test +++ b/mysql-test/t/trigger-compat.test @@ -60,8 +60,8 @@ CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1 --echo --echo ---> patching t1.TRG... ---exec grep -v 'definers=' $MYSQL_TEST_DIR/var/master-data/mysqltest_db1/t1.TRG > $MYSQL_TEST_DIR/var/tmp/t1.TRG ---exec mv $MYSQL_TEST_DIR/var/tmp/t1.TRG $MYSQL_TEST_DIR/var/master-data/mysqltest_db1/t1.TRG +--exec grep -v 'definers=' $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG > $MYSQLTEST_VARDIR/tmp/t1.TRG +--exec mv $MYSQLTEST_VARDIR/tmp/t1.TRG $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG # # Create a new trigger. @@ -80,3 +80,16 @@ SELECT trigger_name, definer FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_n --echo SELECT * FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name; + +# Clean up +DROP TRIGGER wl2818_trg1; +DROP TRIGGER wl2818_trg2; +disconnect wl2818_definer_con; +connection default; +use mysqltest_db1; +DROP TABLE t1; +DROP TABLE t2; +DROP USER mysqltest_dfn@localhost; +DROP USER mysqltest_inv@localhost; +DROP DATABASE mysqltest_db1; + diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index f2d9bb6c856..492e37d9543 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -465,11 +465,11 @@ create trigger trg1 before insert on t1 for each row set new.k = new.i; create trigger trg2 after insert on t1 for each row set @b:= "Fired"; set @b:=""; # Test triggers with file with separators -load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, i); +load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, i); select *, @b from t1; set @b:=""; # Test triggers with fixed size row file -load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, j); +load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, j); select *, @b from t1; # This also will drop triggers drop table t1; @@ -503,7 +503,7 @@ delete from t1 where i = 2; select * from t1; # Should fail and insert only 1 row --error 1054 -load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k); +load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k); select * from t1; --error 1054 insert into t1 select 3, 3; @@ -563,7 +563,7 @@ select * from t1; delete from t1; select * from t1; --error 1054 -load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k); +load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k); select * from t1; --error 1054 insert into t1 select 3, 3; diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test index 0c45dea21bb..1f05a9574d6 100644 --- a/mysql-test/t/type_bit.test +++ b/mysql-test/t/type_bit.test @@ -226,3 +226,4 @@ select a1, a2, b1+0, b2+0 from t1 join t2 on b1 = b2; select sum(a1), b1+0, b2+0 from t1 join t2 on b1 = b2 group by b1 order by 1; select 1 from t1 join t2 on b1 = b2 group by b1 order by 1; select b1+0,sum(b1), sum(b2) from t1 join t2 on b1 = b2 group by b1 order by 1; +drop table t1, t2; diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index 79f29624e89..d223c315735 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -6,9 +6,7 @@ drop table if exists t1,t2; --enable_warnings ---replace_result e-0 e- e+0 e+ SELECT 10,10.0,10.,.1e+2,100.0e-1; ---replace_result e-00 e-0 SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000; SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1; SELECT 0.001e+1,0.001e-1, -0.001e+01,-0.001e-01; @@ -21,7 +19,6 @@ create table t1 (f1 float(24),f2 float(52)); show full columns from t1; insert into t1 values(10,10),(1e+5,1e+5),(1234567890,1234567890),(1e+10,1e+10),(1e+15,1e+15),(1e+20,1e+20),(1e+50,1e+50),(1e+150,1e+150); insert into t1 values(-10,-10),(1e-5,1e-5),(1e-10,1e-10),(1e-15,1e-15),(1e-20,1e-20),(1e-50,1e-50),(1e-150,1e-150); ---replace_result e-0 e- e+0 e+ select * from t1; drop table t1; diff --git a/mysql-test/t/type_varchar.test b/mysql-test/t/type_varchar.test index 2d2314f0a29..e5614afe4f6 100644 --- a/mysql-test/t/type_varchar.test +++ b/mysql-test/t/type_varchar.test @@ -3,7 +3,7 @@ drop table if exists t1, t2; --enable_warnings create table t1 (v varchar(30), c char(3), e enum('abc','def','ghi'), t text); -system cp std_data/vchar.frm var/master-data/test/; +system cp $MYSQL_TEST_DIR/std_data/vchar.frm $MYSQLTEST_VARDIR/master-data/test/; truncate table vchar; show create table t1; show create table vchar; diff --git a/mysql-test/t/user_var-binlog.test b/mysql-test/t/user_var-binlog.test index a3128064c91..a7726c990f1 100644 --- a/mysql-test/t/user_var-binlog.test +++ b/mysql-test/t/user_var-binlog.test @@ -19,7 +19,7 @@ show binlog events from 102; # absolutely need variables names to be quoted and strings to be # escaped). --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001 drop table t1; # End of 4.1 tests diff --git a/mysql-test/t/variables-master.opt b/mysql-test/t/variables-master.opt index a0577107f74..abd826bc7fa 100644 --- a/mysql-test/t/variables-master.opt +++ b/mysql-test/t/variables-master.opt @@ -1 +1 @@ ---max_join_size=10 +--max_join_size=100 diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 76761f9177d..eb3273a9e9b 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -20,7 +20,6 @@ select @test, @`test`, @TEST, @`TEST`, @"teSt"; set @select=2,@t5=1.23456; select @`select`,@not_used; set @test_int=10,@test_double=1e-10,@test_string="abcdeghi",@test_string2="abcdefghij",@select=NULL; ---replace_result e-0 e- e+0 e+ select @test_int,@test_double,@test_string,@test_string2,@select; set @test_int="hello",@test_double="hello",@test_string="hello",@test_string2="hello"; select @test_int,@test_double,@test_string,@test_string2; @@ -48,7 +47,7 @@ drop table t1; # # Test system variables # - +set GLOBAL max_join_size=10; set max_join_size=100; show variables like 'max_join_size'; --replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 33741b9bf46..d5aff94e47c 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -1221,11 +1221,11 @@ drop table t1; create table t1 (a int, b char(10)); create view v1 as select * from t1 where a != 0 with check option; -- error 1369 -load data infile '../../std_data/loaddata3.dat' into table v1 fields terminated by '' enclosed by '' ignore 1 lines; +load data infile '../std_data_ln/loaddata3.dat' into table v1 fields terminated by '' enclosed by '' ignore 1 lines; select * from t1; select * from v1; delete from t1; -load data infile '../../std_data/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines; +load data infile '../std_data_ln/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines; select * from t1; select * from v1; drop view v1; @@ -1234,11 +1234,11 @@ drop table t1; create table t1 (a text, b text); create view v1 as select * from t1 where a <> 'Field A' with check option; -- error 1369 -load data infile '../../std_data/loaddata2.dat' into table v1 fields terminated by ',' enclosed by ''''; +load data infile '../std_data_ln/loaddata2.dat' into table v1 fields terminated by ',' enclosed by ''''; select concat('|',a,'|'), concat('|',b,'|') from t1; select concat('|',a,'|'), concat('|',b,'|') from v1; delete from t1; -load data infile '../../std_data/loaddata2.dat' ignore into table v1 fields terminated by ',' enclosed by ''''; +load data infile '../std_data_ln/loaddata2.dat' ignore into table v1 fields terminated by ',' enclosed by ''''; select concat('|',a,'|'), concat('|',b,'|') from t1; select concat('|',a,'|'), concat('|',b,'|') from v1; drop view v1; diff --git a/mysql-test/t/view_grant.test b/mysql-test/t/view_grant.test index 26a4a7e1ec5..1327436d6c3 100644 --- a/mysql-test/t/view_grant.test +++ b/mysql-test/t/view_grant.test @@ -12,6 +12,8 @@ grant create view on test.* to test@localhost; show grants for test@localhost; revoke create view on test.* from test@localhost; show grants for test@localhost; +# The grant above creates a new user test@localhost, delete it +drop user test@localhost; # grant create view test # diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test index f65ce962ef2..e0563cc97b5 100644 --- a/mysql-test/t/warnings.test +++ b/mysql-test/t/warnings.test @@ -50,7 +50,7 @@ drop table t1; # create table t1(a tinyint, b int not null, c date, d char(5)); -load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ','; +load data infile '../std_data_ln/warnings_loaddata.dat' into table t1 fields terminated by ','; # PS doesn't work good with @@warning_count --disable_ps_protocol select @@warning_count; |