Skip to content

contains in query derivation of an ElementCollection creates a proper isMember clause but encloses the argument in % leading to the wrong result. #2607

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
schauder opened this issue Jul 29, 2022 · 2 comments
Assignees
Labels
in: repository Repositories abstraction type: bug A general bug

Comments

@schauder
Copy link
Contributor

When looking at the code CONTAINING is obviously intended to work with Strings (and be translated to x like %?%) and for collections where it gets translated to an isMemberOf. But in the later case the argument is still wrapped with % resulting in the condition yielding the wrong results. In most cases non at all.

Interesting using a simple property does work.

@schauder
Copy link
Contributor Author

schauder added a commit that referenced this issue Aug 1, 2022
Part of the logic considered `contains` on an ElementCollection of type String a like query, wrapping the parameter in wildcards.
This is now fixed.

Closes #2607
schauder added a commit that referenced this issue Aug 1, 2022
gregturn pushed a commit that referenced this issue Aug 25, 2022
@gregturn gregturn added this to the 3.0 M6 (2022.0.0) milestone Aug 25, 2022
@gregturn gregturn changed the title contains in query derivation of an ElementCollection creates a proper isMember clause but encloses the argument in % leading to the wrong result. contains in query derivation of an ElementCollection creates a proper isMember clause but encloses the argument in % leading to the wrong result. Aug 25, 2022
@gregturn gregturn added type: bug A general bug in: repository Repositories abstraction labels Aug 25, 2022
gregturn pushed a commit that referenced this issue Dec 21, 2022
Properly handle `contains` for an ElementCollection of type String in a LIKE query, wrapping the the parameter in wildcards only when needed.

Closes: #2607.
@gregturn
Copy link
Contributor

Backported to 2.7.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: repository Repositories abstraction type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants