Date calculation and comparison produce wrong result #3940
Last updated: 2016-03-25 09:59:15 +0100
Date: 2016-03-02 23:37:51 +0100
Try the following query set:
CREATE TABLE foo (dat1 DATE, dat2 DATE);
The final SELECT query produces this result:
sql>SELECT (dat2-dat1), (dat2-dat1) < 10 FROM foo;
The comparison result of the last tuple should be false.
Date: 2016-03-02 23:42:14 +0100
For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=c6ea0ebc35d0
Date: 2016-03-03 11:36:06 +0100
For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=2737878355ca
Date: 2016-03-03 11:51:55 +0100
Is this the same as https://www.monetdb.org/bugzilla/show_bug.cgi?id=3917 ?
Date: 2016-03-03 18:05:18 +0100
You are right, this is caused by the same problem as Bug #3917.
I don't completely understand why things have been implemented that way, but I got the following from Niels explanation earlier today:
With this change, both queries in Bug #3917 now return 365. So probably, that one can be also marked as RESOLVED.
Date: 2016-03-03 18:10:16 +0100
By the way, as expected, before Niels' fix (Changeset 2737878355ca), the query returns expected results, if one explicitly defines the number 10 as a month interval:
sql>SELECT (dat2-dat1), (dat2-dat1) < interval '10' month FROM foo;
Date: 2016-03-25 09:59:15 +0100
Jul2015-SP3 has been released.
The text was updated successfully, but these errors were encountered: