List:Internals« Previous MessageNext Message »
From:Elliot Murphy Date:August 18 2005 7:42pm
Subject:bk commit into 5.0 tree (elliot:1.1989)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of emurphy. When emurphy 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.1989 05/08/18 15:42:13 elliot@stripped +4 -0
  Merge mysql.com:/Users/emurphy/src/work/mysql-4.1-bug11338
  into  mysql.com:/Users/emurphy/src/bk-clean/mysql-5.0

  sql/log_event.cc
    1.185 05/08/18 15:42:09 elliot@stripped +0 -1
    Manual merge.

  sql/item.cc
    1.164 05/08/18 15:42:09 elliot@stripped +0 -1
    Merge fixes.

  sql/sql_prepare.cc
    1.150 05/08/18 15:38:27 elliot@stripped +0 -0
    Auto merged

  sql/item.h
    1.162 05/08/18 15:38:26 elliot@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:	elliot
# Host:	agony.local
# Root:	/Users/emurphy/src/bk-clean/mysql-5.0/RESYNC

--- 1.163/sql/item.cc	2005-08-18 15:35:41 -04:00
+++ 1.164/sql/item.cc	2005-08-18 15:42:09 -04:00
@@ -2138,7 +2138,7 @@
       CHARSET_INFO *tocs= thd->variables.collation_connection;
       uint32 dummy_offset;
 
-      value.cs_info.character_set_client= fromcs;
+      value.cs_info.character_set_of_placeholder= fromcs;
       /*
         Setup source and destination character sets so that they
         are different only if conversion is necessary: this will
@@ -2412,7 +2412,7 @@
   and avoid one more memcpy/alloc between str and log string.
 */
 
-const String *Item_param::query_val_str(String* str, THD *thd) const
+const String *Item_param::query_val_str(String* str) const
 {
   switch (state) {
   case INT_VALUE:
@@ -2451,13 +2451,12 @@
     {
       char *buf, *ptr;
       str->length(0);
-      if (str->reserve(str_value.length()*2+3))
+      if (str->reserve(str_value.length()*2+4))
         break;
 
       buf= str->c_ptr_quick();
       ptr= buf;
-      *ptr++= '\'';
-      if (thd->charset()->escape_with_backslash_is_dangerous)
+      if (value.cs_info.character_set_client->escape_with_backslash_is_dangerous)
       {
         ptr= strmov(ptr, "x\'");
         ptr= bare_str_to_hex(ptr, str_value.ptr(), str_value.length());
@@ -2498,10 +2497,10 @@
       here only if conversion is really necessary.
     */
     if (value.cs_info.final_character_set_of_str_value !=
-        value.cs_info.character_set_client)
+        value.cs_info.character_set_of_placeholder)
     {
       rc= thd->convert_string(&str_value,
-                              value.cs_info.character_set_client,
+                              value.cs_info.character_set_of_placeholder,
                               value.cs_info.final_character_set_of_str_value);
     }
     else

--- 1.161/sql/item.h	2005-08-18 15:10:36 -04:00
+++ 1.162/sql/item.h	2005-08-18 15:38:26 -04:00
@@ -1026,6 +1026,7 @@
     struct CONVERSION_INFO
     {
       CHARSET_INFO *character_set_client;
+      CHARSET_INFO *character_set_of_placeholder;
       /*
         This points at character set of connection if conversion
         to it is required (i. e. if placeholder typecode is not BLOB).
@@ -1087,7 +1088,7 @@
   */
   void (*set_param_func)(Item_param *param, uchar **pos, ulong len);
 
-  const String *query_val_str(String *str, THD *thd) const;
+  const String *query_val_str(String *str) const;
 
   bool convert_str_value(THD *thd);
 

--- 1.184/sql/log_event.cc	2005-07-19 14:05:45 -04:00
+++ 1.185/sql/log_event.cc	2005-08-18 15:42:09 -04:00
@@ -206,47 +206,6 @@
   return 0;
 }
 
-
-/*
-  Transforms a string into "" or its expression in 0x... form.
-*/
-static char *str_to_hex(char *to, char *from, uint len)
-{
-  char *p= to;
-  if (len)
-  {
-    p= strmov(p, "0x");
-    for (uint i= 0; i < len; i++, p+= 2)
-    {
-      /* val[i] is char. Casting to uchar helps greatly if val[i] < 0 */
-      uint tmp= (uint) (uchar) from[i];
-      p[0]= _dig_vec_upper[tmp >> 4];
-      p[1]= _dig_vec_upper[tmp & 15];
-    }
-    *p= 0;
-  }
-  else
-    p= strmov(p, "\"\"");
-  return p; // pointer to end 0 of 'to'
-}
-
-/*
-  Prints a "session_var=value" string. Used by mysqlbinlog to print some SET
-  commands just before it prints a query.
-*/
-
-static void print_set_option(FILE* file, uint32 bits_changed, uint32 option,
-                             uint32 flags, const char* name, bool* need_comma) 
-{
-  if (bits_changed & option)
-  {
-    if (*need_comma)
-      fprintf(file,", ");
-    fprintf(file,"%s=%d", name, test(flags & option));
-    *need_comma= 1;
-  }
-}
-
 /**************************************************************************
 	Log_event methods (= the parent class of all events)
 **************************************************************************/
@@ -3359,7 +3318,14 @@
       else
       {
         char *p= strxmov(buf + val_offset, "_", cs->csname, " ", NullS);
-        p= str_to_hex(p, val, val_len);
+        if (val_len) 
+        {
+          p= strmov(p, "0x");
+          p= bare_str_to_hex(p, val, val_len);
+        }
+        else
+          p= strmov(p, "\"\"");
+
         p= strxmov(p, " COLLATE ", cs->name, NullS);
         event_len= p-buf;
       }
@@ -3545,7 +3511,16 @@
 
       if (!(hex_str= (char *)my_alloca(2*val_len+1+2))) // 2 hex digits / byte
         break; // no error, as we are 'void'
-      str_to_hex(hex_str, val, val_len);
+
+      if (val_len) 
+      {
+        char *p= hex_str;
+        p= strmov(p, "0x");
+        bare_str_to_hex(p, val, val_len);
+      }
+      else
+        strmov(hex_str, "\"\"");
+
       /*
         For proper behaviour when mysqlbinlog|mysql, we need to explicitely
         specify the variable's collation. It will however cause problems when

--- 1.149/sql/sql_prepare.cc	2005-08-18 15:10:37 -04:00
+++ 1.150/sql/sql_prepare.cc	2005-08-18 15:38:27 -04:00
@@ -551,7 +551,7 @@
   case MYSQL_TYPE_LONG_BLOB:
   case MYSQL_TYPE_BLOB:
     param->set_param_func= set_param_str;
-    param->value.cs_info.character_set_client= &my_charset_bin;
+    param->value.cs_info.character_set_of_placeholder= &my_charset_bin;
     param->value.cs_info.final_character_set_of_str_value= &my_charset_bin;
     param->item_type= Item::STRING_ITEM;
     param->item_result_type= STRING_RESULT;
@@ -567,7 +567,7 @@
       CHARSET_INFO *tocs= thd->variables.collation_connection;
       uint32 dummy_offset;
 
-      param->value.cs_info.character_set_client= fromcs;
+      param->value.cs_info.character_set_of_placeholder= fromcs;
 
       /*
         Setup source and destination character sets so that they
@@ -587,6 +587,8 @@
     }
   }
   param->param_type= (enum enum_field_types) param_type;
+  param->value.cs_info.character_set_client= 
+    thd->variables.character_set_client;
 }
 
 #ifndef EMBEDDED_LIBRARY
@@ -624,7 +626,7 @@
         param->set_param_func(param, &read_pos, data_end - read_pos);
       }
     }
-    res= param->query_val_str(&str, thd);
+    res= param->query_val_str(&str);
     if (param->convert_str_value(thd))
       DBUG_RETURN(1);                           /* out of memory */
 
@@ -772,7 +774,7 @@
                               client_param->buffer_length);
       }
     }
-    res= param->query_val_str(&str, thd);
+    res= param->query_val_str(&str);
     if (param->convert_str_value(thd))
       DBUG_RETURN(1);                           /* out of memory */
 
Thread
bk commit into 5.0 tree (elliot:1.1989)Elliot Murphy18 Aug