List:Internals« Previous MessageNext Message »
From:Jim Winstead Date:June 23 2005 5:00am
Subject:bk commit into 4.1 tree (jimw:1.2311) BUG#11402
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of jimw. When jimw 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.2311 05/06/22 20:00:21 jimw@stripped +3 -0
  Fix multiplication of abs() by a negative value. (Bug #11402)

  sql/item_func.cc
    1.252 05/06/22 20:00:19 jimw@stripped +0 -3
    Don't set result of abs() to unsigned. Result should still be
    a signed value, even if always positive.

  mysql-test/t/func_math.test
    1.15 05/06/22 20:00:19 jimw@stripped +5 -0
    Add new regression test

  mysql-test/r/func_math.result
    1.23 05/06/22 20:00:19 jimw@stripped +3 -0
    Add new results

# 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:	jimw
# Host:	rama.(none)
# Root:	/home/jimw/my/mysql-4.1-11402

--- 1.251/sql/item_func.cc	2005-06-05 10:38:40 -07:00
+++ 1.252/sql/item_func.cc	2005-06-22 20:00:19 -07:00
@@ -914,10 +914,7 @@
   max_length=args[0]->max_length;
   hybrid_type= REAL_RESULT;
   if (args[0]->result_type() == INT_RESULT)
-  {
     hybrid_type= INT_RESULT;
-    unsigned_flag= 1;
-  }
 }
 
 

--- 1.22/mysql-test/r/func_math.result	2005-04-19 02:44:50 -07:00
+++ 1.23/mysql-test/r/func_math.result	2005-06-22 20:00:19 -07:00
@@ -137,3 +137,6 @@
 round(1, 6)
 1.000000
 drop table t1;
+select abs(-2) * -2;
+abs(-2) * -2
+-4

--- 1.14/mysql-test/t/func_math.test	2005-04-19 02:44:50 -07:00
+++ 1.15/mysql-test/t/func_math.test	2005-06-22 20:00:19 -07:00
@@ -71,3 +71,8 @@
 show create table t1;
 select * from t1;
 drop table t1;
+
+#
+# Bug #11402: abs() forces rest of calculation to unsigned
+#
+select abs(-2) * -2;
Thread
bk commit into 4.1 tree (jimw:1.2311) BUG#11402Jim Winstead23 Jun