I have a simple table with datetime field for seconds since 1/1/1970
as the primary key.
When I do a SELECT of rows between two datetime periods it works fine
but when I do a SELECT between two datetime periods with the upper
datetime period being aLong.MAX_VALUE in java, I get no rows:
SELECT * FROM timedata WHERE dtkey>1273940000 AND
dtkey<9223372036854775807;
I tracked down the error to my table creation where I had defined the
datetime field as an INT value field and not
a LONG value field.
CREATE timedata (
dtkey INT not null,
dtblob BLOB(500k),
PRIMARY KEY(dtkey)
);
My question though is:
Why the SELECT didn't throw a SQL error when the LONG.MAX_VALUE was
used in the query for the dtkey compare?
Instead it appears that the Long.MAX_VALUE was treated as a negative
number.
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en.