Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.1.6
-
Fix Version/s: None
-
Component/s: ORM
-
Security Level: All
-
Labels:None
Description
Example:
SELECT .... WHERE upper(n.title) LIKE upper(:filter)
should be a valid SQL, now is rejected because the walker only accept a variable or an string expression.
I'm adding a patch to address this.
In my case it worked when using "=" instead of "LIKE".
//works:
(CASE WHEN (Book.id = BookFrom.id) THEN BookTo.displayName ELSE BookFrom.displayName END) = :name
//[Syntax Error] line 0, col 1217: Error: Expected =, <, <=, <>, >, >=, !=, got 'LIKE'
(CASE WHEN (Book.id = BookFrom.id) THEN BookTo.displayName ELSE BookFrom.displayName END) LIKE :name
So the LIKE operator only needs to be allowed here.
I'm wondering which vendor should not be able to handle that:
The CASE WHEN ... THEN ... END is documented in DQL, and allowed.
LIKE itself is allowed.
If an RDBMs cannot use CASE WHEN and LIKE in combination, this would be a strange limitation.