• Heikki Linnakangas's avatar
    Fix bugs in GIN "fast scan" with partial match. · 614167c6
    Heikki Linnakangas authored
    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.
    614167c6
ginget.c 49.2 KB