Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitabc1026

Browse files
committed
Fix erroneous parsing of tsquery input "... & !(subexpression) | ..."
After parsing a parenthesized subexpression, we must pop all pendingANDs 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.
1 parentdcb09b5 commitabc1026

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

‎contrib/intarray/_int_bool.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ makepol(WORKSTATE *state)
196196
caseOPEN:
197197
if (makepol(state)==ERR)
198198
returnERR;
199-
if (lenstack&& (stack[lenstack-1]== (int4)'&'||
200-
stack[lenstack-1]== (int4)'!'))
199+
while (lenstack&& (stack[lenstack-1]== (int4)'&'||
200+
stack[lenstack-1]== (int4)'!'))
201201
{
202202
lenstack--;
203203
pushquery(state,OPR,stack[lenstack]);

‎contrib/ltree/ltxtquery_io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ makepol(QPRS_STATE *state)
241241
caseOPEN:
242242
if (makepol(state)==ERR)
243243
returnERR;
244-
if (lenstack&& (stack[lenstack-1]== (int4)'&'||
245-
stack[lenstack-1]== (int4)'!'))
244+
while (lenstack&& (stack[lenstack-1]== (int4)'&'||
245+
stack[lenstack-1]== (int4)'!'))
246246
{
247247
lenstack--;
248248
pushquery(state,OPR,stack[lenstack],0,0,0);

‎src/backend/utils/adt/tsquery.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,8 @@ makepol(TSQueryParserState state,
371371
casePT_OPEN:
372372
makepol(state,pushval,opaque);
373373

374-
if (lenstack&& (opstack[lenstack-1]==OP_AND||
375-
opstack[lenstack-1]==OP_NOT))
374+
while (lenstack&& (opstack[lenstack-1]==OP_AND||
375+
opstack[lenstack-1]==OP_NOT))
376376
{
377377
lenstack--;
378378
pushOperator(state,opstack[lenstack]);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp