Fix bugs in GIN "fast scan" with partial match.
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.

techdragon/Postgres-XL,greenplum-db/gpdb,yazun/postgres-xl,Postgres-XL/Postgres-XL,greenplum-db/gpdb,lisakowen/gpdb,adam8157/gpdb,lisakowen/gpdb,jmcatamney/gpdb,zeroae/postgres-xl,greenplum-db/gpdb,ovr/postgres-xl,xinzweb/gpdb,zeroae/postgres-xl,ashwinstar/gpdb,ashwinstar/gpdb,adam8157/gpdb,adam8157/gpdb,adam8157/gpdb,techdragon/Postgres-XL,lisakowen/gpdb,greenplum-db/gpdb,yazun/postgres-xl,50wu/gpdb,oberstet/postgres-xl,Postgres-XL/Postgres-XL,xinzweb/gpdb,zeroae/postgres-xl,ashwinstar/gpdb,xinzweb/gpdb,techdragon/Postgres-XL,lisakowen/gpdb,Postgres-XL/Postgres-XL,lisakowen/gpdb,lisakowen/gpdb,50wu/gpdb,50wu/gpdb,greenplum-db/gpdb,Postgres-XL/Postgres-XL,adam8157/gpdb,xinzweb/gpdb,lisakowen/gpdb,50wu/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,pavanvd/postgres-xl,greenplum-db/gpdb,ovr/postgres-xl,pavanvd/postgres-xl,yazun/postgres-xl,oberstet/postgres-xl,techdragon/Postgres-XL,xinzweb/gpdb,50wu/gpdb,pavanvd/postgres-xl,ovr/postgres-xl,zeroae/postgres-xl,jmcatamney/gpdb,zeroae/postgres-xl,jmcatamney/gpdb,yazun/postgres-xl,jmcatamney/gpdb,50wu/gpdb,ashwinstar/gpdb,xinzweb/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,50wu/gpdb,Postgres-XL/Postgres-XL,50wu/gpdb,ovr/postgres-xl,techdragon/Postgres-XL,ovr/postgres-xl,yazun/postgres-xl,jmcatamney/gpdb,adam8157/gpdb,jmcatamney/gpdb,adam8157/gpdb,adam8157/gpdb,pavanvd/postgres-xl,oberstet/postgres-xl,oberstet/postgres-xl,xinzweb/gpdb,lisakowen/gpdb,greenplum-db/gpdb,pavanvd/postgres-xl,oberstet/postgres-xl,xinzweb/gpdb,jmcatamney/gpdb