List:Internals« Previous MessageNext Message »
From:monty Date:April 30 2005 12:46am
Subject:bk commit into 5.0 tree (monty:1.1921)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of monty. When monty 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.1921 05/04/30 03:46:38 monty@stripped +3 -0
  Merge bk-internal.mysql.com:/home/bk/mysql-5.0
  into mysql.com:/home/my/mysql-5.0

  sql/item_func.h
    1.109 05/04/30 03:46:36 monty@stripped +0 -0
    Auto merged

  sql/item_func.cc
    1.185 05/04/30 03:46:36 monty@stripped +0 -0
    Auto merged

  sql/handler.cc
    1.166 05/04/30 03:46:36 monty@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:	monty
# Host:	narttu.mysql.com
# Root:	/home/my/mysql-5.0/RESYNC

--- 1.165/sql/handler.cc	2005-04-27 17:19:30 +03:00
+++ 1.166/sql/handler.cc	2005-04-30 03:46:36 +03:00
@@ -1773,13 +1773,17 @@
 
 int handler::rename_table(const char * from, const char * to)
 {
-  DBUG_ENTER("handler::rename_table");
-  for (const char **ext=bas_ext(); *ext ; ext++)
+  int error= 0;
+  for (const char **ext= bas_ext(); *ext ; ext++)
   {
-    if (rename_file_ext(from,to,*ext))
-      DBUG_RETURN(my_errno);
+    if (rename_file_ext(from, to, *ext))
+    {
+      if ((error=my_errno) != ENOENT)
+	break;
+      error= 0;
+    }
   }
-  DBUG_RETURN(0);
+  return error;
 }
 
 /*

--- 1.184/sql/item_func.cc	2005-04-27 17:36:59 +03:00
+++ 1.185/sql/item_func.cc	2005-04-30 03:46:36 +03:00
@@ -3271,7 +3271,8 @@
     from the argument if the argument is NULL
     and the variable has previously been initialized.
   */
-  if (!entry->collation.collation || !args[0]->null_value)
+  null_item= (args[0]->type() == NULL_ITEM);
+  if (!entry->collation.collation || !null_item)
     entry->collation.set(args[0]->collation.collation, DERIVATION_IMPLICIT);
   collation.set(entry->collation.collation, DERIVATION_IMPLICIT);
   cached_result_type= args[0]->result_type();
@@ -3315,8 +3316,8 @@
     char *pos= (char*) entry+ ALIGN_SIZE(sizeof(user_var_entry));
     if (entry->value && entry->value != pos)
       my_free(entry->value,MYF(0));
-    entry->value=0;
-    entry->length=0;
+    entry->value= 0;
+    entry->length= 0;
   }
   else
   {
@@ -3355,9 +3356,9 @@
     if (type == DECIMAL_RESULT)
       ((my_decimal*)entry->value)->fix_buffer_pointer();
     entry->length= length;
-    entry->type=type;
     entry->collation.set(cs, dv);
   }
+  entry->type=type;
   return 0;
 }
 
@@ -3366,6 +3367,12 @@
 Item_func_set_user_var::update_hash(void *ptr, uint length, Item_result type,
                                     CHARSET_INFO *cs, Derivation dv)
 {
+  /*
+    If we set a variable explicitely to NULL then keep the old
+    result type of the variable
+  */
+  if ((null_value= args[0]->null_value) && null_item)
+    type= entry->type;                          // Don't change type of item
   if (::update_hash(entry, (null_value= args[0]->null_value),
                     ptr, length, type, cs, dv))
   {

--- 1.108/sql/item_func.h	2005-04-27 15:10:26 +03:00
+++ 1.109/sql/item_func.h	2005-04-30 03:46:36 +03:00
@@ -1071,6 +1071,7 @@
   char buffer[MAX_FIELD_WIDTH];
   String value;
   my_decimal decimal_buff;
+  bool null_item;
   union
   {
     longlong vint;
Thread
bk commit into 5.0 tree (monty:1.1921)monty30 Apr