mirror of
https://github.com/postgres/postgres.git
synced 2025-06-22 02:52:08 +03:00
Fix parsing NOT sequence in tsquery
Digging around bug #14245 I found that commit
6734a1cacd
missed that NOT operation is
right associative in opposite to all other. This miss is resposible for
tsquery parser fail on sequence of NOT operations
This commit is contained in:
@ -455,7 +455,9 @@ cleanOpStack(TSQueryParserState state,
|
||||
|
||||
while(*lenstack)
|
||||
{
|
||||
if (opPriority > OP_PRIORITY(stack[*lenstack - 1].op))
|
||||
/* NOT is right associative unlike to others */
|
||||
if ((op != OP_NOT && opPriority > OP_PRIORITY(stack[*lenstack - 1].op)) ||
|
||||
(op == OP_NOT && opPriority >= OP_PRIORITY(stack[*lenstack - 1].op)))
|
||||
break;
|
||||
|
||||
(*lenstack)--;
|
||||
|
Reference in New Issue
Block a user