List:Commits« Previous MessageNext Message »
From:holyfoot Date:May 11 2007 2:42pm
Subject:bk commit into 5.0 tree (holyfoot:1.2483)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of hf. When hf 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-05-11 17:42:50+05:00, holyfoot@stripped +1 -0
  Merge bk@stripped:mysql-5.0-opt
  into  mysql.com:/home/hf/work/27957/my50-27957
  MERGE: 1.2473.1.1

  sql/item_func.cc@stripped, 2007-05-11 17:42:48+05:00, holyfoot@stripped +0 -0
    Auto merged
    MERGE: 1.337.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:	holyfoot
# Host:	hfmain.(none)
# Root:	/home/hf/work/27957/my50-27957/RESYNC

--- 1.338/sql/item_func.cc	2007-05-11 17:42:54 +05:00
+++ 1.339/sql/item_func.cc	2007-05-11 17:42:54 +05:00
@@ -1050,9 +1050,32 @@ longlong Item_decimal_typecast::val_int(
 my_decimal *Item_decimal_typecast::val_decimal(my_decimal *dec)
 {
   my_decimal tmp_buf, *tmp= args[0]->val_decimal(&tmp_buf);
+  bool sign;
   if ((null_value= args[0]->null_value))
     return NULL;
   my_decimal_round(E_DEC_FATAL_ERROR, tmp, decimals, FALSE, dec);
+  sign= dec->sign();
+  if (unsigned_flag)
+  {
+    if (sign)
+    {
+      my_decimal_set_zero(dec);
+      goto err;
+    }
+  }
+  if (max_length - 2 - decimals < (uint) my_decimal_intg(dec))
+  {
+    max_my_decimal(dec, max_length - 2, decimals);
+    dec->sign(sign);
+    goto err;
+  }
+  return dec;
+
+err:
+  push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+                      ER_WARN_DATA_OUT_OF_RANGE,
+                      ER(ER_WARN_DATA_OUT_OF_RANGE),
+                      name, 1);
   return dec;
 }
 
Thread
bk commit into 5.0 tree (holyfoot:1.2483)holyfoot11 May