[#8401] Add support for parsing REGEXP, RLIKE, and LIKE_REGEX operators
This commit is contained in:
parent
40715b25d8
commit
ebc1dce54c
@ -665,6 +665,7 @@ predicate =
|
||||
(
|
||||
| 'IN' '(' ( select | fields ) ')'
|
||||
| 'BETWEEN' [ 'SYMMETRIC' ] concat 'AND' concat
|
||||
| ( 'REGEXP' | 'RLIKE' | 'LIKE_REGEX' ) concat
|
||||
| 'LIKE' concat [ 'ESCAPE' characterLiteral ]
|
||||
| 'SIMILAR' 'TO' concat [ 'ESCAPE' characterLiteral ]
|
||||
)
|
||||
|
||||
@ -4330,6 +4330,14 @@ final class ParserImpl implements Parser {
|
||||
? ((Field) left).notLike(right)
|
||||
: ((Field) left).like(right);
|
||||
}
|
||||
else if (left instanceof Field && (parseKeywordIf(ctx, "REGEXP")
|
||||
|| parseKeywordIf(ctx, "RLIKE")
|
||||
|| parseKeywordIf(ctx, "LIKE_REGEX"))) {
|
||||
Field right = toField(ctx, parseConcat(ctx, null));
|
||||
return not
|
||||
? ((Field) left).notLikeRegex(right)
|
||||
: ((Field) left).likeRegex(right);
|
||||
}
|
||||
else if (left instanceof Field && parseKeywordIf(ctx, "SIMILAR TO")) {
|
||||
Field right = toField(ctx, parseConcat(ctx, null));
|
||||
boolean escape = parseKeywordIf(ctx, "ESCAPE");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user