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

str_to_time('11:40', '%H:%M') creates wrong time value #6791

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

str_to_time('11:40', '%H:%M') creates wrong time value #6791

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

Comments

@monetdb-team
Copy link

Date: 2019-11-28 16:37:32 +0100
From: Martin van Dinther <<martin.van.dinther>>
To: SQL devs <>
Version: 11.35.3 (Nov2019)
CC: @PedroTadim

Last updated: 2019-12-20 15:36:33 +0100

Comment 27423

Date: 2019-11-28 16:37:32 +0100
From: Martin van Dinther <<martin.van.dinther>>

User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0
Build Identifier:

The query:
SELECT str_to_date('23-09-1987', '%d-%m-%Y') AS "date",
str_to_time('11:40', '%H:%M') AS "time",
str_to_timestamp('23-09-1987 11:40', '%d-%m-%Y %H:%M') AS "timestamp";
as documented on https://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/DateTimeFunctionality returns wrong output for the "time":
+------------+----------+----------------------------+
| date | time | timestamp |
+============+==========+============================+
| 1987-09-23 | 12:37:12 | 1987-09-23 11:40:00.000000 |
+------------+----------+----------------------------+
Expected value 11:40:00 for the "time" column.

Reproducible: Always

Steps to Reproduce:

SELECT str_to_date('23-09-1987', '%d-%m-%Y') AS "date",
str_to_time('11:40', '%H:%M') AS "time",
str_to_timestamp('23-09-1987 11:40', '%d-%m-%Y %H:%M') AS "timestamp";

Actual Results:

sql>SELECT str_to_date('23-09-1987', '%d-%m-%Y') AS "date",
more> str_to_time('11:40', '%H:%M') AS "time",
more> str_to_timestamp('23-09-1987 11:40', '%d-%m-%Y %H:%M') AS "timestamp";
+------------+----------+----------------------------+
| date | time | timestamp |
+============+==========+============================+
| 1987-09-23 | 12:37:12 | 1987-09-23 11:40:00.000000 |
+------------+----------+----------------------------+
1 tuple
sql>

Expected Results:

sql>SELECT str_to_date('23-09-1987', '%d-%m-%Y') AS "date",
more> str_to_time('11:40', '%H:%M') AS "time",
more> str_to_timestamp('23-09-1987 11:40', '%d-%m-%Y %H:%M') AS "timestamp";
+------------+----------+----------------------------+
| date | time | timestamp |
+============+==========+============================+
| 1987-09-23 | 11:40:00 | 1987-09-23 11:40:00.000000 |
+------------+----------+----------------------------+
1 tuple
sql>

Comment 27427

Date: 2019-11-28 17:38:46 +0100
From: MonetDB Mercurial Repository <>

Changeset 9e62a1c60d33 made by Martin van Dinther martin.van.dinther@monetdbsolutions.com in the MonetDB repo, refers to this bug.

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

Changeset description:

Add test for bug #6791

Comment 27428

Date: 2019-11-28 18:00:48 +0100
From: MonetDB Mercurial Repository <>

Changeset 1aab946302bb made by Pedro Ferreira pedro.ferreira@monetdbsolutions.com in the MonetDB repo, refers to this bug.

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

Changeset description:

The server crashes on the explain of bug #6791 :(

Comment 27431

Date: 2019-11-29 10:18:59 +0100
From: MonetDB Mercurial Repository <>

Changeset b7a6fa14bb1e made by Pedro Ferreira pedro.ferreira@monetdbsolutions.com in the MonetDB repo, refers to this bug.

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

Changeset description:

Fix for bug #6791, ie make sure struct tm is initialized before using it
@monetdb-team monetdb-team added bug Something isn't working normal 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 normal SQL
Projects
None yet
Development

No branches or pull requests

2 participants