Vijayasaradhi Danda (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYmJkMDU2ODIz...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16034?atlOrigin=eyJpIjoiYmJkMD...
) HHH-16034 (
https://hibernate.atlassian.net/browse/HHH-16034?atlOrigin=eyJpIjoiYmJkMD...
) CASE Statement in jpql throws assertion error when running H2 in Oracle mode with
OracleDialect (
https://hibernate.atlassian.net/browse/HHH-16034?atlOrigin=eyJpIjoiYmJkMD...
)
Issue Type: Bug Affects Versions: 6.1.6 Assignee: Unassigned Components: query-hql
Created: 12/Jan/2023 11:41 AM Environment: OpenJDK Runtime Environment (build
17.0.2+8-86), Mac OS Monterey Version 12.6.2, H2 2.1.214 Priority: Blocker Reporter:
Vijayasaradhi Danda (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
We have been using H2 for our db integration tests running it in Oracle mode (MODE=Oracle
since our production database is Oracle. Then we used to use OracleDialect to make sure
genereated sqls would be reasonably Oracle compliant. That way each developer working on
db access code could easily run db integration tests quickly on their workstations.
We upgraded from hibernate version 5.6.8 using org.hibernate.dialect.OracleDialect to
version 6.1.6 again using org.hibernate.dialect.OracleDialect and one of our jpql queries
failed that was using CASE statement for its order by clause with
java.lang.AssertionError
at
org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.getLeftHandExpression(AbstractSqlAstTranslator.java:593)
at
org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitDecodeCaseSearchedExpression(AbstractSqlAstTranslator.java:4888)
Debugging it we found that OracleSqlAstTranslator gets Oracle version through
OracleDialect class which in turn relies on H2 db driver version returning version 1-2
resulting line 420 picking visitDecodeCaseSearchedExpression instead of
super.visitCaseSearchedExpression resulting in the error.
That seems to be a minor error but we would appreciate if you could devise a solution
otherwise we don’t know how to get our unit tests working.
(
https://hibernate.atlassian.net/browse/HHH-16034#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16034#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100214- sha1:b03f6a4 )