From: Sergey Glukhov Date: March 30 2011 7:43am Subject: bzr push into mysql-5.5 branch (sergey.glukhov:3413 to 3414) List-Archive: http://lists.mysql.com/commits/134215 Message-Id: <201103300744.p2U7iohA002533@acsmt357.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3414 Sergey Glukhov 2011-03-30 [merge] 5.1 -> 5.5 merge @ mysql-test/r/func_time.result 5.1 -> 5.5 merge @ mysql-test/t/func_time.test 5.1 -> 5.5 merge @ sql/item.cc 5.1 -> 5.5 merge @ sql/item_timefunc.h 5.1 -> 5.5 merge modified: mysql-test/r/func_time.result mysql-test/t/func_time.test sql/item.cc sql/item_timefunc.h 3413 Magne Mahre 2011-03-29 Bug#11933945 REMOVE LGPL LICENSED FILES IN MYSQL 5.5 The LGPL license is used in some legacy code, and to adhere to current licensing polity, we remove those files that are no longer used, and reorganize the remaining LGPL code so it will be GPL licensed from now on. Note: This patch only removed LGPL licensed files in MySQL 5.5 and later, and is the third of a set of patches to remove LGPL from all trees. (See Bug# 11840513 for details) 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/heap.h include/my_global.h include/my_net.h include/myisam.h mysys/CMakeLists.txt mysys/my_handler_errors.h sql/handler.h storage/myisam/ft_stopwords.c storage/myisam/mi_check.c === modified file 'mysql-test/r/func_time.result' --- a/mysql-test/r/func_time.result 2011-03-28 13:33:35 +0000 +++ b/mysql-test/r/func_time.result 2011-03-30 07:25:49 +0000 @@ -1365,6 +1365,18 @@ SET GLOBAL SQL_MODE=DEFAULT; SELECT FORMAT(YEAR(STR_TO_DATE('',GET_FORMAT(TIME,''))),1); FORMAT(YEAR(STR_TO_DATE('',GET_FORMAT(TIME,''))),1) NULL +# +# Bug#11766126 59166: ANOTHER DATETIME VALGRIND UNINITIALIZED WARNING +# +SELECT CAST((MONTH(FROM_UNIXTIME(@@GLOBAL.SQL_MODE))) AS BINARY(1025)); +CAST((MONTH(FROM_UNIXTIME(@@GLOBAL.SQL_MODE))) AS BINARY(1025)) +NULL +# +# Bug#11766124 59164: VALGRIND: UNINITIALIZED VALUE IN NUMBER_TO_DATETIME +# +SELECT ADDDATE(MONTH(FROM_UNIXTIME(NULL)),INTERVAL 1 HOUR); +ADDDATE(MONTH(FROM_UNIXTIME(NULL)),INTERVAL 1 HOUR) +NULL End of 5.1 tests # # Bug#57039: constant subtime expression returns incorrect result. === modified file 'mysql-test/t/func_time.test' --- a/mysql-test/t/func_time.test 2011-03-28 13:33:35 +0000 +++ b/mysql-test/t/func_time.test 2011-03-30 07:25:49 +0000 @@ -882,6 +882,18 @@ SET GLOBAL SQL_MODE=DEFAULT; SELECT FORMAT(YEAR(STR_TO_DATE('',GET_FORMAT(TIME,''))),1); +--echo # +--echo # Bug#11766126 59166: ANOTHER DATETIME VALGRIND UNINITIALIZED WARNING +--echo # + +SELECT CAST((MONTH(FROM_UNIXTIME(@@GLOBAL.SQL_MODE))) AS BINARY(1025)); + +--echo # +--echo # Bug#11766124 59164: VALGRIND: UNINITIALIZED VALUE IN NUMBER_TO_DATETIME +--echo # + +SELECT ADDDATE(MONTH(FROM_UNIXTIME(NULL)),INTERVAL 1 HOUR); + --echo End of 5.1 tests --echo # === modified file 'sql/item.cc' --- a/sql/item.cc 2011-03-16 14:11:20 +0000 +++ b/sql/item.cc 2011-03-30 07:25:49 +0000 @@ -997,8 +997,12 @@ bool Item::get_date(MYSQL_TIME *ltime,ui } else { - longlong value= val_int(); int was_cut; + longlong value= val_int(); + + if (null_value) + goto err; + if (number_to_datetime(value, ltime, fuzzydate, &was_cut) == LL(-1)) { char buff[22], *end; === modified file 'sql/item_timefunc.h' --- a/sql/item_timefunc.h 2011-03-08 17:39:25 +0000 +++ b/sql/item_timefunc.h 2011-03-30 07:25:49 +0000 @@ -144,8 +144,11 @@ public: { DBUG_ASSERT(fixed == 1); return (double) Item_func_month::val_int(); } String *val_str(String *str) { - str->set(val_int(), collation.collation); - return null_value ? 0 : str; + longlong nr= val_int(); + if (null_value) + return 0; + str->set(nr, collation.collation); + return str; } const char *func_name() const { return "month"; } enum Item_result result_type () const { return INT_RESULT; } No bundle (reason: useless for push emails).