Skip to content

Commit

Permalink
Fix #10697 parsing of CQL ILIKE filter (#10698)
Browse files Browse the repository at this point in the history
  • Loading branch information
offtherailz authored Dec 3, 2024
1 parent e0fbce0 commit 831eab5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions web/client/utils/ogc/Filter/CQL/__tests__/parser-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ const COMPARISON_TESTS = [
args: [{type: "property", name: "PROP"}, {type: "literal", value: 'a'}],
type: "like"
}
}, {
cql: "PROP ilike 'a'",
expected: {
args: [{type: "property", name: "PROP"}, {type: "literal", value: 'a'}],
type: "ilike"
}
},
{
cql: "INCLUDE",
Expand Down
2 changes: 1 addition & 1 deletion web/client/utils/ogc/Filter/CQL/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const functionOperator = "func";
export const patterns = {
INCLUDE: /^INCLUDE$/,
PROPERTY: /^"?[_a-zA-Z"]\w*"?/,
COMPARISON: /^(=|<>|<=|<|>=|>|LIKE)/i,
COMPARISON: /^(=|<>|<=|<|>=|>|LIKE|ILIKE)/i,
IS_NULL: /^IS NULL/i,
COMMA: /^,/,
AND: /^(AND)/i,
Expand Down
4 changes: 4 additions & 0 deletions web/client/utils/ogc/Filter/__tests__/fromObject-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ const COMPARISON_TESTS = [
cql: "PROP like 'a'",
expected: '<ogc:PropertyIsLike matchCase="true" wildCard="*" singleChar="." escapeChar="!"><ogc:PropertyName>PROP</ogc:PropertyName><ogc:Literal>a</ogc:Literal></ogc:PropertyIsLike>'
},
{
cql: "PROP ilike 'a'",
expected: '<ogc:PropertyIsLike matchCase="false" wildCard="*" singleChar="." escapeChar="!"><ogc:PropertyName>PROP</ogc:PropertyName><ogc:Literal>a</ogc:Literal></ogc:PropertyIsLike>'
},
{
cql: "PROP between 1 and 3",
expected: '<ogc:PropertyIsBetween><ogc:PropertyName>PROP</ogc:PropertyName><ogc:LowerBoundary><ogc:Literal>1</ogc:Literal></ogc:LowerBoundary><ogc:UpperBoundary><ogc:Literal>3</ogc:Literal></ogc:UpperBoundary></ogc:PropertyIsBetween>'
Expand Down

0 comments on commit 831eab5

Please sign in to comment.