Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

date_to_str formatter is wrong #6467

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

date_to_str formatter is wrong #6467

monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
bug Something isn't working major SQL

Comments

@monetdb-team
Copy link

Date: 2017-11-14 05:49:27 +0100
From: Antoine Jouanjean <<antoine.jouanjean>>
To: SQL devs <>
Version: 11.27.9 (Jul2017-SP2)
CC: @njnes

Last updated: 2017-12-14 14:46:01 +0100

Comment 25875

Date: 2017-11-14 05:49:27 +0100
From: Antoine Jouanjean <<antoine.jouanjean>>

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
Build Identifier:

Date/time format specifiers for week number and days name does not seems to work properly.

Reproducible: Always

Steps to Reproduce:

❯ mclient -d demodb
Welcome to mclient, the MonetDB/SQL interactive terminal (Jul2017-SP2)
Database: MonetDB v11.27.9 (Jul2017-SP2), 'mapi:monetdb://theserver:50000/demodb'
Type \q to quit, ? for a list of available commands
auto commit mode: on
sql>SELECT CURRENT_DATE, EXTRACT(year from current_date), date_to_str(CURRENT_DATE, '%Y %m %d -A:%A -G:%G V:%V w:%w W:%W');
+------------+------+--------------------------------------------+
| L2 | L4 | L6 |
+============+======+============================================+
| 2017-11-14 | 2017 | 2017 11 14 -A:Sunday -G:2016 V:52 w:0 W:00 |
+------------+------+--------------------------------------------+

Actual Results:

+------------+------+--------------------------------------------+
| L2 | L4 | L6 |
+============+======+============================================+
| 2017-11-14 | 2017 | 2017 11 14 -A:Sunday -G:2016 V:52 w:0 W:00 |
+------------+------+--------------------------------------------+

Expected Results:

+------------+------+---------------------------------------------+
| L2 | L4 | L6 |
+============+======+=============================================+
| 2017-11-14 | 2017 | 2017 11 14 -A:Tuesday -G:2017 V:46 w:2 W:46 |
+------------+------+---------------------------------------------+

Thought of a localization issue but LC_ALL=C mclient -d demodb gives identical results

Comment 25878

Date: 2017-11-15 14:26:21 +0100
From: MonetDB Mercurial Repository <>

Changeset 9fc902729295 made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=9fc902729295

Changeset description:

re-init the tm structure using mktime (solves bug #6467).

Comment 25879

Date: 2017-11-15 14:41:00 +0100
From: MonetDB Mercurial Repository <>

Changeset 525499af2586 made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=525499af2586

Changeset description:

fixed bug #6467

Comment 25880

Date: 2017-11-15 14:41:25 +0100
From: @njnes

Fixed by finishing the initialization of the tm struct using mktime().

@monetdb-team monetdb-team added bug Something isn't working major SQL labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working major SQL
Projects
None yet
Development

No branches or pull requests

2 participants