Christian Beikov (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZTcyOTE3Mjlh...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16432?atlOrigin=eyJpIjoiZTcyOT...
) HHH-16432 (
https://hibernate.atlassian.net/browse/HHH-16432?atlOrigin=eyJpIjoiZTcyOT...
) QueryKey.ParameterBindingsMemento collision issue due to multi-value encoding (
https://hibernate.atlassian.net/browse/HHH-16432?atlOrigin=eyJpIjoiZTcyOT...
)
Issue Type: Bug Affects Versions: 6.2.0 Assignee: Unassigned Components: hibernate-core
Created: 04/Apr/2023 01:32 AM Priority: Major Reporter: Christian Beikov (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
The encoding in
org.hibernate.query.internal.QueryParameterBindingsImpl#generateQueryKeyMemento has a flaw
in the encoding of the parameter values.
A query like e.g. from Entity e where e.id in :p1 and e.id = :p2 and e.id in :p3 will show
the problem. The parameters [ [1] ,1, [1] ] and [[],1, [1,1] will produce the same
QueryKey.ParameterBindingsMemento even though the parameter binding is clearly different.
To solve this, we must always add the count of values for multi-valued parameters into the
QueryKey.ParameterBindingsMemento with e.g.
mutableCacheKey.addValue(binding.getBindValues().size()).
(
https://hibernate.atlassian.net/browse/HHH-16432#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16432#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#100221- sha1:89dc9bf )