List:Commits« Previous MessageNext Message »
From:msvensson Date:February 22 2006 4:44pm
Subject:bk commit into 5.0 tree (msvensson:1.2028)
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
  1.2028 06/02/22 17:44:40 msvensson@neptunus.(none) +4 -0
  Stricter checking of what is allowed to be escaped in do_eval.

  mysql-test/t/mysqltest.test
    1.30 06/02/22 17:44:36 msvensson@neptunus.(none) +13 -13
    Revert previous patch that added extra \\

  mysql-test/t/mysqldump.test
    1.80 06/02/22 17:44:36 msvensson@neptunus.(none) +1 -1
    Revert previous patch that added extra \\

  mysql-test/r/mysqltest.result
    1.25 06/02/22 17:44:36 msvensson@neptunus.(none) +1 -1
    Update test result

  client/mysqltest.c
    1.199 06/02/22 17:44:36 msvensson@neptunus.(none) +6 -14
    Stricter detection of what to escape. Only allow $variables to be escaped by \

# 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:	msvensson
# Host:	neptunus.(none)
# Root:	/home/msvensson/mysql/mysqltest_replace/my50-mysqltest_replace

--- 1.24/mysql-test/r/mysqltest.result	2006-01-11 11:06:20 +01:00
+++ 1.25/mysql-test/r/mysqltest.result	2006-02-22 17:44:36 +01:00
@@ -218,7 +218,7 @@
 mysqltest: At line 1: Variable name in hi=hi does not start with '$'
 mysqltest: At line 1: Missing assignment operator in let
 mysqltest: At line 1: Missing assignment operator in let
-mysqltest: At line 1: Missing arguments to let
+mysqltest: At line 1: Missing assignment operator in let
 mysqltest: At line 1: Missing variable name in let
 mysqltest: At line 1: Variable name in =hi does not start with '$'
 mysqltest: At line 1: Missing assignment operator in let

--- 1.29/mysql-test/t/mysqltest.test	2006-02-17 12:07:41 +01:00
+++ 1.30/mysql-test/t/mysqltest.test	2006-02-22 17:44:36 +01:00
@@ -678,7 +678,7 @@
 --error 1
 --exec echo "inc i;" | $MYSQL_TEST 2>&1
 --error 1
---exec echo "let \\\$i=100; inc \\\$i 1000; echo \\\$i;" | $MYSQL_TEST 2>&1
+--exec echo "let \$i=100; inc \$i 1000; echo \$i;" | $MYSQL_TEST 2>&1
 
 inc $i; inc $i; inc $i; --echo $i
 echo $i;
@@ -706,7 +706,7 @@
 --error 1
 --exec echo "dec i;" | $MYSQL_TEST 2>&1
 --error 1
---exec echo "let \\\$i=100; dec \\\$i 1000; echo \\\$i;" | $MYSQL_TEST 2>&1
+--exec echo "let \$i=100; dec \$i 1000; echo \$i;" | $MYSQL_TEST 2>&1
 
 
 # ----------------------------------------------------------------------------
@@ -761,11 +761,11 @@
 --error 1
 --exec echo "source include/mysqltest_while.inc;" | $MYSQL_TEST 2>&1
 --error 1
---exec echo "while \\\$i;" | $MYSQL_TEST 2>&1
+--exec echo "while \$i;" | $MYSQL_TEST 2>&1
 --error 1
---exec echo "while (\\\$i;" | $MYSQL_TEST 2>&1
+--exec echo "while (\$i;" | $MYSQL_TEST 2>&1
 --error 1
---exec echo "let \\\$i=1; while (\\\$i) dec \\\$i;" | $MYSQL_TEST 2>&1
+--exec echo "let \$i=1; while (\$i) dec \$i;" | $MYSQL_TEST 2>&1
 --error 1
 --exec echo "};" | $MYSQL_TEST 2>&1
 --error 1
@@ -877,22 +877,22 @@
 --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 "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 " 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 " 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
 
 # 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 "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 " dec \$i;                              "  >> var/tmp/con.sql
 --exec echo "}"                                        >> var/tmp/con.sql
 --error 1
 --exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1
@@ -1001,7 +1001,7 @@
 #
 # 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;" > $MYSQL_TEST_DIR/var/tmp/query.sql
 --error 1
 --exec $MYSQL_TEST -x var/tmp/query.sql  2>&1
 

--- 1.198/client/mysqltest.c	2006-02-20 12:05:41 +01:00
+++ 1.199/client/mysqltest.c	2006-02-22 17:44:36 +01:00
@@ -492,12 +492,12 @@
 static void do_eval(DYNAMIC_STRING* query_eval, const char *query)
 {
   const char *p;
-  register char c, next_c;
+  register char c;
   register int escaped = 0;
   VAR* v;
   DBUG_ENTER("do_eval");
 
-  for (p= query; (c = *p); ++p)
+  for (p= query; (c = *p); p++)
   {
     switch(c) {
     case '$':
@@ -514,22 +514,16 @@
       }
       break;
     case '\\':
-      next_c= *(p+1);
-      if (escaped)
-      {
-	escaped = 0;
-	dynstr_append_mem(query_eval, p, 1);
-      }
-      else if (next_c == '\\' || next_c == '$')
+      if (*(p+1) == '$')
       {
-        /* Set escaped only if next char is \ or $ */
+        /* Set escaped if next char is  $ */
 	escaped = 1;
       }
-      else
-	dynstr_append_mem(query_eval, p, 1);
+      dynstr_append_mem(query_eval, p, 1);
       break;
     default:
       dynstr_append_mem(query_eval, p, 1);
+      escaped= 0;
       break;
     }
   }
@@ -1119,8 +1113,6 @@
                ("error: %d, status: %d", error, status));
     for (i= 0; i < query->expected_errors; i++)
     {
-      DBUG_PRINT("info",
-                 ("error: %d, status: %d", error, status));
       DBUG_PRINT("info", ("expected error: %d",
                           query->expected_errno[i].code.errnum));
       if ((query->expected_errno[i].type == ERR_ERRNO) &&

--- 1.79/mysql-test/t/mysqldump.test	2006-02-16 22:06:03 +01:00
+++ 1.80/mysql-test/t/mysqldump.test	2006-02-22 17:44:36 +01:00
@@ -647,7 +647,7 @@
 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db  "\\t1" 2>&1
  
 --error 6
---exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db  "\\\\\\t1" 2>&1
+--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db  "\\\\t1" 2>&1
 
 --error 6
 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db  "t\1" 2>&1
Thread
bk commit into 5.0 tree (msvensson:1.2028)msvensson22 Feb