Hi,

I'm trying to execute a Geode query with wildcards (so with "like" and special 
character % working as wildcard) some strange behaviour has been found when 
trying to match the "$" character inside the expression matched by the "like".


If one query tries to match a string containg "$" character by a "=" or a 
"contains" operation, it works, and if data contains a "$" character and 
expression of query looks for it, works as expected.


gfsh>query --query="select e.key from /example-region.entrySet e where 
e.key='aa$b'"

Result : true
Limit  : 100
Rows   : 1

Result
------
aa$b



But if I replace the "=" operator in the Geode query by a "LIKE" operator, and 
a wildcard is added, then it seems the regular expression mode is somehow 
triggered and the "$" character starts behaving like endline character. That is 
expected.


gfsh>query --query="select e.key from /example-region.entrySet e where e.key 
like 'aa$b'"

Result : true
Limit  : 100
Rows   : 0



The problem is how to escape this character in query?

I tried on different ways but without success.


gfsh>query --query="select e.key from /example-region.entrySet e where e.key 
like 'aa$%'"
Result : true
Limit  : 100
Rows   : 0


gfsh>query --query="select e.key from /example-region.entrySet e where e.key 
like 'aa\$b'"
Result : true
Limit  : 100
Rows   : 0


gfsh>query --query="select e.key from /example-region.entrySet e where e.key 
like 'aa\\\$b'"
Result : true
Limit  : 100
Rows   : 0

Does anyone have an idea how to escape "$" character in queries?


Thanks and BR,

Mario


Reply via email to