Bug #417 default_week_format
Submitted: 12 May 2003 2:00 Modified: 2 Jun 2003 9:21
Reporter: Peter Zaitsev (Basic Quality Contributor) Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Server Severity:S2 (Serious)
Version:4.0 OS:
Assigned to: CPU Architecture:Any

[12 May 2003 2:00] Peter Zaitsev
In MySQL 4.0 we've changed MySQL WEEK() function to match USA calendar by default.

According to the documentation default-week-format variable shall be used to adjust this behavior, however it does not work.

This is serious issues as it limits migration possibilities for some applications using MySQL 3.23

How to repeat:
mysql> set GLOBAL default_week_format=1;
ERROR 1193: Unknown system variable 'default_week_format'
[13 May 2003 9:33] Michael Widenius
Thank you for taking the time to report a problem.  Unfortunately
you are not using a current version of the product your reported a
problem with -- the problem might already be fixed. Please download
a new version from http://www.mysql.com/downloads/

If you are able to reproduce the bug with one of the latest versions,
please change the version on this bug report to the version you
tested and change the status back to "Open".  Again, thank you for
your continued support of MySQL.

default_week_format was introduced in MySQL 4.1, not in 4.0
[2 Jun 2003 9:21] Michael Widenius
Additional comment:

The defintion of WEEK() never really changed in MySQL 4.0, we only fixed a bug so that it should work as expected in USA and other countries where Sunday is the first day of the week.

To get an european return value one has always had to set the optional arguments to 1 for the WEEK() function.  The thing that was confusing was that the old return value of WEEK() was right for europeans 6 years of 7.

The reason for not updating 3.23 was that we didn't want to cause problems for people that already depended on the old (wrong) return value of WEEK().