diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-12-19 12:48:53 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-12-19 12:48:53 -0500 |
commit | d9b99b4b60fd0925b9e223ec9f5ea275a8c2dde5 (patch) | |
tree | 85b8613a3d09bdf87a84928e8c45a425eedab840 /contrib/intarray/_int_bool.c | |
parent | b16a18491f44c259774d92a144f8ba63bce8a886 (diff) |
Fix erroneous parsing of tsquery input "... & !(subexpression) | ..."
After parsing a parenthesized subexpression, we must pop all pending
ANDs and NOTs off the stack, just like the case for a simple operand.
Per bug #5793.
Also fix clones of this routine in contrib/intarray and contrib/ltree,
where input of types query_int and ltxtquery had the same problem.
Back-patch to all supported versions.
Diffstat (limited to 'contrib/intarray/_int_bool.c')
-rw-r--r-- | contrib/intarray/_int_bool.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/intarray/_int_bool.c b/contrib/intarray/_int_bool.c index 2344d0b50be..8af6100214f 100644 --- a/contrib/intarray/_int_bool.c +++ b/contrib/intarray/_int_bool.c @@ -189,8 +189,8 @@ makepol(WORKSTATE * state) case OPEN: if (makepol(state) == ERR) return ERR; - if (lenstack && (stack[lenstack - 1] == (int4) '&' || - stack[lenstack - 1] == (int4) '!')) + while (lenstack && (stack[lenstack - 1] == (int4) '&' || + stack[lenstack - 1] == (int4) '!')) { lenstack--; pushquery(state, OPR, stack[lenstack]); |