List:Commits« Previous MessageNext Message »
From:Sergey Glukhov Date:March 30 2011 7:26am
Subject:bzr commit into mysql-5.5 branch (sergey.glukhov:3414)
View as plain text  
#At file:///home/gluh/MySQL/mysql-5.5/ based on revid:magne.mahre@stripped

 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
=== 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: revision is a merge (you can force generation of a bundle with env var BZR_FORCE_BUNDLE=1)).
Thread
bzr commit into mysql-5.5 branch (sergey.glukhov:3414) Sergey Glukhov30 Mar