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 coercion functionality tests #2973

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

Date coercion functionality tests #2973

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

Comments

@monetdb-team
Copy link

Date: 2012-01-14 13:39:42 +0100
From: @mlkersten
To: SQL devs <>
Version: 11.7.5 (Dec2011) [obsolete]
CC: @drstmane

Last updated: 2012-02-29 10:34:27 +0100

Comment 16772

Date: 2012-01-14 13:39:42 +0100
From: @mlkersten

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
Build Identifier: Dec2011

The test file date_script_test.sql should be completed and tested.

Reproducible: Always

Comment 16775

Date: 2012-01-14 14:12:15 +0100
From: @drstmane

Changeset fdc3b8b379f8 made by Stefan Manegold Stefan.Manegold@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=fdc3b8b379f8

Changeset description:

renamed new tests to include bug report id in test name:
url_script_test.sql -> url_script_test.Bug-2972.sql
date_script_test.sql -> date_script_test.Bug-2973.sql

this simplies linking tests to bug reports and vice versa

Comment 16777

Date: 2012-01-14 14:16:14 +0100
From: @drstmane

Changeset 49f931f6754f made by Stefan Manegold Stefan.Manegold@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=49f931f6754f

Changeset description:

added skeleton stable output for tests url_script_test.Bug-2972 & date_script_test.Bug-2973

correct / expected output still needs to be verified and approved

Comment 16804

Date: 2012-01-20 14:59:38 +0100
From: @sjoerdmullender

Looking at the test and the code, I wonder what we think should happen.

The first test is

select str_to_date('2012','%y');

When given a format %y, the conversion function (strptime) expects a 2 digit year and returns a value for a year in the range 1969..2068. This means that in this case, the year returned is 2020 and the input string is not fully consumed.
This raises the question:
-> Should an error be returned if the input is not fully consumed? (My answer: yes.)

Furthermore, the conversion function will set the day-of-month and month both to 0. Further processing in mtime will then refuse this date as invalid (month has to be in range 1..12, day-of-month in the appropriate range for the month), and will return a date_nil value.
This raises another couple of question:
-> When given an invalid date, should the mtime module raise an error or just return nil? (My answer: it should raise an error.)
-> When the parser returns 0 for day-of-month and/or month, should we set the value to 1? (My answer: yes.)

Any opnions?

Comment 16942

Date: 2012-02-19 18:20:56 +0100
From: @drstmane

date_script_test.Bug-2973.sql:

Appears to be fixed in the default branch (only) after changesets
http://dev.monetdb.org/hg/MonetDB/rev/8ee024048e42
http://dev.monetdb.org/hg/MonetDB/rev/e2d3ecc7237c
http://dev.monetdb.org/hg/MonetDB/rev/03df27701cf7
http://dev.monetdb.org/hg/MonetDB/rev/70dc90e1de2f

Remains open/failing in the Dec2011 branch.

Comment 16947

Date: 2012-02-19 18:47:07 +0100
From: @drstmane

Fixed (also) in Dec2011 by transplanting changeset 70dc90e1de2f from default to Dec2011:
http://dev.monetdb.org/hg/MonetDB/rev/ec5692ecaf8c

@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 Nov 9, 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