List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:September 23 2008 6:31am
Subject:Re: bzr commit into mysql-5.1-bugteam branch (patrick.crews:2683) Bug#38311
View as plain text  
Hi Patrick,

thanks for working on this!

Could you elaborate please: in the bug report you added a comment
that 'rm -f' can't be replaced with 'remove_file', but in this patch you
do exactly this. Has 'remove_file' semantic change?

Thanks!

On Sep 20, 2008, at 09:21 , Patrick Crews wrote:

> #At file:///Users/pcrews/usr/local/bin/data1/work/fix_rm/mysql-5.0-bugteam/
>
> 2683 Patrick Crews	2008-09-20
>      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.
> modified:
>  mysql-test/include/ndb_backup_print.inc
>  mysql-test/t/binlog_killed_simulate.test
>  mysql-test/t/binlog_start_comment.test
>  mysql-test/t/ctype_big5.test
>  mysql-test/t/distinct.test
>  mysql-test/t/ndb_autodiscover.test
>  mysql-test/t/ndb_loaddatalocal.test
>  mysql-test/t/ndb_restore_print.test
>  mysql-test/t/outfile.test
>  mysql-test/t/rpl_EE_error.test
>  mysql-test/t/rpl_loaddatalocal.test
>  mysql-test/t/symlink.test
>
> === modified file 'mysql-test/include/ndb_backup_print.inc'
> --- a/mysql-test/include/ndb_backup_print.inc	2007-03-07 06:19:37  
> +0000
> +++ b/mysql-test/include/ndb_backup_print.inc	2008-09-20 06:21:28  
> +0000
> @@ -1,6 +1,7 @@
> --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 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_filter=
>
> === modified file 'mysql-test/t/binlog_killed_simulate.test'
> --- a/mysql-test/t/binlog_killed_simulate.test	2007-11-06 11:53:26  
> +0000
> +++ b/mysql-test/t/binlog_killed_simulate.test	2008-09-20 06:21:28  
> +0000
> @@ -30,7 +30,7 @@ let $error_code= `select @a like "%#%err
> eval select $error_code /* must return 1 as query completed before  
> got killed*/;
>
> # 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 "%#%err
> eval select $error_code /* must return 0 to mean the killed query is  
> in */;
>
> # 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;
>
> === modified file 'mysql-test/t/binlog_start_comment.test'
> --- a/mysql-test/t/binlog_start_comment.test	2008-02-01 12:18:27 +0000
> +++ b/mysql-test/t/binlog_start_comment.test	2008-09-20 06:21:28 +0000
> @@ -21,4 +21,4 @@ select * from t2;
>
> # clean up
> drop table t1,t2;
> -#--system rm $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog
> +#--remove_file $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog
>
> === modified file 'mysql-test/t/ctype_big5.test'
> --- a/mysql-test/t/ctype_big5.test	2008-02-04 07:10:40 +0000
> +++ b/mysql-test/t/ctype_big5.test	2008-09-20 06:21:28 +0000
> @@ -79,7 +79,8 @@ delete from t1;
> --eval select hex(load_file('$MYSQLTEST_VARDIR/master-data/test/ 
> t1.txt'));
> load data infile 't1.txt' into table 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;
>
> --echo End of 5.0 tests
>
> === modified file 'mysql-test/t/distinct.test'
> --- a/mysql-test/t/distinct.test	2007-04-10 13:55:48 +0000
> +++ b/mysql-test/t/distinct.test	2008-09-20 06:21:28 +0000
> @@ -492,12 +492,12 @@ DROP TABLE t1;
> #SELECT DISTINCT fruit_id, fruit_name INTO OUTFILE
> #'../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE';
> #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
> #'../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE';
> #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 * FROM t2;
>
> === modified file 'mysql-test/t/ndb_autodiscover.test'
> --- a/mysql-test/t/ndb_autodiscover.test	2008-02-21 12:23:58 +0000
> +++ b/mysql-test/t/ndb_autodiscover.test	2008-09-20 06:21:28 +0000
> @@ -24,7 +24,7 @@ create table t1(
>
> insert into t1 values(1, "Autodiscover");
> flush tables;
> -system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
> +remove_file $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 $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
> +remove_file $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 $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
> +remove_file $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 $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
> +remove_file $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 $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
> +remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
> delete from  t1 where id = 3;
> select * from t1 order by id;
> show status like 'handler_discover%';
> @@ -111,7 +111,7 @@ show status like 'handler_discover%';
> flush tables;
>
> # 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
> create table t3(
> @@ -168,14 +168,14 @@ show status like 'handler_discover%';
>
> # Remove the frm file from disk
> 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 status like 'handler_discover%';
>
> # Remove the frm file from disk again
> 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 #
> 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 $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/t6.frm > /dev/null ;
> +remove_file $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 $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/t6.frm > /dev/null ;
> +remove_file $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 $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 ;
> +remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm > /dev/null ;
> +remove_file $MYSQLTEST_VARDIR/master-data/test/t2.frm > /dev/null ;
> +remove_file $MYSQLTEST_VARDIR/master-data/test/t3.frm > /dev/null ;
> flush tables;
>
> # Select from the table which only exists in NDB.
> @@ -531,7 +531,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 $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
> # MySQL Server will have been restarted because it has a
>
> === modified file 'mysql-test/t/ndb_loaddatalocal.test'
> --- a/mysql-test/t/ndb_loaddatalocal.test	2006-06-14 18:16:32 +0000
> +++ b/mysql-test/t/ndb_loaddatalocal.test	2008-09-20 06:21:28 +0000
> @@ -25,7 +25,7 @@ create table t1(a int) engine=ndb;
> --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
> eval load data local infile '$MYSQLTEST_VARDIR/master-data/ 
> ndb_loaddatalocal.select_outfile' into table 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;
>
> create table t1(a int) engine=myisam;
> @@ -37,7 +37,7 @@ drop table t1;
> create table t1(a int primary key) engine=ndb;
> --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
> 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;
> drop table t1;
>
> @@ -50,7 +50,7 @@ drop table t1;
> create table t1(a int primary key) engine=ndb;
> --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
> 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;
> drop table t1;
>
> @@ -63,7 +63,7 @@ drop table t1;
> create table t1(a int primary key) engine=ndb;
> --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
> 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;
> drop table t1;
>
>
> === modified file 'mysql-test/t/ndb_restore_print.test'
> --- a/mysql-test/t/ndb_restore_print.test	2007-03-08 08:37:53 +0000
> +++ b/mysql-test/t/ndb_restore_print.test	2008-09-20 06:21:28 +0000
> @@ -134,10 +134,14 @@ insert into t4 values (1,31),(2,32),(3,3
> --let ndb_restore_filter=test t1
> --source include/ndb_backup_print.inc
>
> ---exec rm -f $MYSQLTEST_VARDIR/tmp/t1.txt
> ---exec rm -f $MYSQLTEST_VARDIR/tmp/t2.txt
> ---exec rm -f $MYSQLTEST_VARDIR/tmp/t3.txt
> ---exec rm -f $MYSQLTEST_VARDIR/tmp/t4.txt
> +--error 0,1
> +--remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
> +--error 0,1
> +--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_filter=test
> @@ -156,10 +160,10 @@ insert into t4 values (1,31),(2,32),(3,3
> --source include/show_msg.inc
> --exec sort $MYSQLTEST_VARDIR/tmp/t4.txt
>
> ---exec rm -f $MYSQLTEST_VARDIR/tmp/t1.txt
> ---exec rm -f $MYSQLTEST_VARDIR/tmp/t2.txt
> ---exec rm -f $MYSQLTEST_VARDIR/tmp/t3.txt
> ---exec rm -f $MYSQLTEST_VARDIR/tmp/t4.txt
> +--remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
> +--remove_file $MYSQLTEST_VARDIR/tmp/t2.txt
> +--remove_file $MYSQLTEST_VARDIR/tmp/t3.txt
> +--remove_file $MYSQLTEST_VARDIR/tmp/t4.txt
>
> # now test some other datatypes
> drop table t1;
>
> === modified file 'mysql-test/t/outfile.test'
> --- a/mysql-test/t/outfile.test	2007-05-17 20:17:50 +0000
> +++ b/mysql-test/t/outfile.test	2008-09-20 06:21:28 +0000
> @@ -125,7 +125,7 @@ from information_schema.schemata
> where schema_name like 'mysqltest';
>
> connection default;
> ---exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.4
> +--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
> use test;
> revoke all privileges on *.* from user_1@localhost;
> drop user user_1@localhost;
>
> === modified file 'mysql-test/t/rpl_EE_error.test'
> --- a/mysql-test/t/rpl_EE_error.test	2006-01-24 07:30:54 +0000
> +++ b/mysql-test/t/rpl_EE_error.test	2008-09-20 06:21:28 +0000
> @@ -6,9 +6,11 @@
>
> source include/master-slave.inc;
>
> +
> create table t1 (a int) engine=myisam;
> 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;
> save_master_pos;
> connection slave;
>
> === modified file 'mysql-test/t/rpl_loaddatalocal.test'
> --- a/mysql-test/t/rpl_loaddatalocal.test	2006-10-05 16:45:40 +0000
> +++ b/mysql-test/t/rpl_loaddatalocal.test	2008-09-20 06:21:28 +0000
> @@ -25,7 +25,7 @@ eval select * into outfile '$MYSQLTEST_V
> truncate table t1;
> --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 ;
> +--remove_file $MYSQLTEST_VARDIR/master-data/ 
> rpl_loaddatalocal.select_outfile
> save_master_pos;
> connection slave;
> sync_with_master;
> @@ -52,7 +52,7 @@ drop table t1;
> create table t1(a int primary key);
> --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 ;
> +remove_file $MYSQLTEST_VARDIR/master-data/ 
> rpl_loaddatalocal.select_outfile ;
> select * from t1;
> save_master_pos;
> connection slave;
>
> === modified file 'mysql-test/t/symlink.test'
> --- a/mysql-test/t/symlink.test	2008-08-26 09:21:07 +0000
> +++ b/mysql-test/t/symlink.test	2008-09-20 06:21:28 +0000
> @@ -185,7 +185,8 @@ drop table t1;
> #
> # Protect ourselves from data left in tmp/ by a previos possibly  
> failed
> # test
> ---system rm -f $MYSQLTEST_VARDIR/tmp/t1.*
> +--error 0,1
> +--remove_file $MYSQLTEST_VARDIR/tmp/t1.*
> --disable_query_log
> eval prepare stmt from "create table t1 (c char(10)) data  
> directory='$MYSQLTEST_VARDIR/tmp'";
> --enable_query_log
>
>
> -- 
> MySQL Code Commits Mailing List
> For list archives: http://lists.mysql.com/commits
> To unsubscribe:    http://lists.mysql.com/commits?unsub=1
>

Thread
bzr commit into mysql-5.1-bugteam branch (patrick.crews:2683) Bug#38311Patrick Crews20 Sep
  • Re: bzr commit into mysql-5.1-bugteam branch (patrick.crews:2683) Bug#38311Alexander Nozdrin23 Sep