draft-bug18479-fix.patch

text/x-diff

Filename: draft-bug18479-fix.patch
Type: text/x-diff
Part: 0
Message: Re: BUG #18479: websearch_to_tsquery inconsistent behavior for german when using parentheses

Patch

Format: unified
File+
src/backend/utils/adt/tsquery.c 6 0
diff --git a/src/backend/utils/adt/tsquery.c b/src/backend/utils/adt/tsquery.c
index 690a80d774..eb08e912ea 100644
--- a/src/backend/utils/adt/tsquery.c
+++ b/src/backend/utils/adt/tsquery.c
@@ -492,6 +492,12 @@ gettoken_query_websearch(TSQueryParserState state, int8 *operator,
 					*operator = OP_OR;
 					return PT_OPR;
 				}
+				else if (ISOPERATOR(state->buf))
+				{
+					/* ignore other operators here too */
+					state->buf++;
+					continue;
+				}
 				else if (*state->buf == '\0')
 				{
 					return PT_END;