MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:msvensson Date:October 22 2007 8:56am
Subject:bk commit into 5.0 tree (msvensson:1.2523) BUG#31741
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-10-22 10:56:26+02:00, msvensson@stripped +10 -0
  Bug#31741 mysqltest - deprecate "system" command

  client/mysqltest.c@stripped, 2007-10-22 10:56:22+02:00, msvensson@stripped +4 -78
    Deprecate "system" command

  mysql-test/r/mysqltest.result@stripped, 2007-10-22 10:56:23+02:00, msvensson@stripped +0 -4
    Remove tests for "system"

  mysql-test/t/mysqltest.test@stripped, 2007-10-22 10:56:23+02:00, msvensson@stripped +2 -15
    Remove tests for "system"

  mysql-test/t/ndb_autodiscover.test@stripped, 2007-10-22 10:56:23+02:00, msvensson@stripped +27 -24
    Replace use of system with the portable construct

  mysql-test/t/ndb_loaddatalocal.test@stripped, 2007-10-22 10:56:23+02:00, msvensson@stripped +4 -4
    Replace use of system with the portable construct

  mysql-test/t/repair.test@stripped, 2007-10-22 10:56:23+02:00, msvensson@stripped +4 -1
    Replace use of system with the portable construct

  mysql-test/t/rpl_EE_error.test@stripped, 2007-10-22 10:56:23+02:00, msvensson@stripped +1 -1
    Replace use of system with the portable construct

  mysql-test/t/rpl_loaddatalocal.test@stripped, 2007-10-22 10:56:23+02:00, msvensson@stripped +2 -2
    Replace use of system with the portable construct

  mysql-test/t/show_check.test@stripped, 2007-10-22 10:56:23+02:00, msvensson@stripped +3 -1
    Replace use of system with the portable construct

  mysql-test/t/system_mysql_db_fix30020.test@stripped, 2007-10-22 10:56:23+02:00, msvensson@stripped +2 -2
    Replace use of system with the portable construct

