test: Fix failing datetime comparison tests in Oracle #1813
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The following tests in
exposed-java-time
andexposed-kotlin-datetime
fail when run using Oracle:MiscTableTest/testSelect01()
MiscTableTest/testSelect02()
Fails with an internal equality comparison issue due to precision, which returns an empty collection when
single()
is called.The
datetime()
column maps toTIMESTAMP
without specifying a precision, so the DB defaults to a length of 6 digits, and the value is round up internally instead of being truncated.For example, if the value "2023-07-31 13:00:21.871130789" is inserted, the value stored is
2023-07-31T13:00:21.871131
. This causes an issue in the WHERE clause when the literal comparison value'2023-07-31 13:00:21.871'
is used.Explicitly casting the datetime literal in the WHERE clause causes the appropriate comparison to occur.
A new unit test specifically for this comparison issue showed that the same issue was also occurring in certain H2 modes, causing flaky local tests.