Comment 1 for bug 1388357

Revision history for this message
Valerii Kravchuk (valerii-kravchuk) wrote :

This is easy to confirm:

[openxs@centos ~]$ mysql -uroot test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.21-70.0 Percona Server (GPL), Release 70.0, Revision 688

Copyright (c) 2009-2014 Percona LLC and/or its affiliates
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SELECT WEEK('2000-01-01',0);
+----------------------+
| WEEK('2000-01-01',0) |
+----------------------+
| 0 |
+----------------------+
1 row in set (0.00 sec)

mysql> SELECT WEEK('2000-01-01',2);
+----------------------+
| WEEK('2000-01-01',2) |
+----------------------+
| 52 |
+----------------------+
1 row in set (0.00 sec)

mysql> SET STATEMENT default_week_format = 2 FOR SELECT WEEK('2000-01-01');
+--------------------+
| WEEK('2000-01-01') |
+--------------------+
| 0 |
+--------------------+
1 row in set (0.00 sec)

mysql> SET default_week_format = 2;
Query OK, 0 rows affected (0.00 sec)

mysql> SELECT WEEK('2000-01-01');
+--------------------+
| WEEK('2000-01-01') |
+--------------------+
| 52 |
+--------------------+
1 row in set (0.01 sec)