From: Date: December 26 2006 12:08pm Subject: bk commit into 4.1 tree (ramil:1.2597) BUG#23616 List-Archive: http://lists.mysql.com/commits/17385 X-Bug: 23616 Message-Id: <20061226110843.B0BF7340006F@ramil.myoffice.izhnet.ru> Below is the list of changes that have just been committed into a local 4.1 repository of ram. When ram 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, 2006-12-26 15:08:41+04:00, ramil@stripped +4 -0 Fix for bug #23616: Week() changed behaviour between 5.0.22 and 5.0.24 Consider double values as legal date{time} function's arguments (i.e. allow dates in internal format YYYYMMDDHHMMSS.XXXXXX). mysql-test/r/func_sapdb.result@stripped, 2006-12-26 15:08:39+04:00, ramil@stripped +1 -3 Fix for bug #23616: Week() changed behaviour between 5.0.22 and 5.0.24 - result adjusted. mysql-test/r/func_time.result@stripped, 2006-12-26 15:08:39+04:00, ramil@stripped +4 -0 Fix for bug #23616: Week() changed behaviour between 5.0.22 and 5.0.24 - test result. mysql-test/t/func_time.test@stripped, 2006-12-26 15:08:39+04:00, ramil@stripped +7 -0 Fix for bug #23616: Week() changed behaviour between 5.0.22 and 5.0.24 - test case. sql-common/my_time.c@stripped, 2006-12-26 15:08:39+04:00, ramil@stripped +1 -1 Fix for bug #23616: Week() changed behaviour between 5.0.22 and 5.0.24 - consider '.' as an acceptable separator for dates like YYYYYMMDDHHMMSS.XXXXXX # 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: ramil # Host: ramil.myoffice.izhnet.ru # Root: /home/ram/work/b23616/b23616.4.1 --- 1.11/mysql-test/r/func_sapdb.result 2006-12-26 15:08:43 +04:00 +++ 1.12/mysql-test/r/func_sapdb.result 2006-12-26 15:08:43 +04:00 @@ -229,9 +229,7 @@ a 10000 select microsecond(19971231235959.01) as a; a -0 -Warnings: -Warning 1292 Truncated incorrect time value: '19971231235959.01' +10000 select date_add("1997-12-31",INTERVAL "10.09" SECOND_MICROSECOND) as a; a 1997-12-31 00:00:10.090000 --- 1.18/sql-common/my_time.c 2006-12-26 15:08:43 +04:00 +++ 1.19/sql-common/my_time.c 2006-12-26 15:08:43 +04:00 @@ -145,7 +145,7 @@ str_to_datetime(const char *str, uint le digits= (uint) (pos-str); start_loop= 0; /* Start of scan loop */ date_len[format_position[0]]= 0; /* Length of year field */ - if (pos == end) + if (pos == end || *pos == '.') { /* Found date in internal format (only numbers like YYYYMMDD) */ year_length= (digits == 4 || digits == 8 || digits >= 14) ? 4 : 2; --- 1.46/mysql-test/r/func_time.result 2006-12-26 15:08:43 +04:00 +++ 1.47/mysql-test/r/func_time.result 2006-12-26 15:08:43 +04:00 @@ -854,4 +854,8 @@ H select last_day('0000-00-00'); last_day('0000-00-00') NULL +select isnull(week(now() + 0)), isnull(week(now() + 0.2)), +week(20061108), week(20061108.01), week(20061108085411.000002); +isnull(week(now() + 0)) isnull(week(now() + 0.2)) week(20061108) week(20061108.01) week(20061108085411.000002) +0 0 45 45 45 End of 4.1 tests --- 1.41/mysql-test/t/func_time.test 2006-12-26 15:08:43 +04:00 +++ 1.42/mysql-test/t/func_time.test 2006-12-26 15:08:43 +04:00 @@ -492,4 +492,11 @@ union select last_day('0000-00-00'); +# +# Bug 23616: datetime functions with double argumets +# + +select isnull(week(now() + 0)), isnull(week(now() + 0.2)), + week(20061108), week(20061108.01), week(20061108085411.000002); + --echo End of 4.1 tests