List:Commits« Previous MessageNext Message »
From:Sergey Glukhov Date:May 4 2011 8:13am
Subject:bzr commit into mysql-5.1 branch (sergey.glukhov:3674) Bug#12403504
View as plain text  
#At file:///home/gluh/MySQL/mysql-5.1/ based on revid:sergey.glukhov@stripped

 3674 Sergey Glukhov	2011-05-04
      Bug#12403504 AFTER FIX FOR #11889186 : ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0
      There is a missing check for 'year' parameter(year can not be greater than 9999) in
      makedate function. The fix is to addd check that year can not be greater than 9999.
     @ mysql-test/r/func_time.result
        test case
     @ mysql-test/t/func_time.test
        test case
     @ sql/item_timefunc.cc
        added check that year can not be greater than 9999.

    modified:
      mysql-test/r/func_time.result
      mysql-test/t/func_time.test
      sql/item_timefunc.cc
=== modified file 'mysql-test/r/func_time.result'
--- a/mysql-test/r/func_time.result	2011-04-27 07:35:57 +0000
+++ b/mysql-test/r/func_time.result	2011-05-04 08:13:21 +0000
@@ -1417,4 +1417,10 @@ NULL
 SELECT DATE_FORMAT('0000-00-11', '%w');
 DATE_FORMAT('0000-00-11', '%w')
 NULL
+#
+# Bug#12403504  AFTER FIX FOR #11889186 : ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0
+#
+SELECT MAKEDATE(11111111,1);
+MAKEDATE(11111111,1)
+NULL
 End of 5.1 tests

=== modified file 'mysql-test/t/func_time.test'
--- a/mysql-test/t/func_time.test	2011-04-27 07:35:57 +0000
+++ b/mysql-test/t/func_time.test	2011-05-04 08:13:21 +0000
@@ -921,4 +921,10 @@ SELECT DATE_FORMAT('0000-00-11', '%W');
 SELECT DATE_FORMAT('0000-00-11', '%a');
 SELECT DATE_FORMAT('0000-00-11', '%w');
 
+--echo #
+--echo # Bug#12403504  AFTER FIX FOR #11889186 : ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0
+--echo #
+
+SELECT MAKEDATE(11111111,1);
+
 --echo End of 5.1 tests

=== modified file 'sql/item_timefunc.cc'
--- a/sql/item_timefunc.cc	2011-04-27 07:35:57 +0000
+++ b/sql/item_timefunc.cc	2011-05-04 08:13:21 +0000
@@ -2684,7 +2684,7 @@ String *Item_func_makedate::val_str(Stri
   long days;
 
   if (args[0]->null_value || args[1]->null_value ||
-      year < 0 || daynr <= 0)
+      year < 0 || year > 9999 || daynr <= 0)
     goto err;
 
   if (year < 100)
@@ -2727,7 +2727,7 @@ longlong Item_func_makedate::val_int()
   long days;
 
   if (args[0]->null_value || args[1]->null_value ||
-      year < 0 || daynr <= 0)
+      year < 0 || year > 9999 || daynr <= 0)
     goto err;
 
   if (year < 100)


Attachment: [text/bzr-bundle] bzr/sergey.glukhov@oracle.com-20110504081321-r7nr464pds0ngusz.bundle
Thread
bzr commit into mysql-5.1 branch (sergey.glukhov:3674) Bug#12403504Sergey Glukhov4 May