summaryrefslogtreecommitdiff
path: root/src/backend/access/nbtree/nbtree.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-09-27 17:00:05 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2012-09-27 17:01:15 -0400
commitf2366e584aea41b980f23fcf0a2e118efd7fb09b (patch)
tree5a62046871cdad32f81dc23c40ab53add47abbb5 /src/backend/access/nbtree/nbtree.c
parent01546402d4cbf88a66e680be5a9c6f018518050a (diff)
Fix btmarkpos/btrestrpos to handle array keys.
This fixes another error in commit 9e8da0f75731aaa7605cf4656c21ea09e84d2eb1. 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.
Diffstat (limited to 'src/backend/access/nbtree/nbtree.c')
-rw-r--r--src/backend/access/nbtree/nbtree.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c
index 41d06edb154..02f12c618a5 100644
--- a/src/backend/access/nbtree/nbtree.c
+++ b/src/backend/access/nbtree/nbtree.c
@@ -583,6 +583,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();
}
@@ -595,6 +599,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)
{
/*