From: Date: November 9 2006 2:02pm Subject: bk commit into 4.1 tree (ramil:1.2544) BUG#23616 List-Archive: http://lists.mysql.com/commits/15086 X-Bug: 23616 Message-Id: <200611091302.kA9D2lQI066095@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-11-09 17:02:44+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-11-09 17:02:40+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-11-09 17:02:40+04:00, ramil@stripped +3 -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-11-09 17:02:41+04:00, ramil@stripped +6 -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-11-09 17:02:41+04:00, ramil@stripped +4 -4 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: myoffice.izhnet.ru # Root: /usr/home/ram/work/bug23616/my41-bug23616 --- 1.11/mysql-test/r/func_sapdb.result 2006-11-09 17:02:48 +04:00 +++ 1.12/mysql-test/r/func_sapdb.result 2006-11-09 17:02:48 +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.16/sql-common/my_time.c 2006-11-09 17:02:48 +04:00 +++ 1.17/sql-common/my_time.c 2006-11-09 17:02:48 +04:00 @@ -137,10 +137,10 @@ str_to_datetime(const char *str, uint le If length= 8 or >= 14 then year is of format YYYY. (YYYY-MM-DD, YYYYMMDD, YYYYYMMDDHHMMSS) */ - for (pos=str; - pos != end && (my_isdigit(&my_charset_latin1,*pos) || *pos == 'T'); - pos++) - ; + for (pos= str; + (pos != end) && + (my_isdigit(&my_charset_latin1, *pos) || *pos == 'T' || *pos == '.'); + pos++); digits= (uint) (pos-str); start_loop= 0; /* Start of scan loop */ --- 1.44/mysql-test/r/func_time.result 2006-11-09 17:02:48 +04:00 +++ 1.45/mysql-test/r/func_time.result 2006-11-09 17:02:48 +04:00 @@ -815,4 +815,7 @@ union (select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 HOUR)),'%k') As H); H 5 +select isnull(week(now() + 0)), week(20061108.01), week(20061108085411.000002); +isnull(week(now() + 0)) week(20061108.01) week(20061108085411.000002) +0 23 45 End of 4.1 tests --- 1.39/mysql-test/t/func_time.test 2006-11-09 17:02:48 +04:00 +++ 1.40/mysql-test/t/func_time.test 2006-11-09 17:02:48 +04:00 @@ -446,4 +446,10 @@ union union (select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 HOUR)),'%k') As H); +# +# Bug 23616: datetime functions with double argumets +# + +select isnull(week(now() + 0)), week(20061108.01), week(20061108085411.000002); + --echo End of 4.1 tests