List:Commits« Previous MessageNext Message »
From:Ignacio Galarza Date:January 19 2007 6:09pm
Subject:bk commit into 5.0 tree (iggy:1.2364) BUG#22807
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of iggy. When iggy 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-01-19 13:09:48-05:00, iggy@recycle.(none) +1 -0
  Bug#22807 mysql_upgrade fails when called with a basedir-path containing spaces
  - Corrected compiler warnings and performance problems with new 
  dynstr_append_os_quoted function.

  mysys/string.c@stripped, 2007-01-19 13:09:46-05:00, iggy@recycle.(none) +13 -15
    Bug#22807 mysql_upgrade fails when called with a basedir-path containing spaces
    - Fix compiler warnings.
    - Used dynstr_append_mem where string length is known.

# 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:	iggy
# Host:	recycle.(none)
# Root:	/src/bug22807/my50-bug22807

--- 1.9/mysys/string.c	2007-01-18 11:38:04 -05:00
+++ 1.10/mysys/string.c	2007-01-19 13:09:46 -05:00
@@ -132,37 +132,35 @@
 my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, ...)
 {
 #ifdef __WIN__
-  char quote_str[]= "\"";
+  const char *quote_str= "\"";
+  const uint  quote_len= 1;
 #else
-  char quote_str[]= "\'";
+  const char *quote_str= "\'";
+  const uint  quote_len= 1;
 #endif /* __WIN__ */
   my_bool ret= TRUE;
   va_list dirty_text;
 
-  ret&= dynstr_append(str, quote_str);          /* Leading quote */
-  va_start(dirty_text,append);
+  ret&= dynstr_append_mem(str, quote_str, quote_len); /* Leading quote */
+  va_start(dirty_text, append);
   while (append != NullS)
   {
-    char *cur_pos=  append;
-    char *next_pos= cur_pos;
+    const char  *cur_pos= append;
+    const char *next_pos= cur_pos;
 
     /* Search for quote in each string and replace with escaped quote */
     while(*(next_pos= strcend(cur_pos, quote_str[0])) != '\0')
     {
-      char *tmp_buff= my_malloc((next_pos - cur_pos) + 1, MYF(MY_ZEROFILL));
-      strnmov(tmp_buff, cur_pos, (next_pos - cur_pos));
-      ret&= dynstr_append(str, tmp_buff);
-      my_free((gptr)tmp_buff, MYF(0));
-
-      ret&= dynstr_append(str ,"\\");
-      ret&= dynstr_append(str, quote_str);
+      ret&= dynstr_append_mem(str, cur_pos, next_pos - cur_pos);
+      ret&= dynstr_append_mem(str ,"\\", 1);
+      ret&= dynstr_append_mem(str, quote_str, quote_len);
       cur_pos= next_pos + 1;
     }
-    ret&= dynstr_append(str, cur_pos);
+    ret&= dynstr_append_mem(str, cur_pos, next_pos - cur_pos);
     append= va_arg(dirty_text, char *);
   }
   va_end(dirty_text);
-  ret&= dynstr_append(str, quote_str);          /* Trailing quote */
+  ret&= dynstr_append_mem(str, quote_str, quote_len); /* Trailing quote */
 
   return ret;
 }
Thread
bk commit into 5.0 tree (iggy:1.2364) BUG#22807Ignacio Galarza19 Jan