MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:holyfoot Date:October 26 2005 6:54am
Subject:bk commit into 5.0 tree (hf:1.2046) BUG#13573
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
  1.2046 05/10/26 11:54:15 hf@deer.(none) +1 -0
  Additional fix for bug #13573

  sql/item_func.cc
    1.261 05/10/26 11:54:06 hf@deer.(none) +8 -9
    don't return NULL when we got E_DEC_OVERFLOW

# 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:	hf
# Host:	deer.(none)
# Root:	/home/hf/work/mysql-5.0.13573

--- 1.260/sql/item_func.cc	Sat Oct 15 21:55:26 2005
+++ 1.261/sql/item_func.cc	Wed Oct 26 11:54:06 2005
@@ -1124,6 +1124,7 @@
 {
   my_decimal value1, *val1;
   my_decimal value2, *val2;
+  int err;
 
   val1= args[0]->val_decimal(&value1);
   if ((null_value= args[0]->null_value))
@@ -1131,17 +1132,15 @@
   val2= args[1]->val_decimal(&value2);
   if ((null_value= args[1]->null_value))
     return 0;
-  switch (my_decimal_div(E_DEC_FATAL_ERROR & ~E_DEC_DIV_ZERO, decimal_value,
-                         val1, val2, prec_increment)) {
-  case E_DEC_TRUNCATED:
-  case E_DEC_OK:
-    return decimal_value;
-  case E_DEC_DIV_ZERO:
-    signal_divide_by_null();
-  default:
-    null_value= 1;                              // Safety
+  if ((err= my_decimal_div(E_DEC_FATAL_ERROR & ~E_DEC_DIV_ZERO, decimal_value,
+                           val1, val2, prec_increment)) > 3)
+  {
+    if (err == E_DEC_DIV_ZERO)
+      signal_divide_by_null();
+    null_value= 1;
     return 0;
   }
+  return decimal_value;
 }
 
 
Thread
bk commit into 5.0 tree (hf:1.2046) BUG#13573holyfoot26 Oct