List:Commits« Previous MessageNext Message »
From:Tatjana A Nuernberg Date:October 2 2007 1:50am
Subject:bk commit into 5.0 tree (tnurnberg:1.2526) BUG#31253
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of tnurnberg. When tnurnberg does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-10-02 03:50:44+02:00, tnurnberg@stripped +3 -0
  Bug #31253: crash comparing datetime to double
  
  conversion to DATETIME would fail on invalid input, but processing
  was not aborted when in WHERE-clause, leading to a crash.  patch
  causes a warning on such out of range input instead.

  mysql-test/r/type_datetime.result@stripped, 2007-10-02 03:50:40+02:00, tnurnberg@stripped +9 -0
    Bug #31253: crash comparing datetime to double
    
    show that convert to datetime in a WHERE-clause will no longer crash
    the server on invalid input, but throw a warning instead. show that
    correct input is unaffected by this.

  mysql-test/t/type_datetime.test@stripped, 2007-10-02 03:50:40+02:00, tnurnberg@stripped +9 -0
    Bug #31253: crash comparing datetime to double
    
    show that convert to datetime in a WHERE-clause will no longer crash
    the server on invalid input, but throw a warning instead. show that
    correct input is unaffected by this.

  sql/item.cc@stripped, 2007-10-02 03:50:40+02:00, tnurnberg@stripped +2 -0
    Bug #31253: crash comparing datetime to double
    
    mark result NULL to prevent further processing on non-existent value.

diff -Nrup a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
--- a/mysql-test/r/type_datetime.result	2007-06-05 22:25:01 +02:00
+++ b/mysql-test/r/type_datetime.result	2007-10-02 03:50:40 +02:00
@@ -427,3 +427,12 @@ f1
 Warnings:
 Warning	1292	Incorrect datetime value: '2007010100000' for column 'f1' at row 1
 drop table t1;
+create table `t1` (`f1` time) engine=myisam;
+insert into `t1` set `f1` = '45:44:44';
+insert into `t1` set `f1` = '15:44:44';
+select * from t1 where (convert(`f1`,datetime)) != 1;
+f1
+15:44:44
+Warnings:
+Warning	1292	Truncated incorrect datetime value: '0000-00-00 45:44:44'
+drop table t1;
diff -Nrup a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test
--- a/mysql-test/t/type_datetime.test	2007-06-05 22:25:02 +02:00
+++ b/mysql-test/t/type_datetime.test	2007-10-02 03:50:40 +02:00
@@ -282,3 +282,12 @@ select * from t1 where f1 between 200201
 select * from t1 where f1 between 2002010 and 20070101000000;
 select * from t1 where f1 between 20020101 and 2007010100000;
 drop table t1;
+
+#
+# Bug #31253: crash comparing datetime to double
+#
+create table `t1` (`f1` time) engine=myisam;
+insert into `t1` set `f1` = '45:44:44';
+insert into `t1` set `f1` = '15:44:44';
+select * from t1 where (convert(`f1`,datetime)) != 1;
+drop table t1;
diff -Nrup a/sql/item.cc b/sql/item.cc
--- a/sql/item.cc	2007-09-13 15:30:28 +02:00
+++ b/sql/item.cc	2007-10-02 03:50:40 +02:00
@@ -274,6 +274,7 @@ my_decimal *Item::val_decimal_from_date(
   if (get_date(&ltime, TIME_FUZZY_DATE))
   {
     my_decimal_set_zero(decimal_value);
+    null_value= 1;
     return 0;
   }
   return date2my_decimal(&ltime, decimal_value);
@@ -287,6 +288,7 @@ my_decimal *Item::val_decimal_from_time(
   if (get_time(&ltime))
   {
     my_decimal_set_zero(decimal_value);
+    null_value= 1;
     return 0;
   }
   return date2my_decimal(&ltime, decimal_value);
Thread
bk commit into 5.0 tree (tnurnberg:1.2526) BUG#31253Tatjana A Nuernberg2 Oct
  • Re: bk commit into 5.0 tree (tnurnberg:1.2526) BUG#31253Georgi Kodinov2 Oct
Re: bk commit into 5.0 tree (tnurnberg:1.2526) BUG#31253Georgi Kodinov2 Oct