Open pedropds opened 2 months ago
/cc @FroMage (panache), @loicmathieu (panache)
This sounds like an ORM change, no @yrodiere ?
This sounds like an ORM change, no @yrodiere ?
Unless Panache is introducing non-printable characters somewhere in lower(name)
, which sounds unlikely, yes this looks like a bug in Hibernate ORM.
This sounds like an ORM change, no @yrodiere ?
Unless Panache is introducing non-printable characters somewhere in
lower(name)
, which sounds unlikely, yes this looks like a bug in Hibernate ORM.
Ah, that was wrong @FroMage -- the problem is in Panache.
I debugged it locally and this is what gets passed to Hibernate ORM:
FROM `org.acme.hibernate.orm.panache.entity.FruitEntity` ORDER BY `lower(name)`
So essentially I think it's a result from that patch that added escapes everywhere to avoid HQL injection.
@pedropds you need to use Sort.by("lower(name)").disableEscaping()
@FroMage you need to make sure migration guides (and the Panache documentation) mention all this :)
Was about to send ORDER BY 'lower(name)'
as well as I was debugging to see if i could provide more info.
Thank you both for the help!
OH, that makes sense, thanks @yrodiere :)
I'll rewrite this issue's topic.
Describe the bug
I'm updating Quarkus from 3.8.4 to the latest version, 3.14.1. (using gradle, btw) When doing this upgrade, some of our integration tests started failing, specifically some of the ones using Panache queries, with Sort options, when trying to sort with case insensitive, by using the lower() or upper() functions.
Let's take a simple example, from my codebase:
Expected behavior
In Quarkus 3.8.4, this should allow the query to execute correctly without throwing any exceptions, enabling a case-insensitive sort.
Actual behavior
The following exception is now thrown:
How to Reproduce?
Just reproduce this with the simple scenario I provided above, or any other by your choice, and change your
gradle.properties
file (not sure the process for maven):to
Quarkus version or git rev
3.14.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 8.5
Additional information
Im using Postgres for the database, and then just using the default libraries from Quarkus, the main one for this case being the Hibernate:
implementation 'io.quarkus:quarkus-hibernate-orm-panache'