Skip to content

Ambiguous query generation with null-valued parameters in like-queries #2653

@yura2201

Description

@yura2201

Problem


Actually the issue 2548 has not been completely resolved!
PersistenceProvider#condense(Object) returns an empty string, so then the query
@Query(SELECT t FROM My_Table t WHERE (:param is NULL or t.attr LIKE %:param%))
will transform into select my_table.id, ..., my_table.attr as attrN from my_table where '%%' is null or my_table.attr like '%%' whereas in spring-data-jpa 2.6.4 or earlier it will transform to select my_table.id, ..., my_table.attr as attrN from my_table where NULL is null or my_table.attr like NULL

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions