Re: Possible Feb 29, 2000 Bug?
Posted in 1998
Larry
Sorry about the previous post. I was thinking you were referring to
the famous Fen 29, 2000 bug, but from your mail I now see (after
reading the solution from Jonathan Leffler and referring back to the
problem) that this is to do with date arithmetic. I promise to be less
hasty in supplying solutions in future :-).
Sorry
Sujit
______________________________ Reply Separator _________________________________
Subject: Possible Feb 29, 2000 Bug?
Author: Larry Kemmerling <larryk@vigilante.airone.claircom.com> at internet
Date: 8/11/98 10:19 AM
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