List:Commits« Previous MessageNext Message »
From:kent Date:March 7 2006 9:53pm
Subject:bk commit into 5.1 tree (kent:1.2166)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of kent. When kent 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
  1.2166 06/03/07 21:52:50 kent@stripped +4 -0
  Merge mysql.com:/Users/kent/mysql/bk/mysql-5.0-tmp
  into mysql.com:/Users/kent/mysql/bk/mysql-5.1-new

  mysql-test/t/trigger-grant.test
    1.8 06/03/07 21:52:46 kent@stripped +0 -0
    Auto merged

  mysql-test/t/mysqltest.test
    1.45 06/03/07 21:52:46 kent@stripped +0 -0
    Auto merged

  mysql-test/r/mysqltest.result
    1.37 06/03/07 21:52:46 kent@stripped +0 -0
    Auto merged

  client/mysqltest.c
    1.196 06/03/07 21:52:46 kent@stripped +0 -0
    Auto merged

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	kent
# Host:	c-4c4072d5.010-2112-6f72651.cust.bredbandsbolaget.se
# Root:	/Users/kent/mysql/bk/mysql-5.1-new/RESYNC

--- 1.7/mysql-test/t/trigger-grant.test	2006-02-08 11:11:36 +01:00
+++ 1.8/mysql-test/t/trigger-grant.test	2006-03-07 21:52:46 +01:00
@@ -362,9 +362,9 @@
   FOR EACH ROW
     SET @a = 5;
 
---exec egrep -v '^definers=' $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG >
$MYSQLTEST_VARDIR/tmp/t1.TRG
---exec echo "definers='' '@' '@abc@def@@' '@hostname' '@abcdef@@@hostname'" >>
$MYSQLTEST_VARDIR/tmp/t1.TRG
---exec mv $MYSQLTEST_VARDIR/tmp/t1.TRG $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG
+--system grep -v '^definers=' $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG >
$MYSQLTEST_VARDIR/tmp/t1.TRG
+--system echo "definers='' '@' '@abc@def@@' '@hostname' '@abcdef@@@hostname'" >>
$MYSQLTEST_VARDIR/tmp/t1.TRG
+--system mv $MYSQLTEST_VARDIR/tmp/t1.TRG
$MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG
 
 --echo
 

--- 1.36/mysql-test/r/mysqltest.result	2006-02-28 22:14:25 +01:00
+++ 1.37/mysql-test/r/mysqltest.result	2006-03-07 21:52:46 +01:00
@@ -304,8 +304,8 @@
 101
 hej
 1
-mysqltest: At line 1: Missing arguments to inc
-mysqltest: At line 1: First argument to inc must be a variable (start with $)
+mysqltest: At line 1: Missing argument to inc
+mysqltest: At line 1: The argument to inc must be a variable (start with $)
 mysqltest: At line 1: End of line junk detected: "1000"
 4
 4
@@ -314,8 +314,8 @@
 99
 hej
 -1
-mysqltest: At line 1: Missing arguments to dec
-mysqltest: At line 1: First argument to dec must be a variable (start with $)
+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!
@@ -378,9 +378,9 @@
 mysqltest: At line 1: Illegal argument for port: 'illegal_port'
 mysqltest: At line 1: Illegal option to connect: SMTP
 OK
-mysqltest: In included file "MYSQLTEST_VARDIR/tmp/con.sql": At line 7: Connection limit
exhausted - increase MAX_CONS in mysqltest.c
-mysqltest: In included file "MYSQLTEST_VARDIR/tmp/con.sql": At line 3: connection
'test_con1' not found in connection pool
-mysqltest: In included file "MYSQLTEST_VARDIR/tmp/con.sql": At line 2: Connection
test_con1 already exists
+mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 7: Connection
limit exhausted - increase MAX_CONS in mysqltest.c
+mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 3: connection
'test_con1' not found in connection pool
+mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 2: Connection
test_con1 already exists
 connect(localhost,root,,test,MASTER_PORT,MASTER_SOCKET);
 Output from mysqltest-x.inc
 Output from mysqltest-x.inc

--- 1.44/mysql-test/t/mysqltest.test	2006-03-01 01:12:24 +01:00
+++ 1.45/mysql-test/t/mysqltest.test	2006-03-07 21:52:46 +01:00
@@ -596,6 +596,8 @@
 --error 1
 --exec echo "source ;" | $MYSQL_TEST 2>&1
 
+# Fix win paths
+--replace_result \\ /
 --error 1
 --exec echo "source non_existingFile;" | $MYSQL_TEST 2>&1
 
@@ -803,6 +805,8 @@
 }
 
 # Exceed max nesting level
+# Fix win path
+--replace_result \\ /
 --error 1
 --exec echo "source include/mysqltest_while.inc;" | $MYSQL_TEST 2>&1
 --error 1
@@ -922,41 +926,41 @@
 --exec echo "connect (con1,localhost,root,,,,,SMTP POP);" | $MYSQL_TEST 2>&1
 
 # Repeat connect/disconnect
---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
+--system echo "let \$i=100;"                              >
$MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--system echo "while (\$i)"                              >>
$MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--system echo "{"                                        >>
$MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--system echo " connect (test_con1,localhost,root,,); "  >>
$MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--system echo " disconnect test_con1; "                  >>
$MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--system echo " dec \$i;                               " >>
$MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--system echo "}"                                        >>
$MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql; echo OK;" | $MYSQL_TEST
2>&1
 
 # Repeat connect/disconnect, exceed max number of connections
---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
+--system echo "let \$i=200;"                              >
$MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--system echo "while (\$i)"                              >>
$MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--system echo "{"                                        >>
$MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--system echo " connect (test_con1,localhost,root,,); "  >>
$MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--system echo " disconnect test_con1; "                  >>
$MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--system echo " dec \$i;                               " >>
$MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--system echo "}"                                        >>
$MYSQLTEST_VARDIR/tmp/mysqltest.sql
 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 --error 1
---exec echo "source $MYSQLTEST_VARDIR/tmp/con.sql;" | $MYSQL_TEST 2>&1
+--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql;" | $MYSQL_TEST 2>&1
 
 # Select disconnected connection
---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
+--system echo "connect (test_con1,localhost,root,,);"    >
$MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--system echo "disconnect test_con1; "                  >>
$MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--system echo "connection test_con1;"                   >>
$MYSQLTEST_VARDIR/tmp/mysqltest.sql
 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 --error 1
---exec echo "source $MYSQLTEST_VARDIR/tmp/con.sql;" | $MYSQL_TEST 2>&1
+--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql;" | $MYSQL_TEST 2>&1
 
 # Connection name already used
---exec echo "connect (test_con1,localhost,root,,);"    > $MYSQLTEST_VARDIR/tmp/con.sql
---exec echo "connect (test_con1,localhost,root,,);"   >>
$MYSQLTEST_VARDIR/tmp/con.sql
+--system echo "connect (test_con1,localhost,root,,);"    >
$MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--system echo "connect (test_con1,localhost,root,,);"   >>
$MYSQLTEST_VARDIR/tmp/mysqltest.sql
 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 --error 1
---exec echo "source $MYSQLTEST_VARDIR/tmp/con.sql;" | $MYSQL_TEST 2>&1
+--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.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
@@ -974,6 +978,8 @@
 --exec $MYSQL_TEST < $MYSQL_TEST_DIR/include/mysqltest-x.inc
 --exec $MYSQL_TEST -x $MYSQL_TEST_DIR/include/mysqltest-x.inc
 --exec $MYSQL_TEST --test_file=$MYSQL_TEST_DIR/include/mysqltest-x.inc
+# Fix Win paths
+--replace_result \\ /
 --error 1
 --exec $MYSQL_TEST -x non_existing_file.inc 2>&1
 

--- 1.195/client/mysqltest.c	2006-03-07 20:00:39 +01:00
+++ 1.196/client/mysqltest.c	2006-03-07 21:52:46 +01:00
@@ -492,6 +492,7 @@
 static void str_to_file(const char *fname, char *str, int size);
 
 #ifdef __WIN__
+static void free_tmp_sh_file();
 static void free_win_path_patterns();
 #endif
 
@@ -641,6 +642,7 @@
   mysql_server_end();
   free_re();
 #ifdef __WIN__
+  free_tmp_sh_file();
   free_win_path_patterns();
 #endif
   DBUG_VOID_RETURN;
@@ -1106,6 +1108,35 @@
   return open_file(name);
 }
 
