Commit aecdac4a authored by Patrick Crews's avatar Patrick Crews

Bug#38311 Some tests use 'rm' which is not portable

Substituted use of MTR's remove_file function in the tests
Started with 5.0 tree and will clean up any offenders discovered during upmerge.
parent b7160ad4
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults $ndb_restore_opts -b $the_backup_id -n 1 $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id $ndb_restore_filter > $MYSQLTEST_VARDIR/tmp/tmp.dat --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults $ndb_restore_opts -b $the_backup_id -n 1 $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id $ndb_restore_filter > $MYSQLTEST_VARDIR/tmp/tmp.dat
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults $ndb_restore_opts -b $the_backup_id -n 2 $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id $ndb_restore_filter >> $MYSQLTEST_VARDIR/tmp/tmp.dat --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults $ndb_restore_opts -b $the_backup_id -n 2 $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id $ndb_restore_filter >> $MYSQLTEST_VARDIR/tmp/tmp.dat
--exec sort $MYSQLTEST_VARDIR/tmp/tmp.dat --exec sort $MYSQLTEST_VARDIR/tmp/tmp.dat
--exec rm -f $MYSQLTEST_VARDIR/tmp/tmp.dat --error 0,1
--remove_file $MYSQLTEST_VARDIR/tmp/tmp.dat
--let ndb_restore_opts= --let ndb_restore_opts=
--let ndb_restore_filter= --let ndb_restore_filter=
...@@ -30,7 +30,7 @@ let $error_code= `select @a like "%#%error_code=0%" /* must return 1 */`; ...@@ -30,7 +30,7 @@ let $error_code= `select @a like "%#%error_code=0%" /* must return 1 */`;
eval select $error_code /* must return 1 as query completed before got killed*/; eval select $error_code /* must return 1 as query completed before got killed*/;
# cleanup for the sub-case # cleanup for the sub-case
system rm $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog; remove_file $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog;
# #
...@@ -58,7 +58,7 @@ let $error_code= `select @a like "%#%error_code=0%" /* must return 0*/`; ...@@ -58,7 +58,7 @@ let $error_code= `select @a like "%#%error_code=0%" /* must return 0*/`;
eval select $error_code /* must return 0 to mean the killed query is in */; eval select $error_code /* must return 0 to mean the killed query is in */;
# cleanup for the sub-case # cleanup for the sub-case
system rm $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog; remove_file $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog;
drop table t1,t2; drop table t1,t2;
......
...@@ -21,4 +21,4 @@ select * from t2; ...@@ -21,4 +21,4 @@ select * from t2;
# clean up # clean up
drop table t1,t2; drop table t1,t2;
#--system rm $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog #--remove_file $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog
...@@ -79,7 +79,8 @@ delete from t1; ...@@ -79,7 +79,8 @@ delete from t1;
--eval select hex(load_file('$MYSQLTEST_VARDIR/master-data/test/t1.txt')); --eval select hex(load_file('$MYSQLTEST_VARDIR/master-data/test/t1.txt'));
load data infile 't1.txt' into table t1; load data infile 't1.txt' into table t1;
select hex(a) from t1; select hex(a) from t1;
--exec rm $MYSQLTEST_VARDIR/master-data/test/t1.txt --remove_file $MYSQLTEST_VARDIR/master-data/test/t1.txt
drop table t1; drop table t1;
--echo End of 5.0 tests --echo End of 5.0 tests
...@@ -492,12 +492,12 @@ DROP TABLE t1; ...@@ -492,12 +492,12 @@ DROP TABLE t1;
#SELECT DISTINCT fruit_id, fruit_name INTO OUTFILE #SELECT DISTINCT fruit_id, fruit_name INTO OUTFILE
#'../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE'; #'../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE';
#LOAD DATA INFILE '../tmp/data1.tmp' INTO TABLE t2; #LOAD DATA INFILE '../tmp/data1.tmp' INTO TABLE t2;
#--exec rm $MYSQL_TEST_DIR/var/tmp/data1.tmp #--remove_file $MYSQL_TEST_DIR/var/tmp/data1.tmp
# #
#SELECT DISTINCT @v19:= fruit_id, @v20:= fruit_name INTO OUTFILE #SELECT DISTINCT @v19:= fruit_id, @v20:= fruit_name INTO OUTFILE
#'../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE'; #'../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE';
#LOAD DATA INFILE '../tmp/data2.tmp' INTO TABLE t2; #LOAD DATA INFILE '../tmp/data2.tmp' INTO TABLE t2;
#--exec rm $MYSQL_TEST_DIR/var/tmp/data2.tmp #--remove_file $MYSQL_TEST_DIR/var/tmp/data2.tmp
# #
#SELECT @v19, @v20; #SELECT @v19, @v20;
#SELECT * FROM t2; #SELECT * FROM t2;
......
...@@ -24,7 +24,7 @@ create table t1( ...@@ -24,7 +24,7 @@ create table t1(
insert into t1 values(1, "Autodiscover"); insert into t1 values(1, "Autodiscover");
flush tables; flush tables;
system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ; remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
select * from t1; select * from t1;
show status like 'handler_discover%'; show status like 'handler_discover%';
...@@ -33,13 +33,13 @@ show status like 'handler_discover%'; ...@@ -33,13 +33,13 @@ show status like 'handler_discover%';
# #
flush tables; flush tables;
system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ; remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
insert into t1 values (2, "Auto 2"); insert into t1 values (2, "Auto 2");
show status like 'handler_discover%'; show status like 'handler_discover%';
insert into t1 values (3, "Discover 3"); insert into t1 values (3, "Discover 3");
show status like 'handler_discover%'; show status like 'handler_discover%';
flush tables; flush tables;
system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ; remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
select * from t1 order by id; select * from t1 order by id;
show status like 'handler_discover%'; show status like 'handler_discover%';
...@@ -48,7 +48,7 @@ show status like 'handler_discover%'; ...@@ -48,7 +48,7 @@ show status like 'handler_discover%';
# #
flush tables; flush tables;
system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ; remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
update t1 set name="Autodiscover" where id = 2; update t1 set name="Autodiscover" where id = 2;
show status like 'handler_discover%'; show status like 'handler_discover%';
select * from t1 order by id; select * from t1 order by id;
...@@ -59,7 +59,7 @@ show status like 'handler_discover%'; ...@@ -59,7 +59,7 @@ show status like 'handler_discover%';
# #
flush tables; flush tables;
system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ; remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
delete from t1 where id = 3; delete from t1 where id = 3;
select * from t1 order by id; select * from t1 order by id;
show status like 'handler_discover%'; show status like 'handler_discover%';
...@@ -111,7 +111,7 @@ show status like 'handler_discover%'; ...@@ -111,7 +111,7 @@ show status like 'handler_discover%';
flush tables; flush tables;
# Remove the frm file from disk # Remove the frm file from disk
system rm $MYSQLTEST_VARDIR/master-data/test/t3.frm ; remove_file $MYSQLTEST_VARDIR/master-data/test/t3.frm ;
--error 1050 --error 1050
create table t3( create table t3(
...@@ -168,14 +168,14 @@ show status like 'handler_discover%'; ...@@ -168,14 +168,14 @@ show status like 'handler_discover%';
# Remove the frm file from disk # Remove the frm file from disk
flush tables; flush tables;
system rm $MYSQLTEST_VARDIR/master-data/test/t7.frm ; remove_file $MYSQLTEST_VARDIR/master-data/test/t7.frm ;
show tables from test; show tables from test;
show status like 'handler_discover%'; show status like 'handler_discover%';
# Remove the frm file from disk again # Remove the frm file from disk again
flush tables; flush tables;
system rm $MYSQLTEST_VARDIR/master-data/test/t7.frm ; remove_file $MYSQLTEST_VARDIR/master-data/test/t7.frm ;
--replace_column 7 # 8 # 9 # 12 # 13 # 15 # 18 # --replace_column 7 # 8 # 9 # 12 # 13 # 15 # 18 #
show table status; show table status;
...@@ -290,8 +290,8 @@ insert into t9 values (9); ...@@ -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 t3 >> $NDB_TOOLS_OUTPUT ;
system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 >> $NDB_TOOLS_OUTPUT ; system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 >> $NDB_TOOLS_OUTPUT ;
# Remove t6, t7 from disk # Remove t6, t7 from disk
system rm $MYSQLTEST_VARDIR/master-data/test/t6.frm > /dev/null ; remove_file $MYSQLTEST_VARDIR/master-data/test/t6.frm > /dev/null ;
system rm $MYSQLTEST_VARDIR/master-data/test/t7.frm > /dev/null ; remove_file $MYSQLTEST_VARDIR/master-data/test/t7.frm > /dev/null ;
SHOW TABLES; SHOW TABLES;
...@@ -332,8 +332,8 @@ insert into t9 values (9); ...@@ -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 t3 > /dev/null ;
system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 > /dev/null ; system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 > /dev/null ;
# Remove t6, t7 from disk # Remove t6, t7 from disk
system rm $MYSQLTEST_VARDIR/master-data/test/t6.frm > /dev/null ; remove_file $MYSQLTEST_VARDIR/master-data/test/t6.frm > /dev/null ;
system rm $MYSQLTEST_VARDIR/master-data/test/t7.frm > /dev/null ; remove_file $MYSQLTEST_VARDIR/master-data/test/t7.frm > /dev/null ;
SHOW TABLES LIKE 't6'; SHOW TABLES LIKE 't6';
...@@ -375,9 +375,9 @@ insert into t3 values (3, "ndb table 3"); ...@@ -375,9 +375,9 @@ insert into t3 values (3, "ndb table 3");
insert into t4 values (4); insert into t4 values (4);
# Remove t1, t2, t3 from disk # Remove t1, t2, t3 from disk
system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm > /dev/null ; remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm > /dev/null ;
system rm $MYSQLTEST_VARDIR/master-data/test/t2.frm > /dev/null ; remove_file $MYSQLTEST_VARDIR/master-data/test/t2.frm > /dev/null ;
system rm $MYSQLTEST_VARDIR/master-data/test/t3.frm > /dev/null ; remove_file $MYSQLTEST_VARDIR/master-data/test/t3.frm > /dev/null ;
flush tables; flush tables;
# Select from the table which only exists in NDB. # Select from the table which only exists in NDB.
...@@ -531,7 +531,7 @@ CREATE TABLE t9 ( ...@@ -531,7 +531,7 @@ CREATE TABLE t9 (
insert t9 values(1, 2), (2,3), (3, 4), (4, 5); insert t9 values(1, 2), (2,3), (3, 4), (4, 5);
#Don't drop the table, instead remove the frm file #Don't drop the table, instead remove the frm file
system rm $MYSQLTEST_VARDIR/master-data/test/t9.frm ; remove_file $MYSQLTEST_VARDIR/master-data/test/t9.frm ;
# Now leave test case, when ndb_autodiscover2 will run, this # Now leave test case, when ndb_autodiscover2 will run, this
# MySQL Server will have been restarted because it has a # MySQL Server will have been restarted because it has a
......
...@@ -25,7 +25,7 @@ create table t1(a int) engine=ndb; ...@@ -25,7 +25,7 @@ create table t1(a int) engine=ndb;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval load data local infile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1; eval load data local infile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
select count(*) from t1; select count(*) from t1;
system rm $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile ; remove_file $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile ;
drop table t1; drop table t1;
create table t1(a int) engine=myisam; create table t1(a int) engine=myisam;
...@@ -37,7 +37,7 @@ drop table t1; ...@@ -37,7 +37,7 @@ drop table t1;
create table t1(a int primary key) engine=ndb; create table t1(a int primary key) engine=ndb;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval load data local infile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1; eval load data local infile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
system rm $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile; remove_file $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile;
select * from t1 order by a; select * from t1 order by a;
drop table t1; drop table t1;
...@@ -50,7 +50,7 @@ drop table t1; ...@@ -50,7 +50,7 @@ drop table t1;
create table t1(a int primary key) engine=ndb; create table t1(a int primary key) engine=ndb;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval load data local infile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1; eval load data local infile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
system rm $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile; remove_file $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile;
select * from t1 order by a; select * from t1 order by a;
drop table t1; drop table t1;
...@@ -63,7 +63,7 @@ drop table t1; ...@@ -63,7 +63,7 @@ drop table t1;
create table t1(a int primary key) engine=ndb; create table t1(a int primary key) engine=ndb;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval load data local infile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1; eval load data local infile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
system rm $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile; remove_file $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile;
select * from t1 order by a; select * from t1 order by a;
drop table t1; drop table t1;
......
...@@ -134,10 +134,14 @@ insert into t4 values (1,31),(2,32),(3,33),(4,34),(5,35); ...@@ -134,10 +134,14 @@ insert into t4 values (1,31),(2,32),(3,33),(4,34),(5,35);
--let ndb_restore_filter=test t1 --let ndb_restore_filter=test t1
--source include/ndb_backup_print.inc --source include/ndb_backup_print.inc
--exec rm -f $MYSQLTEST_VARDIR/tmp/t1.txt --error 0,1
--exec rm -f $MYSQLTEST_VARDIR/tmp/t2.txt --remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
--exec rm -f $MYSQLTEST_VARDIR/tmp/t3.txt --error 0,1
--exec rm -f $MYSQLTEST_VARDIR/tmp/t4.txt --remove_file $MYSQLTEST_VARDIR/tmp/t2.txt
--error 0,1
--remove_file $MYSQLTEST_VARDIR/tmp/t3.txt
--error 0,1
--remove_file $MYSQLTEST_VARDIR/tmp/t4.txt
--let ndb_restore_opts=--verbose=0 --print_data --hex --tab $MYSQLTEST_VARDIR/tmp --append --let ndb_restore_opts=--verbose=0 --print_data --hex --tab $MYSQLTEST_VARDIR/tmp --append
--let ndb_restore_filter=test --let ndb_restore_filter=test
...@@ -156,10 +160,10 @@ insert into t4 values (1,31),(2,32),(3,33),(4,34),(5,35); ...@@ -156,10 +160,10 @@ insert into t4 values (1,31),(2,32),(3,33),(4,34),(5,35);
--source include/show_msg.inc --source include/show_msg.inc
--exec sort $MYSQLTEST_VARDIR/tmp/t4.txt --exec sort $MYSQLTEST_VARDIR/tmp/t4.txt
--exec rm -f $MYSQLTEST_VARDIR/tmp/t1.txt --remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
--exec rm -f $MYSQLTEST_VARDIR/tmp/t2.txt --remove_file $MYSQLTEST_VARDIR/tmp/t2.txt
--exec rm -f $MYSQLTEST_VARDIR/tmp/t3.txt --remove_file $MYSQLTEST_VARDIR/tmp/t3.txt
--exec rm -f $MYSQLTEST_VARDIR/tmp/t4.txt --remove_file $MYSQLTEST_VARDIR/tmp/t4.txt
# now test some other datatypes # now test some other datatypes
drop table t1; drop table t1;
......
...@@ -125,7 +125,7 @@ from information_schema.schemata ...@@ -125,7 +125,7 @@ from information_schema.schemata
where schema_name like 'mysqltest'; where schema_name like 'mysqltest';
connection default; connection default;
--exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.4 --remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
use test; use test;
revoke all privileges on *.* from user_1@localhost; revoke all privileges on *.* from user_1@localhost;
drop user user_1@localhost; drop user user_1@localhost;
......
...@@ -6,9 +6,11 @@ ...@@ -6,9 +6,11 @@
source include/master-slave.inc; source include/master-slave.inc;
create table t1 (a int) engine=myisam; create table t1 (a int) engine=myisam;
flush tables; flush tables;
system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYI ; --remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYI
drop table if exists t1; drop table if exists t1;
save_master_pos; save_master_pos;
connection slave; connection slave;
......
...@@ -25,7 +25,7 @@ eval select * into outfile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.sele ...@@ -25,7 +25,7 @@ eval select * into outfile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.sele
truncate table t1; truncate table t1;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval load data local infile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1; 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 ; --remove_file $MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile
save_master_pos; save_master_pos;
connection slave; connection slave;
sync_with_master; sync_with_master;
...@@ -52,7 +52,7 @@ drop table t1; ...@@ -52,7 +52,7 @@ drop table t1;
create table t1(a int primary key); create table t1(a int primary key);
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval load data local infile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1; 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 ; remove_file $MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile ;
select * from t1; select * from t1;
save_master_pos; save_master_pos;
connection slave; connection slave;
......
...@@ -185,7 +185,8 @@ drop table t1; ...@@ -185,7 +185,8 @@ drop table t1;
# #
# Protect ourselves from data left in tmp/ by a previos possibly failed # Protect ourselves from data left in tmp/ by a previos possibly failed
# test # test
--system rm -f $MYSQLTEST_VARDIR/tmp/t1.* --error 0,1
--remove_file $MYSQLTEST_VARDIR/tmp/t1.*
--disable_query_log --disable_query_log
eval prepare stmt from "create table t1 (c char(10)) data directory='$MYSQLTEST_VARDIR/tmp'"; eval prepare stmt from "create table t1 (c char(10)) data directory='$MYSQLTEST_VARDIR/tmp'";
--enable_query_log --enable_query_log
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment