List:Commits« Previous MessageNext Message »
From:tim Date:September 13 2006 11:41pm
Subject:bk commit into 5.1 tree (tsmith:1.2319)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tim. When tim 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, 2006-09-13 15:41:15-06:00, tsmith@stripped +3 -0
  Merge bk-internal:/home/bk/mysql-5.1-maint
  into  siva.hindu.god:/usr/home/tim/m/bk/tmp/51-mrg50
  MERGE: 1.2313.1.2

  sql/item_func.h@stripped, 2006-09-13 15:41:10-06:00, tsmith@stripped +0 -0
    Auto merged
    MERGE: 1.148.1.1

  sql/item_strfunc.cc@stripped, 2006-09-13 15:41:10-06:00, tsmith@stripped +0 -0
    Auto merged
    MERGE: 1.290.1.1

  sql/sql_class.h@stripped, 2006-09-13 15:41:10-06:00, tsmith@stripped +0 -0
    Auto merged
    MERGE: 1.317.1.1

# 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:	tsmith
# Host:	siva.hindu.god
# Root:	/usr/home/tim/m/bk/tmp/51-mrg50/RESYNC

--- 1.291/sql/item_strfunc.cc	2006-09-13 15:41:23 -06:00
+++ 1.292/sql/item_strfunc.cc	2006-09-13 15:41:23 -06:00
@@ -2381,17 +2381,33 @@ String *Item_func_conv::val_str(String *
       abs(to_base) > 36 || abs(to_base) < 2 ||
       abs(from_base) > 36 || abs(from_base) < 2 || !(res->length()))
   {
-    null_value=1;
-    return 0;
+    null_value= 1;
+    return NULL;
   }
-  null_value=0;
+  null_value= 0;
   unsigned_flag= !(from_base < 0);
-  if (from_base < 0)
-    dec=
my_strntoll(res->charset(),res->ptr(),res->length(),-from_base,&endptr,&err);
+
+  if (args[0]->field_type() == MYSQL_TYPE_BIT) 
+  {
+    /* 
+     Special case: The string representation of BIT doesn't resemble the
+     decimal representation, so we shouldn't change it to string and then to
+     decimal. 
+    */
+    dec= args[0]->val_int();
+  }
   else
-    dec= (longlong)
my_strntoull(res->charset(),res->ptr(),res->length(),from_base,&endptr,&err);
-  ptr= longlong2str(dec,ans,to_base);
-  if (str->copy(ans,(uint32) (ptr-ans), default_charset()))
+  {
+    if (from_base < 0)
+      dec= my_strntoll(res->charset(), res->ptr(), res->length(),
+                       -from_base, &endptr, &err);
+    else
+      dec= (longlong) my_strntoull(res->charset(), res->ptr(), res->length(),
+                                   from_base, &endptr, &err);
+  }
+
+  ptr= longlong2str(dec, ans, to_base);
+  if (str->copy(ans, (uint32) (ptr-ans), default_charset()))
     return &my_empty_string;
   return str;
 }
Thread
bk commit into 5.1 tree (tsmith:1.2319)tim13 Sep