From: Date: January 13 2006 2:43pm Subject: bk commit into 4.1 tree (gvb:1.2481) BUG#15828 List-Archive: http://lists.mysql.com/commits/1037 X-Bug: 15828 Message-Id: <20060113134300.528CBC14A@phoenix> Below is the list of changes that have just been committed into a local 4.1 repository of gvb. When gvb 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 1.2481 06/01/13 14:42:46 gvb@phoenix.(none) +3 -0 fix for bug#15828 problem was not checking 2nd parameter of str_to_date against NULL sql/item_timefunc.cc 1.94 06/01/13 14:40:51 gvb@phoenix.(none) +1 -1 mysql-test/r/date_formats.result 1.17 06/01/13 14:40:46 gvb@phoenix.(none) +6 -0 bk commit mysql-test/t/date_formats.test 1.14 06/01/13 14:39:39 gvb@phoenix.(none) +7 -0 fix for bug#15828 problem was not checking 2nd parameter of str_to_date against NULL # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: gvb # Host: phoenix.(none) # Root: /data/mysql-4.1-BK --- 1.93/sql/item_timefunc.cc 2005-11-01 11:59:53 +01:00 +++ 1.94/sql/item_timefunc.cc 2006-01-13 14:40:51 +01:00 @@ -2750,7 +2750,7 @@ cached_field_type= MYSQL_TYPE_STRING; max_length= MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; cached_timestamp_type= MYSQL_TIMESTAMP_NONE; - if ((const_item= args[1]->const_item())) + if ((const_item= args[1]->const_item()) && !args[1]->null_value) { format= args[1]->val_str(&format_str); cached_format_type= get_date_time_result_type(format->ptr(), --- 1.16/mysql-test/r/date_formats.result 2005-10-25 18:35:31 +02:00 +++ 1.17/mysql-test/r/date_formats.result 2006-01-13 14:40:46 +01:00 @@ -464,3 +464,9 @@ 02 February 01 January drop table t1; +select str_to_date( 1, NULL ); +str_to_date( 1, NULL ) +NULL +select str_to_date( NULL, 1 ); +str_to_date( NULL, 1 ) +NULL --- 1.13/mysql-test/t/date_formats.test 2005-10-25 18:35:50 +02:00 +++ 1.14/mysql-test/t/date_formats.test 2006-01-13 14:39:39 +01:00 @@ -268,4 +268,11 @@ insert into t1 (f1) values ("2005-02-01"); select date_format(f1, "%m") as d1, date_format(f1, "%M") as d2 from t1 order by date_format(f1, "%M"); drop table t1; + +# +# Bug #15828 +# +select str_to_date( 1, NULL ); +select str_to_date( NULL, 1 ); + # End of 4.1 tests