List:Internals« Previous MessageNext Message »
From:pem Date:May 27 2005 1:12pm
Subject:bk commit into 5.0 tree (pem:1.1925) BUG#9559
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of pem. When pem 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.1925 05/05/27 14:48:33 pem@stripped +3 -0
  Fixed BUG#9559: Functions: Numeric Operations using -ve value gives incorrect
                    results.
    Actually a problem when converting decimal to int for user variables.

  sql/item_func.cc
    1.201 05/05/27 14:48:27 pem@stripped +1 -1
    Don't set the unsigned flag when converting decimal user var to int.

  mysql-test/t/sp.test
    1.119 05/05/27 14:48:27 pem@stripped +19 -0
    New test case for BUG#9559.

  mysql-test/r/sp.result
    1.125 05/05/27 14:48:27 pem@stripped +11 -0
    New test case for BUG#9559.

# 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:	pem
# Host:	mysql.comhem.se
# Root:	/home/pem/work/mysql-5.0

--- 1.200/sql/item_func.cc	Thu May 26 20:35:03 2005
+++ 1.201/sql/item_func.cc	Fri May 27 14:48:27 2005
@@ -3597,7 +3597,7 @@
   case DECIMAL_RESULT:
   {
     longlong result;
-    my_decimal2int(E_DEC_FATAL_ERROR, (my_decimal *)value, 1, &result);
+    my_decimal2int(E_DEC_FATAL_ERROR, (my_decimal *)value, 0, &result);
     return result;
   }
   case STRING_RESULT:

--- 1.124/mysql-test/r/sp.result	Mon May  9 01:06:11 2005
+++ 1.125/mysql-test/r/sp.result	Fri May 27 14:48:27 2005
@@ -3098,4 +3098,15 @@
 call bug5963_2(1)|
 drop procedure bug5963_2|
 drop table t3|
+drop function if exists bug9559|
+create function bug9559()
+returns int
+begin
+set @y = -6/2;
+return @y;
+end|
+select bug9559()|
+bug9559()
+-3
+drop function bug9559|
 drop table t1,t2;

--- 1.118/mysql-test/t/sp.test	Mon May  9 01:01:22 2005
+++ 1.119/mysql-test/t/sp.test	Fri May 27 14:48:27 2005
@@ -3802,6 +3802,25 @@
 drop table t3|
 
 #
+# BUG#9559: Functions: Numeric Operations using -ve value gives incorrect
+#           results.
+#
+--disable_warnings
+drop function if exists bug9559|
+--enable_warnings
+create function bug9559()
+  returns int
+begin
+  set @y = -6/2;
+  return @y;
+end|
+
+select bug9559()|
+
+drop function bug9559|
+
+
+#
 # BUG#NNNN: New bug synopsis
 #
 #--disable_warnings
Thread
bk commit into 5.0 tree (pem:1.1925) BUG#9559pem27 May