Skip to content

Commit

Permalink
test: Fix failing datetime comparison tests in Oracle
Browse files Browse the repository at this point in the history
Rename database list that requires casting.
  • Loading branch information
bog-walk committed Aug 1, 2023
1 parent 984c521 commit 834d762
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ open class JavaTimeBaseTest : DatabaseTestsBase() {
}

// these DB take the nanosecond value 871_130_789 and round up to default precision (e.g. in Oracle: 871_131)
val requiresExplicitCast = listOf(TestDB.ORACLE, TestDB.H2_ORACLE, TestDB.H2_PSQL, TestDB.H2_SQLSERVER)
val requiresExplicitDTCast = listOf(TestDB.ORACLE, TestDB.H2_ORACLE, TestDB.H2_PSQL, TestDB.H2_SQLSERVER)
val dateTime = when (testDb) {
in requiresExplicitCast -> Cast(dateTimeParam(mayTheFourthDT), JavaLocalDateTimeColumnType())
in requiresExplicitDTCast -> Cast(dateTimeParam(mayTheFourthDT), JavaLocalDateTimeColumnType())
else -> dateTimeParam(mayTheFourthDT)
}
val createdMayFourth = testTableDT.select { testTableDT.created eq dateTime }.count()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,9 @@ open class KotlinTimeBaseTest : DatabaseTestsBase() {
}

// these DB take the nanosecond value 871_130_789 and round up to default precision (e.g. in Oracle: 871_131)
val requiresExplicitCast = listOf(TestDB.ORACLE, TestDB.H2_ORACLE, TestDB.H2_PSQL, TestDB.H2_SQLSERVER)
val requiresExplicitDTCast = listOf(TestDB.ORACLE, TestDB.H2_ORACLE, TestDB.H2_PSQL, TestDB.H2_SQLSERVER)
val dateTime = when (testDb) {
in requiresExplicitCast -> Cast(dateTimeParam(mayTheFourthDT), KotlinLocalDateTimeColumnType())
in requiresExplicitDTCast -> Cast(dateTimeParam(mayTheFourthDT), KotlinLocalDateTimeColumnType())
else -> dateTimeParam(mayTheFourthDT)
}
val createdMayFourth = testTableDT.select { testTableDT.created eq dateTime }.count()
Expand Down

0 comments on commit 834d762

Please sign in to comment.