|
19 | 19 | #include "miscadmin.h"
|
20 | 20 | #include "utils/datum.h"
|
21 | 21 | #include "utils/memutils.h"
|
| 22 | +#include "utils/rel.h" |
22 | 23 |
|
23 | 24 | /* GUC parameter */
|
24 | 25 | int GinFuzzySearchLimit = 0;
|
@@ -247,24 +248,28 @@ collectMatchBitmap(GinBtreeData *btree, GinBtreeStack *stack,
|
247 | 248 | /* Search forward to re-find idatum */
|
248 | 249 | for (;;)
|
249 | 250 | {
|
250 |
| - Datum newDatum; |
251 |
| - GinNullCategory newCategory; |
252 |
| - |
253 | 251 | if (moveRightIfItNeeded(btree, stack) == false)
|
254 |
| - elog(ERROR, "lost saved point in index"); /* must not happen !!! */ |
| 252 | + ereport(ERROR, |
| 253 | + (errcode(ERRCODE_INTERNAL_ERROR), |
| 254 | + errmsg("failed to re-find tuple within index \"%s\"", |
| 255 | + RelationGetRelationName(btree->index)))); |
255 | 256 |
|
256 | 257 | page = BufferGetPage(stack->buffer);
|
257 | 258 | itup = (IndexTuple) PageGetItem(page, PageGetItemId(page, stack->off));
|
258 | 259 |
|
259 |
| - if (gintuple_get_attrnum(btree->ginstate, itup) != attnum) |
260 |
| - elog(ERROR, "lost saved point in index"); /* must not happen !!! */ |
261 |
| - newDatum = gintuple_get_key(btree->ginstate, itup, |
262 |
| - &newCategory); |
| 260 | + if (gintuple_get_attrnum(btree->ginstate, itup) == attnum) |
| 261 | + { |
| 262 | + Datum newDatum; |
| 263 | + GinNullCategory newCategory; |
| 264 | + |
| 265 | + newDatum = gintuple_get_key(btree->ginstate, itup, |
| 266 | + &newCategory); |
263 | 267 |
|
264 |
| - if (ginCompareEntries(btree->ginstate, attnum, |
265 |
| - newDatum, newCategory, |
266 |
| - idatum, icategory) == 0) |
267 |
| - break; /* Found! */ |
| 268 | + if (ginCompareEntries(btree->ginstate, attnum, |
| 269 | + newDatum, newCategory, |
| 270 | + idatum, icategory) == 0) |
| 271 | + break; /* Found! */ |
| 272 | + } |
268 | 273 |
|
269 | 274 | stack->off++;
|
270 | 275 | }
|
|
0 commit comments