Fix parsing of single-character string literals in JPQL and EQL collection member expressions.#4282
Conversation
…ction member expressions. Signed-off-by: jewoodev <jewoos15@naver.com>
|
Thanks a lot. Do you have a few more examples where the single-char case falls short? Also, getting an overview of unintentionally enabling functionality that wasn't previously possible (or breaking existing) would be great. We might want to introduce a bit more test coverage and cross-check whether we have similar issues in the HQL parser. |
Add renderer TCK coverage for additional collection membership predicates using single-character string literals. Cover NOT MEMBER OF and the same MEMBER OF predicate in subquery, update, and delete where clauses. Signed-off-by: jewoodev <jewoos15@naver.com>
|
Thanks for the feedback. I pushed additional TCK coverage for the same root cause in collection-member expressions: I also found I will follow up with the check for unintended enablement or breakage, and with the HQL parser cross-check. |
|
Alright, let me merge this PR. Once there is more, we can commit changes against the original bug report #4278 |
|
Thank you for your contribution. That's merged and backported now. |
JPQL and EQL currently tokenize a single-character quoted string such as
'c'asCHARACTER, while other quoted strings are tokenized asSTRINGLITERAL. Theliteralparser rule acceptedSTRINGLITERALbut notCHARACTER, causing a single-character string literal to fail when used as the left operand ofMEMBER OF.This change adds
CHARACTERto the JPQL and EQLliteralrules and covers the collection-member case with a shared query renderer round-trip test.Jakarta Persistence allows a
literalas the left operand ofMEMBER OF, defines string literals as single-quoted strings without distinguishing single-character strings from longer strings, and itself uses'Joe' MEMBER OF p.nicknamesas an example.See #4278