Bug #24956 default_week_format does not affect yearweek()
| Submitted: | 11 Dec 2006 14:08 | Modified: | 28 Sep 2010 14:06 |
|---|---|---|---|
| Reporter: | Samuel Zayas | Email Updates: | |
| Status: | Duplicate | Impact on me: | |
| Category: | MySQL Server: General | Severity: | S4 (Feature request) |
| Version: | 5.0.22-community-nt | OS: | Windows (Windows XP) |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | default_week_format, week, year, yearweek | ||
[14 Dec 2006 16:27]
Hartmut Holzgraefe
Verified, filed as feature request.
[28 Sep 2010 14:06]
Mattias Jonsson
Closing as duplicate of bug#30454.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.051 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: The dynamic variable default_week_format doesn't affect the datetime function yearweek(). It seems the default mode of yearweek is 2. The behaviour doesn't quite feel logical as the functions are very close. How to repeat: set global default_week_format=0; select week("2001-01-01"), yearweek("2001-01-01"); returns: 0, 200053 set global default_week_format=2; select week("2001-01-01"), yearweek("2001-01-01"); returns: 53, 200053 set global default_week_format=5; select week("2001-01-01"), yearweek("2001-01-01"); returns: 1, 200053 Suggested fix: The default_week_format variable could affect yearweek() aswell as week(). The possibility to pass the mode to the yearweek(date,[mode]) function is used as a workaround for now. select yearweek("2001-01-01",5); returns 200101 as expected.