Skip "case when" tests requiring casts for DB2

Description

Following tests fails with DB2 because hibernate generates wrong query. It's missing casting of parameters in case expression part of query

org.hibernate.jpa.test.criteria.selectcase.SelectCaseTest.selectCaseWithCastedTypeValuesShouldWork
org.hibernate.jpa.test.criteria.selectcase.SelectCaseTest.selectCaseWithValuesShouldWork
org.hibernate.jpa.test.criteria.selectcase.SelectCaseTest.simpleSelectCaseWithCastedTypeValuesShouldWork
org.hibernate.jpa.test.criteria.selectcase.SelectCaseTest.simpleSelectCaseWithValuesShouldWork
org.hibernate.jpa.test.criteria.selectcase.GroupBySelectCaseTest.selectCaseInOrderByAndSelectExpression
org.hibernate.query.criteria.internal.expression.SearchedCaseExpressionTest.testEqualClause

Example from: SelectCaseTest.selectCaseWithValuesShouldWork
generated query is:

15:14:28,210 DEBUG SQL:94 - select selectcase0_.id as id1_0_, selectcase0_.value as value2_0_ from entity selectcase0_ where cast(selectcase0_.value as varchar(255))=case when 1=1 then ? else ? end

but it probably should be

15:14:28,210 DEBUG SQL:94 - select selectcase0_.id as id1_0_, selectcase0_.value as value2_0_ from entity selectcase0_ where cast(selectcase0_.value as varchar(255))=case when 1=1 then cast(? as varchar(255)) else cast(? as varchar(255)) end

Attached full output from SelectCaseTest.selectCaseWithValuesShouldWork

Attachments

1
  • 18 Jul 2018, 10:35 AM

Activity

Show:

Guillaume SmetJuly 19, 2018 at 11:42 AM

I skipped the tests for now with DB2 and created https://hibernate.atlassian.net/browse/HHH-12831 .

Fixed

Details

Assignee

Reporter

Labels

Fix versions

Affects versions

Priority

Created July 18, 2018 at 10:37 AM
Updated July 20, 2018 at 1:41 PM
Resolved July 19, 2018 at 1:27 PM

Flag notifications