From 1827f957718dcc4b381a8ae8419bf6a8c552d2d4 Mon Sep 17 00:00:00 2001 From: chenxiaobin Date: Thu, 27 Aug 2020 15:30:14 +0800 Subject: [PATCH] fixbug gin_fuzzy_search_limit parameter invalid --- src/gausskernel/storage/access/gin/ginget.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gausskernel/storage/access/gin/ginget.cpp b/src/gausskernel/storage/access/gin/ginget.cpp index 35bac6191..50fba3a9c 100755 --- a/src/gausskernel/storage/access/gin/ginget.cpp +++ b/src/gausskernel/storage/access/gin/ginget.cpp @@ -823,8 +823,8 @@ static void entryGetItem(GinState* ginstate, GinScanEntry entry, ItemPointerData } entry->curItem = entry->list[entry->offset++]; - } while (ginCompareItemPointers(&entry->curItem, &advancePast) <= 0); - /* XXX: shouldn't we apply the fuzzy search limit here? */ + } while + (ginCompareItemPointers(&entry->curItem, &advancePast) <= 0 || (entry->reduceResult && dropItem(entry))); } else { /* A posting tree */ do { @@ -839,8 +839,12 @@ static void entryGetItem(GinState* ginstate, GinScanEntry entry, ItemPointerData } entry->curItem = entry->list[entry->offset++]; - } while ( - ginCompareItemPointers(&entry->curItem, &advancePast) <= 0 || (entry->reduceResult && dropItem(entry))); + + if (ginCompareItemPointers(&entry->curItem, &advancePast) <= 0) + continue; + + advancePast = entry->curItem; + } while (entry->reduceResult && dropItem(entry)); } }