Error when using parameter as both a select function argument and in where clause

Description

Using a parameter in select inside a function and in where clause results in an exception: JDBC parameter value not bound

A similar issue was already reported and fixed. But it is still happening if the parameter is itself a parameter of a function. Minimal Spring Boot project reproducing the problem: , same example with hibernate 5.6.15 where it was working:

A small example query which causes the exception:

select DATEDIFF(e.date, :date) from SomeEntity e where :date < e.date

Those queries work fine:

select DATEDIFF(e.date, :date) from SomeEntity e

select :date from SomeEntity e where :date < e.date

Related issue:

Activity

Show:
Fixed

Details

Assignee

Reporter

Worked in

Components

Fix versions

Affects versions

Priority

Created March 14, 2023 at 3:18 PM
Updated March 31, 2023 at 1:51 AM
Resolved March 30, 2023 at 10:52 AM