SET STATEMENT default_week_format has no effect

Bug #1388357 reported by Elena Stepanova on 2014-11-01
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.6
Triaged
Medium
Unassigned
5.7
Triaged
Medium
Unassigned

Bug Description

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

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

MySQL [test]> 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 [test]> SET default_week_format = 2;
Query OK, 0 rows affected (0.00 sec)

MySQL [test]> SELECT WEEK('2000-01-01');
+--------------------+
| WEEK('2000-01-01') |
+--------------------+
| 52 |
+--------------------+
1 row in set (0.00 sec)

revision-id: <email address hidden>
date: 2014-10-21 11:25:15 +0300
build-date: 2014-11-01 15:33:25 +0400
revno: 687
branch-nick: percona-5.6

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)

tags: added: set-statement

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1574

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers