MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Bjorn Munch Date:May 25 2009 9:05am
Subject:bzr commit into mysql-5.1-mtr branch (Bjorn.Munch:2794) Bug#44922
View as plain text  
#At file:///home/bm136801/my/qgv-51/

 2794 Bjorn Munch	2009-05-25
      Bug #44922 MTR's query_get_value function can't work with queries containing ','
      check_command_args() always looks for the first , (or whatever)
      Extended check_command_args() to let arguments be quoted
      modified:
        client/mysqltest.cc

=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2009-04-09 09:24:36 +0000
+++ b/client/mysqltest.cc	2009-05-25 09:02:20 +0000
@@ -966,6 +966,7 @@ void check_command_args(struct st_comman
   for (i= 0; i < num_args; i++)
   {
     const struct command_arg *arg= &args[i];
+    char delimiter;
 
     switch (arg->type) {
       /* A string */
@@ -974,9 +975,17 @@ void check_command_args(struct st_comman
       while (*ptr && *ptr == ' ')
         ptr++;
       start= ptr;
-      /* Find end of arg, terminated by "delimiter_arg" */
-      while (*ptr && *ptr != delimiter_arg)
+      delimiter = delimiter_arg;
+      /* If start of arg is ' ` or " search to matching quote end instead */
+      if (strchr ("'`\"", *ptr))
+      {
+	delimiter= *ptr;
+	start= ++ptr;
+      }
+      /* Find end of arg, terminated by "delimiter" */
+      while (*ptr && *ptr != delimiter)
         ptr++;
+
       if (ptr > start)
       {
         init_dynamic_string(arg->ds, 0, ptr-start, 32);
@@ -987,6 +996,11 @@ void check_command_args(struct st_comman
         /* Empty string */
         init_dynamic_string(arg->ds, "", 0, 0);
       }
+      /* Find real end of arg, terminated by "delimiter_arg" */
+      /* This will do nothing if arg was not closed by quotes */
+      while (*ptr && *ptr != delimiter_arg)
+        ptr++;      
+
       command->last_argument= (char*)ptr;
 
       /* Step past the delimiter */

Thread
bzr commit into mysql-5.1-mtr branch (Bjorn.Munch:2794) Bug#44922Bjorn Munch25 May