+#ifdef __WIN__
+/* Variables used for temuprary sh files used for emulating Unix on Windows */
+char tmp_sh_name[64], tmp_sh_cmd[70];
+
+static void init_tmp_sh_file()
+{
+  /* Format a name for the tmp sh file that is unique for this process */
+  my_snprintf(tmp_sh_name, sizeof(tmp_sh_name), "tmp_%d.sh", getpid());
+  /* Format the command to execute in order to run the script */
+  my_snprintf(tmp_sh_cmd, sizeof(tmp_sh_cmd), "sh %s", tmp_sh_name);
+}
+
+static void free_tmp_sh_file()
+{
+  my_delete(tmp_sh_name, MYF(0));
+}
+#endif
+
+FILE* my_popen(DYNAMIC_STRING* ds_cmd, const char* mode)
+{
+#ifdef __WIN__
+  /* Dump the command into a sh script file and execute with popen */
+  str_to_file(tmp_sh_name, ds_cmd->str, ds_cmd->length);
+  return popen(tmp_sh_cmd, mode);
+#else
+  return popen(ds_cmd->str, mode);
+#endif
+}
+
 
 /*
   Execute given command.
@@ -1152,7 +1183,7 @@
   DBUG_PRINT("info", ("Executing '%s' as '%s'",
                       query->first_argument, cmd));
 
-  if (!(res_file= popen(cmd, "r")) && query->abort_on_error)
+  if (!(res_file= my_popen(&ds_cmd, "r")) && query->abort_on_error)
     die("popen(\"%s\", \"r\") failed", query->first_argument);
 
   while (fgets(buf, sizeof(buf), res_file))
@@ -1375,7 +1406,6 @@
   SYNOPSIS
     do_modify_var()
     query	called command
-    name        human readable name of operator
     operator    operation to perform on the var
 
   DESCRIPTION
@@ -1384,15 +1414,16 @@
 
 */
 
-int do_modify_var(struct st_query *query, const char *name,
+int do_modify_var(struct st_query *query,
                   enum enum_operator operator)
 {
   const char *p= query->first_argument;
   VAR* v;
   if (!*p)
-    die("Missing arguments to %s", name);
+    die("Missing argument to %.*s", query->first_word_len, query->query);
   if (*p != '$')
-    die("First argument to %s must be a variable (start with $)", name);
+    die("The argument to %.*s must be a variable (start with $)",
+        query->first_word_len, query->query);
   v= var_get(p, &p, 1, 0);
   switch (operator) {
   case DO_DEC:
@@ -1402,7 +1433,7 @@
     v->int_val++;
     break;
   default:
-    die("Invalid operator to do_operator");
+    die("Invalid operator to do_modify_var");
     break;
   }
   v->int_dirty= 1;
@@ -1425,15 +1456,9 @@
 int my_system(DYNAMIC_STRING* ds_cmd)
 {
 #ifdef __WIN__
-  /* Dump the command into a sh script file and execute with "sh" */
-  int err;
-  char tmp_sh_name[64], tmp_sh_cmd[70];
-  my_snprintf(tmp_sh_name, sizeof(tmp_sh_name), "tmp_%d.sh", getpid());
-  my_snprintf(tmp_sh_cmd, sizeof(tmp_sh_cmd), "sh %s", tmp_sh_name);
+  /* Dump the command into a sh script file and execute with system */
   str_to_file(tmp_sh_name, ds_cmd->str, ds_cmd->length);
-  err= system(tmp_sh_cmd);
-  my_delete(tmp_sh_name, MYF(0));
-  return err;
+  return system(tmp_sh_cmd);
 #else
   return system(ds_cmd->str);
 #endif
@@ -1820,7 +1845,6 @@
   char *p= query->first_argument;
   char *sleep_start, *sleep_end= query->end;
   double sleep_val;
-  const char *cmd = (real_sleep ? "real_sleep" : "sleep");
 
   while (my_isspace(charset_info, *p))
     p++;
@@ -5123,6 +5147,7 @@
   init_var_hash(&cur_con->mysql);
 
 #ifdef __WIN__
+  init_tmp_sh_file();
   init_win_path_patterns();
 #endif
 
@@ -5181,8 +5206,8 @@
       case Q_SERVER_START: do_server_start(q); break;
       case Q_SERVER_STOP: do_server_stop(q); break;
 #endif
-      case Q_INC: do_modify_var(q, "inc", DO_INC); break;
-      case Q_DEC: do_modify_var(q, "dec", DO_DEC); break;
+      case Q_INC: do_modify_var(q, DO_INC); break;
+      case Q_DEC: do_modify_var(q, DO_DEC); break;
       case Q_ECHO: do_echo(q); query_executed= 1; break;
       case Q_SYSTEM: do_system(q); break;
       case Q_DELIMITER:
Thread
bk commit into 5.1 tree (kent:1.2166)kent7 Mar