RE: Possible Feb 29, 2000 Bug?
Posted in 1998
Larry,
You get this type of problem all of the time. Try subtracting 1 month
from 1998-03-30 and you will get the same error.
Regards,
David Ashby
-----Original Message-----
From: Larry Kemmerling
[mailto:larryk@vigilante.airone.claircom.com]
Sent: Wednesday, 12 August 1998 3:20
To: informix-list@iiug.org
Subject: Possible Feb 29, 2000 Bug?
Informix gurus,
While doing Y2K testing, our organization came across
a problem trying to subtract a 1 year interval from a
datetime column with the value "2000-02-29 00:00:00".
Here's some sample code:
CREATE TEMP TABLE tFoo
( DateVal Datetime year to second
) WITH NO LOG;
INSERT INTO tFoo
( DateVal )
VALUES
( "2000-02-29 00:00:00" );
SELECT ( DateVal - INTERVAL (365) DAY(9) TO DAY )
FROM tFoo;
SELECT ( DateVal - INTERVAL (366) DAY(9) TO DAY )
FROM tFoo;
SELECT ( DateVal - INTERVAL (1) YEAR(9) TO YEAR )
FROM tFoo;
The last select statement causes error -1267. Error
-1267
says:
-1267 The result of a datetime computation is out of
range.
In this statement, a DATETIME computation has produced a
value that
cannot be stored. This situation can occur, for example,
if a very
large interval is added to a DATETIME. Review the
expressions in the
statement, and see if you can change the sequence of
operations to
avoid the overflow.
I might have expected error -1206, but not the 1267
error. Is there
something I'm missing?
The value of DBCENTURY has no effect whatsoever.
I found this problem running against 7.30.UC3 on Solaris
2.6. I've
confirmed the problem exists with 7.14.UD1 on Solaris
2.5 and 5.04.UC1
on SunOs 4.1.4.
I've opened a case with tech support, but I'm wondering
if anyone else
has encountered this problem.
Thanks for your time.
Larry Kemmerling
Product Systems Engineer
AT&T Wireless Services
Aviation Communications Division