Bug #34126 DATE_FORMAT strange behavior 3.23.54 vs. 5.0.24 version
Submitted: 29 Jan 2008 8:35 Modified: 30 Jan 2008 5:21
Reporter: Gregory Vinopal Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:3.23.54 and 5.0.24a OS:Linux (Suso)
Assigned to: CPU Architecture:Any

[29 Jan 2008 8:35] Gregory Vinopal
Description:
different result receiving from DATA_FORMAT with %U parameter
with 3.23.54 and 5.0.24a MySQl versions

How to repeat:
result in 3.23.54 version

mysql> SELECT DATE_FORMAT('2007-01-01', 'ww%U');
+-----------------------------------+
| DATE_FORMAT('2007-01-01', 'ww%U') |
+-----------------------------------+
| ww01                              |
+-----------------------------------+

vs. 5.0.24a version 

+-----------------------------------+
| DATE_FORMAT('2007-01-01', 'ww%U') |
+-----------------------------------+
| ww00                              |
+-----------------------------------+
[29 Jan 2008 8:54] Valeriy Kravchuk
In any case, 5.0.x result is not a bug. According to http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-format:

"%U 	Week (00..53), where Sunday is the first day of the week"

and January 1 2007 was on Monday, first week of the year (00).
[29 Jan 2008 12:47] Gregory Vinopal
in any case, What about 3.23.54 result?
[30 Jan 2008 5:21] Valeriy Kravchuk
Well, 3.23.54 is so old that nobody will fix anything there, even if you found a new bug. It is not supported any more according to http://www.mysql.com/company/legal/lifecycle/.

Please, try also never 3.23.x version, 3.23.58.