pgsql: Fix bugs in GIN "fast scan" with partial match. - Mailing list pgsql-committers

From Heikki Linnakangas
Subject pgsql: Fix bugs in GIN "fast scan" with partial match.
Date
Msg-id E1WYLnZ-0005KA-2M@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix bugs in GIN "fast scan" with partial match.

There were a couple of bugs here. First, if the fuzzy limit was exceeded,
the loop in entryGetItem might drop out too soon if a whole block needs to
be skipped because it's < advancePast ("continue" in a while-loop checks the
loop condition too). Secondly, the loop checked when stepping to a new page
that there is at least one offset on the page < advancePast, but we cannot
rely on that on subsequent calls of entryGetItem, because advancePast might
change in between. That caused the skipping loop to read bogus items in the
TbmIterateResult's offset array.

First item and fix by Alexander Korotkov, second bug pointed out by Fabrízio
de Royes Mello, by a small variation of Alexander's test query.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/614167c6d7e98d4538c4546754b3c2dba480f71c

Modified Files
--------------
src/backend/access/gin/ginget.c |   55 +++++++++++++++++++++++----------------
1 file changed, 32 insertions(+), 23 deletions(-)


pgsql-committers by date:

Previous
From: Michael Meskes
Date:
Subject: Re: pgsql: Several fixes to array handling in ecpg.
Next
From: Bruce Momjian
Date:
Subject: pgsql: docs: psql '--' comments are not passed to the server