List:Commits« Previous MessageNext Message »
From:Sergey Glukhov Date:May 26 2011 10:13am
Subject:bzr commit into mysql-trunk branch (sergey.glukhov:3121)
View as plain text  
#At file:///home/gluh/MySQL/mysql-trunk/ based on revid:tor.didriksen@stripped

 3121 Sergey Glukhov	2011-05-26 [merge]
      5.5 -> trunk merge
     @ mysql-test/r/func_math.result
        5.5 -> trunk merge
     @ mysql-test/t/func_math.test
        5.5 -> trunk merge
     @ sql/item_func.cc
        5.5 -> trunk merge

    modified:
      mysql-test/r/func_math.result
      mysql-test/t/func_math.test
      sql/item_func.cc
=== modified file 'mysql-test/r/func_math.result'
--- a/mysql-test/r/func_math.result	2011-04-20 07:56:57 +0000
+++ b/mysql-test/r/func_math.result	2011-05-26 10:13:07 +0000
@@ -543,6 +543,12 @@ ROUND(LEAST(15, -4939092, 0.2704), STDDE
 -4939092.0000
 Warnings:
 Warning	1292	Truncated incorrect DOUBLE value: 'a'
+#
+# Bug#12392636  ASSERTION FAILED: SCALE >= 0 && PRECISION > 0 && SCALE <= PRECISION
+#
+SELECT SUM(DISTINCT (TRUNCATE((.1), NULL)));
+SUM(DISTINCT (TRUNCATE((.1), NULL)))
+NULL
 End of 5.1 tests
 #
 # Bug #8433: Overflow must be an error

=== modified file 'mysql-test/t/func_math.test'
--- a/mysql-test/t/func_math.test	2011-04-20 07:56:57 +0000
+++ b/mysql-test/t/func_math.test	2011-05-26 10:13:07 +0000
@@ -370,6 +370,12 @@ DROP TABLE t1;
 
 SELECT ROUND(LEAST(15, -4939092, 0.2704), STDDEV('a'));
 
+--echo #
+--echo # Bug#12392636  ASSERTION FAILED: SCALE >= 0 && PRECISION > 0 && SCALE <= PRECISION
+--echo #
+
+SELECT SUM(DISTINCT (TRUNCATE((.1), NULL)));
+
 --echo End of 5.1 tests
 
 --echo #

=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc	2011-05-21 09:31:19 +0000
+++ b/sql/item_func.cc	2011-05-26 10:13:07 +0000
@@ -2273,6 +2273,9 @@ void Item_func_round::fix_length_and_dec
   }
 
   val1= args[1]->val_int();
+  if ((null_value= args[1]->is_null()))
+    return;
+
   val1_unsigned= args[1]->unsigned_flag;
   if (val1 < 0)
     decimals_to_set= val1_unsigned ? INT_MAX : 0;

No bundle (reason: revision is a merge (you can force generation of a bundle with env var BZR_FORCE_BUNDLE=1)).
Thread
bzr commit into mysql-trunk branch (sergey.glukhov:3121) Sergey Glukhov26 May