postgresql/src/backend/access
Teodor Sigaev 6db4b49986 Fix wrong validation of top-parent pointer during page deletion in Btree.
After introducing usage of t_tid of inner or page high key for storing
number of attributes of tuple, validation of tuple's ItemPointer with
ItemPointerIsValid becomes incorrect, it's need to validate only blocknumber of
ItemPointer. Missing this causes a incorrect page deletion, fix that. Test is
added.

BTW, current contrib/amcheck doesn't fail on index corrupted by this way.

Also introduce BTreeTupleGetTopParent/BTreeTupleSetTopParent macroses to improve
code readability and to avoid possible confusion with page high key: high key
is used to store top-parent link for branch to remove.

Bug found by Michael Paquier, but bug doesn't exist in previous versions because
t_tid was set to P_HIKEY.

Author: Teodor Sigaev
Reviewer: Peter Geoghegan
Discussion: https://www.postgresql.org/message-id/flat/20180419052436.GA16000%40paquier.xyz
2018-04-23 15:55:10 +03:00
..
brin Indexes with INCLUDE columns and their support in B-tree 2018-04-07 23:00:39 +03:00
common Adjust INCLUDE index truncation comments and code. 2018-04-19 08:45:58 +03:00
gin Indexes with INCLUDE columns and their support in B-tree 2018-04-07 23:00:39 +03:00
gist Indexes with INCLUDE columns and their support in B-tree 2018-04-07 23:00:39 +03:00
hash Indexes with INCLUDE columns and their support in B-tree 2018-04-07 23:00:39 +03:00
heap Revert MERGE patch 2018-04-12 11:22:56 +01:00
index Further cleanup of client dependencies on src/include/catalog headers. 2018-04-09 14:39:58 -04:00
nbtree Fix wrong validation of top-parent pointer during page deletion in Btree. 2018-04-23 15:55:10 +03:00
rmgrdesc Handle XLOG_BTREE_META_CLEANUP in btree_desc() and btree_identify() 2018-04-19 09:27:56 +03:00
spgist Fix broken collation-aware searches in SP-GiST text opclass. 2018-04-16 16:06:58 -04:00
tablesample Update copyright for 2018 2018-01-02 23:30:12 -05:00
transam Fix confusion on the padding of GIDs in on commit and abort records. 2018-04-17 16:10:42 -04:00
Makefile TABLESAMPLE, SQL Standard and extensible 2015-05-15 14:37:10 -04:00