summaryrefslogtreecommitdiff
path: root/src/backend/access/gin/gindatapage.c
diff options
context:
space:
mode:
authorAlexander Korotkov2019-11-19 20:08:14 +0000
committerAlexander Korotkov2019-11-19 21:04:22 +0000
commitd5ad7a09afd066dce423f282bb2b338f48614d32 (patch)
treeb8268a359957b32e29042e1c09845f4c48255e0d /src/backend/access/gin/gindatapage.c
parente14641197a5690d92cc48446d0d40f1aec07bac7 (diff)
Fix traversing to the deleted GIN page via downlink
Current GIN code appears to don't handle traversing to the deleted page via downlink. This commit fixes that by stepping right from the delete page like we do in nbtree. This commit also fixes setting 'deleted' flag to the GIN pages. Now other page flags are not erased once page is deleted. That helps to keep our assertions true if we arrive deleted page via downlink. Discussion: https://postgr.es/m/CAPpHfdvMvsw-NcE5bRS7R1BbvA4BxoDnVVjkXC5W0Czvy9LVrg%40mail.gmail.com Author: Alexander Korotkov Reviewed-by: Peter Geoghegan Backpatch-through: 9.4
Diffstat (limited to 'src/backend/access/gin/gindatapage.c')
-rw-r--r--src/backend/access/gin/gindatapage.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/access/gin/gindatapage.c b/src/backend/access/gin/gindatapage.c
index e8c34d6b1f6..e497210b4c0 100644
--- a/src/backend/access/gin/gindatapage.c
+++ b/src/backend/access/gin/gindatapage.c
@@ -238,6 +238,9 @@ dataIsMoveRight(GinBtree btree, Page page)
if (GinPageRightMost(page))
return false;
+ if (GinPageIsDeleted(page))
+ return true;
+
return (ginCompareItemPointers(&btree->itemptr, iptr) > 0) ? true : false;
}