mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Fix btmarkpos/btrestrpos to handle array keys.
This fixes another error in commit 9e8da0f757
.
I neglected to make the mark/restore functionality save and restore the
current set of array key values, which led to strange behavior if an
IndexScan with ScalarArrayOpExpr quals was used as the inner side of a
mergejoin. Per bug #7570 from Melese Tesfaye.
This commit is contained in:
@ -584,6 +584,10 @@ btmarkpos(PG_FUNCTION_ARGS)
|
||||
else
|
||||
so->markItemIndex = -1;
|
||||
|
||||
/* Also record the current positions of any array keys */
|
||||
if (so->numArrayKeys)
|
||||
_bt_mark_array_keys(scan);
|
||||
|
||||
PG_RETURN_VOID();
|
||||
}
|
||||
|
||||
@ -596,6 +600,10 @@ btrestrpos(PG_FUNCTION_ARGS)
|
||||
IndexScanDesc scan = (IndexScanDesc) PG_GETARG_POINTER(0);
|
||||
BTScanOpaque so = (BTScanOpaque) scan->opaque;
|
||||
|
||||
/* Restore the marked positions of any array keys */
|
||||
if (so->numArrayKeys)
|
||||
_bt_restore_array_keys(scan);
|
||||
|
||||
if (so->markItemIndex >= 0)
|
||||
{
|
||||
/*
|
||||
|
Reference in New Issue
Block a user