List:Commits« Previous MessageNext Message »
From:Sergey Glukhov Date:March 24 2011 11:18am
Subject:bzr commit into mysql-5.1 branch (sergey.glukhov:3621) Bug#11766424
View as plain text  
#At file:///home/gluh/MySQL/mysql-5.1/ based on revid:sergey.glukhov@stripped

 3621 Sergey Glukhov	2011-03-24
      Bug#11766424  59527: DECIMAL_BIN_SIZE: ASSERTION `SCALE >= 0 && PRECISION > 0 && SCALE <= PRE
      Assertion happens due to missing initialization of unsigned_flag
      for Item_func_set_user_var object. It leads to incorrect
      calculation of decimal field size.
      The fix is to add initialization of unsigned_flag.
     @ mysql-test/r/variables.result
        test case
     @ mysql-test/t/variables.test
        test case
     @ sql/item_func.cc
        add initialization of unsigned_flag.

    modified:
      mysql-test/r/variables.result
      mysql-test/t/variables.test
      sql/item_func.cc
=== modified file 'mysql-test/r/variables.result'
--- a/mysql-test/r/variables.result	2011-03-15 11:36:12 +0000
+++ b/mysql-test/r/variables.result	2011-03-24 11:18:55 +0000
@@ -1543,6 +1543,15 @@ Warning	1292	Truncated incorrect key_cac
 select @@max_long_data_size;
 @@max_long_data_size
 1048576
+#
+# Bug#11766424  59527: DECIMAL_BIN_SIZE: ASSERTION `SCALE >= 0 && PRECISION > 0 && SCALE <= PRE
+#
+CREATE TABLE t1(f1 DECIMAL(1,1) UNSIGNED);
+INSERT INTO t1 VALUES (0.2),(0.1);
+SELECT 1 FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE @a=f1);
+1
+1
+DROP TABLE t1;
 SET @@global.max_binlog_cache_size=DEFAULT;
 SET @@global.max_join_size=DEFAULT;
 SET @@global.key_buffer_size=@kbs;

=== modified file 'mysql-test/t/variables.test'
--- a/mysql-test/t/variables.test	2011-03-15 11:36:12 +0000
+++ b/mysql-test/t/variables.test	2011-03-24 11:18:55 +0000
@@ -1298,6 +1298,15 @@ SET @@global.key_cache_block_size=0;
 #
 select @@max_long_data_size;
 
+--echo #
+--echo # Bug#11766424  59527: DECIMAL_BIN_SIZE: ASSERTION `SCALE >= 0 && PRECISION > 0 && SCALE <= PRE
+--echo #
+
+CREATE TABLE t1(f1 DECIMAL(1,1) UNSIGNED);
+INSERT INTO t1 VALUES (0.2),(0.1);
+SELECT 1 FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE @a=f1);
+DROP TABLE t1;
+
 # cleanup
 SET @@global.max_binlog_cache_size=DEFAULT;
 SET @@global.max_join_size=DEFAULT;

=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc	2011-03-23 12:21:52 +0000
+++ b/sql/item_func.cc	2011-03-24 11:18:55 +0000
@@ -3848,6 +3848,7 @@ Item_func_set_user_var::fix_length_and_d
   maybe_null=args[0]->maybe_null;
   max_length=args[0]->max_length;
   decimals=args[0]->decimals;
+  unsigned_flag= args[0]->unsigned_flag;
   collation.set(args[0]->collation.collation, DERIVATION_IMPLICIT);
 }
 


Attachment: [text/bzr-bundle] bzr/sergey.glukhov@oracle.com-20110324111855-87kyfempbxu4946o.bundle
Thread
bzr commit into mysql-5.1 branch (sergey.glukhov:3621) Bug#11766424Sergey Glukhov24 Mar