From: Sergey Glukhov Date: March 28 2011 9:12am Subject: bzr push into mysql-5.1 branch (sergey.glukhov:3634) List-Archive: http://lists.mysql.com/commits/134004 Message-Id: <201103280914.p2S9Ea9S027242@acsmt357.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3634 Sergey Glukhov 2011-03-28 [merge] automerge removed: include/my_handler.h mysys/my_gethostbyname.c mysys/my_handler.c mysys/my_port.c added: include/my_compare.h mysys/my_compare.c modified: extra/perror.c include/Makefile.am include/heap.h include/my_global.h include/myisam.h libmysql/CMakeLists.txt libmysql/Makefile.shared mysys/CMakeLists.txt mysys/Makefile.am mysys/my_net.c sql/field.h sql/handler.h storage/myisam/ft_stopwords.c storage/myisam/mi_check.c storage/myisam/mi_test1.c storage/myisam/mi_write.c storage/myisam/myisamdef.h storage/myisam/sp_test.c === modified file 'mysql-test/r/func_math.result' --- a/mysql-test/r/func_math.result 2010-12-24 11:05:04 +0000 +++ b/mysql-test/r/func_math.result 2011-03-28 08:35:50 +0000 @@ -511,4 +511,11 @@ t1 CREATE TABLE `t1` ( `C` varchar(23) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; +# +# Bug#11764994 57900: CREATE TABLE .. SELECT ASSERTS SCALE >= 0 && PRECISION > 0 && SCALE <= PR +# +CREATE TABLE t1 SELECT CEIL(LINESTRINGFROMWKB(1) DIV NULL); +DROP TABLE t1; +CREATE TABLE t1 SELECT FLOOR(LINESTRINGFROMWKB(1) DIV NULL); +DROP TABLE t1; End of 5.1 tests === modified file 'mysql-test/r/variables.result' --- a/mysql-test/r/variables.result 2011-03-25 10:57:27 +0000 +++ b/mysql-test/r/variables.result 2011-03-28 08:28:30 +0000 @@ -1547,6 +1547,22 @@ 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; +CREATE TABLE t1 AS SELECT @a:= CAST(1 AS UNSIGNED) AS a; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(1) unsigned NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +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/func_math.test' --- a/mysql-test/t/func_math.test 2010-12-24 11:05:04 +0000 +++ b/mysql-test/t/func_math.test 2011-03-28 08:35:50 +0000 @@ -324,4 +324,13 @@ CREATE TABLE t1 SELECT CAST((CASE(('')) SHOW CREATE TABLE t1; DROP TABLE t1; +--echo # +--echo # Bug#11764994 57900: CREATE TABLE .. SELECT ASSERTS SCALE >= 0 && PRECISION > 0 && SCALE <= PR +--echo # + +CREATE TABLE t1 SELECT CEIL(LINESTRINGFROMWKB(1) DIV NULL); +DROP TABLE t1; +CREATE TABLE t1 SELECT FLOOR(LINESTRINGFROMWKB(1) DIV NULL); +DROP TABLE t1; + --echo End of 5.1 tests === modified file 'mysql-test/t/variables.test' --- a/mysql-test/t/variables.test 2011-03-25 10:57:27 +0000 +++ b/mysql-test/t/variables.test 2011-03-28 08:28:30 +0000 @@ -1298,6 +1298,19 @@ 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; + +CREATE TABLE t1 AS SELECT @a:= CAST(1 AS UNSIGNED) AS a; +SHOW CREATE TABLE t1; +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-03 12:04:04 +0000 +++ b/sql/item_func.cc 2011-03-28 08:35:50 +0000 @@ -1803,9 +1803,10 @@ void Item_func_integer::fix_length_and_d void Item_func_int_val::fix_num_length_and_dec() { - max_length= args[0]->max_length - (args[0]->decimals ? - args[0]->decimals + 1 : - 0) + 2; + ulonglong tmp_max_length= (ulonglong ) args[0]->max_length - + (args[0]->decimals ? args[0]->decimals + 1 : 0) + 2; + max_length= tmp_max_length > (ulonglong) max_field_size ? + max_field_size : (uint32) tmp_max_length; uint tmp= float_length(decimals); set_if_smaller(max_length,tmp); decimals= 0; @@ -3840,6 +3841,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); } No bundle (reason: useless for push emails).