diff -Nrup a/client/mysqltest.c b/client/mysqltest.c
--- a/client/mysqltest.c	2007-08-28 16:47:04 +02:00
+++ b/client/mysqltest.c	2007-10-22 10:56:22 +02:00
@@ -2513,83 +2513,6 @@ int do_modify_var(struct st_command *com
 
 
 /*
-  Wrapper for 'system' function
-
-  NOTE
-  If mysqltest is executed from cygwin shell, the command will be
-  executed in the "windows command interpreter" cmd.exe and we prepend "sh"
-  to make it be executed by cygwins "bash". Thus commands like "rm",
-  "mkdir" as well as shellscripts can executed by "system" in Windows.
-
-*/
-
-int my_system(DYNAMIC_STRING* ds_cmd)
-{
-#if defined __WIN__ && defined USE_CYGWIN
-  /* Dump the command into a sh script file and execute with system */
-  str_to_file(tmp_sh_name, ds_cmd->str, ds_cmd->length);
-  return system(tmp_sh_cmd);
-#else
-  return system(ds_cmd->str);
-#endif
-}
-
-
-/*
-  SYNOPSIS
-  do_system
-  command	called command
-
-  DESCRIPTION
-  system <command>
-
-  Eval the query to expand any $variables in the command.
-  Execute the command with the "system" command.
-
-*/
-
-void do_system(struct st_command *command)
-{
-  DYNAMIC_STRING ds_cmd;
-  DBUG_ENTER("do_system");
-
-  if (strlen(command->first_argument) == 0)
-    die("Missing arguments to system, nothing to do!");
-
-  init_dynamic_string(&ds_cmd, 0, command->query_len + 64, 256);
-
-  /* Eval the system command, thus replacing all environment variables */
-  do_eval(&ds_cmd, command->first_argument, command->end, !is_windows);
-
-#ifdef __WIN__
-#ifndef USE_CYGWIN
-   /* Replace /dev/null with NUL */
-   while(replace(&ds_cmd, "/dev/null", 9, "NUL", 3) == 0)
-     ;
-#endif
-#endif
-
-
-  DBUG_PRINT("info", ("running system command '%s' as '%s'",
-                      command->first_argument, ds_cmd.str));
-  if (my_system(&ds_cmd))
-  {
-    if (command->abort_on_error)
-      die("system command '%s' failed", command->first_argument);
-
-    /* If ! abort_on_error, log message and continue */
-    dynstr_append(&ds_res, "system command '");
-    replace_dynstr_append(&ds_res, command->first_argument);
-    dynstr_append(&ds_res, "' failed\n");
-  }
-
-  command->last_argument= command->end;
-  dynstr_free(&ds_cmd);
-  DBUG_VOID_RETURN;
-}
-
-
-/*
   SYNOPSIS
   do_remove_file
   command	called command
@@ -6828,7 +6751,10 @@ int main(int argc, char **argv)
       case Q_INC: do_modify_var(command, DO_INC); break;
       case Q_DEC: do_modify_var(command, DO_DEC); break;
       case Q_ECHO: do_echo(command); command_executed++; break;
-      case Q_SYSTEM: do_system(command); break;
+      case Q_SYSTEM:
+        die("'system' command  is deprecated "\
+            "- see the manual for a list of portable commands to use");
+        break;
       case Q_REMOVE_FILE: do_remove_file(command); break;
       case Q_FILE_EXIST: do_file_exist(command); break;
       case Q_WRITE_FILE: do_write_file(command); break;
diff -Nrup a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
--- a/mysql-test/r/mysqltest.result	2007-08-13 15:46:10 +02:00
+++ b/mysql-test/r/mysqltest.result	2007-10-22 10:56:23 +02:00
@@ -376,10 +376,6 @@ hej
 mysqltest: At line 1: Missing argument to dec
 mysqltest: At line 1: The argument to dec must be a variable (start with $)
 mysqltest: At line 1: End of line junk detected: "1000"
-mysqltest: At line 1: Missing arguments to system, nothing to do!
-mysqltest: At line 1: Missing arguments to system, nothing to do!
-mysqltest: At line 1: system command 'false' failed
-system command 'NonExistsinfComamdn 2> /dev/null' failed
 test
 test2
 test3
diff -Nrup a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
--- a/mysql-test/t/mysqltest.test	2007-08-13 15:46:10 +02:00
+++ b/mysql-test/t/mysqltest.test	2007-10-22 10:56:23 +02:00
@@ -942,21 +942,8 @@ echo $d;
 # ----------------------------------------------------------------------------
 # Test system
 # ----------------------------------------------------------------------------
-#system ls > /dev/null;
-system echo "hej" > /dev/null;
-#--system ls > /dev/null
---system echo "hej" > /dev/null;
-
---error 1
---exec echo "system;" | $MYSQL_TEST 2>&1
---error 1
---exec echo "system $NONEXISTSINFVAREABLI;" | $MYSQL_TEST 2>&1
---error 1
---exec echo "system false;" | $MYSQL_TEST 2>&1
-
---disable_abort_on_error
-system NonExistsinfComamdn 2> /dev/null;
---enable_abort_on_error
+# This command is deprecated and will always return an error message
+# system echo "hej" > /dev/null;
 
 
 # ----------------------------------------------------------------------------
diff -Nrup a/mysql-test/t/ndb_autodiscover.test b/mysql-test/t/ndb_autodiscover.test
--- a/mysql-test/t/ndb_autodiscover.test	2006-01-24 08:30:48 +01:00
+++ b/mysql-test/t/ndb_autodiscover.test	2007-10-22 10:56:23 +02:00
@@ -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%';
@@ -85,7 +85,10 @@ show status like 'handler_discover%';
 flush tables;
 
 # Modify the frm file on disk
-system echo "blaj" >> $MYSQLTEST_VARDIR/master-data/test/t2.frm ;
+remove_file $MYSQLTEST_VARDIR/master-data/test/t2.frm;
+write_file $MYSQLTEST_VARDIR/master-data/test/t2.frm;
+blaj
+EOF
 select * from t2;
 
 show status like 'handler_discover%';
@@ -111,7 +114,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 +171,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;
@@ -200,7 +203,7 @@ insert into t4 values (1, "Automatic");
 select * from t4;
 
 # Remove the table from NDB
-system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 >> $NDB_TOOLS_OUTPUT ; 
+--exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 >> $NDB_TOOLS_OUTPUT ; 
 
 #
 # Test that correct error is returned
@@ -221,7 +224,7 @@ insert into t4 values (1, "Automatic");
 select * from t4;
 
 # Remove the table from NDB
-system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 >> $NDB_TOOLS_OUTPUT ; 
+--exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 >> $NDB_TOOLS_OUTPUT ; 
 
 --error 1146
 select * from t4;
@@ -253,7 +256,7 @@ select * from t4;
 flush tables;
 
 # Remove the table from NDB
-system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 >> $NDB_TOOLS_OUTPUT ;
+--exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 >> $NDB_TOOLS_OUTPUT ;
 
 SHOW TABLES;
 
@@ -287,11 +290,11 @@ insert into t8 values (8, "myisam table 
 insert into t9 values (9);
 
 # Remove t3, t5 from NDB
-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 ;
+--exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t3 >> $NDB_TOOLS_OUTPUT ;
+--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;
+remove_file $MYSQLTEST_VARDIR/master-data/test/t7.frm;
 
 SHOW TABLES;
 
@@ -329,11 +332,11 @@ insert into t8 values (8, "myisam table 
 insert into t9 values (9);
 
 # Remove t3, t5 from NDB
-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  ;
+--exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t3 > /dev/null  ;
+--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;
+remove_file $MYSQLTEST_VARDIR/master-data/test/t7.frm;
 
 
 SHOW TABLES LIKE 't6';
@@ -375,9 +378,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;
+remove_file $MYSQLTEST_VARDIR/master-data/test/t2.frm;
+remove_file $MYSQLTEST_VARDIR/master-data/test/t3.frm;
 flush tables;
 
 # Select from the table which only exists in NDB.
@@ -530,7 +533,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 
diff -Nrup a/mysql-test/t/ndb_loaddatalocal.test b/mysql-test/t/ndb_loaddatalocal.test
--- a/mysql-test/t/ndb_loaddatalocal.test	2006-06-14 20:16:28 +02:00
+++ b/mysql-test/t/ndb_loaddatalocal.test	2007-10-22 10:56:23 +02:00
@@ -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;
 
diff -Nrup a/mysql-test/t/repair.test b/mysql-test/t/repair.test
--- a/mysql-test/t/repair.test	2006-10-19 15:03:42 +02:00
+++ b/mysql-test/t/repair.test	2007-10-22 10:56:23 +02:00
@@ -29,7 +29,10 @@ repair table t1 use_frm;
 
 create table t1 engine=myisam SELECT 1,"table 1";
 flush tables;
-system echo 1 > $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
+remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
+write_file $MYSQLTEST_VARDIR/master-data/test/t1.MYI;
+1
+EOF
 repair table t1;
 repair table t1 use_frm;
 drop table t1;
diff -Nrup a/mysql-test/t/rpl_EE_error.test b/mysql-test/t/rpl_EE_error.test
--- a/mysql-test/t/rpl_EE_error.test	2006-01-24 08:30:48 +01:00
+++ b/mysql-test/t/rpl_EE_error.test	2007-10-22 10:56:23 +02:00
@@ -8,7 +8,7 @@ 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;
diff -Nrup a/mysql-test/t/rpl_loaddatalocal.test b/mysql-test/t/rpl_loaddatalocal.test
--- a/mysql-test/t/rpl_loaddatalocal.test	2006-10-05 18:45:37 +02:00
+++ b/mysql-test/t/rpl_loaddatalocal.test	2007-10-22 10:56:23 +02:00
@@ -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;
diff -Nrup a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
--- a/mysql-test/t/show_check.test	2007-08-02 15:23:14 +02:00
+++ b/mysql-test/t/show_check.test	2007-10-22 10:56:23 +02:00
@@ -427,7 +427,9 @@ DROP TABLE t1;
 flush tables;
 
 # Create a junk frm file on disk
-system echo "this is a junk file for test" >> $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
+write_file $MYSQLTEST_VARDIR/master-data/test/t1.frm;
+this is a junk file for test
+EOF
 --replace_column 6 # 7 # 8 # 9 #
 SHOW TABLE STATUS like 't1';
 --error 1033
diff -Nrup a/mysql-test/t/system_mysql_db_fix30020.test b/mysql-test/t/system_mysql_db_fix30020.test
--- a/mysql-test/t/system_mysql_db_fix30020.test	2007-04-04 15:40:39 +02:00
+++ b/mysql-test/t/system_mysql_db_fix30020.test	2007-10-22 10:56:23 +02:00
@@ -86,8 +86,8 @@ type=ISAM;
 INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y');
 INSERT INTO user VALUES ('localhost','',    '','N','N','N','N','N','N','N','N','N');
 
-# Call the "shell script" $MYSQL_FIX_SYSTEM_TABLES using system
--- system $MYSQL_FIX_SYSTEM_TABLES --database=test > $MYSQLTEST_VARDIR/log/system_mysql_db_fix30020.log 2>&1
+# Call the "shell script" $MYSQL_FIX_SYSTEM_TABLES
+--exec $MYSQL_FIX_SYSTEM_TABLES --database=test > $MYSQLTEST_VARDIR/log/system_mysql_db_fix30020.log 2>&1
 -- enable_query_log
 -- enable_result_log
 
Thread
bk commit into 5.0 tree (msvensson:1.2523) BUG#31741msvensson22 Oct
  • Re: bk commit into 5.0 tree (msvensson:1.2523) BUG#31741Guilhem Bichot25 Oct
    • Re: bk commit into 5.0 tree (msvensson:1.2523) BUG#31741Magnus Svensson26 Oct
      • Re: bk commit into 5.0 tree (msvensson:1.2523) BUG#31741Guilhem Bichot26 Oct
        • Re: bk commit into 5.0 tree (msvensson:1.2523) BUG#31741Magnus Svensson1 Nov
          • Re: bk commit into 5.0 tree (msvensson:1.2523) BUG#31741Guilhem Bichot5 Nov