pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix misuse of table_index_fetch_tuple_check(). 2+ messages / 1 participants [nested] [flat]
* pgsql: Fix misuse of table_index_fetch_tuple_check(). @ 2020-06-25 17:56 Peter Geoghegan <pg@bowt.ie> 0 siblings, 0 replies; 2+ messages in thread From: Peter Geoghegan @ 2020-06-25 17:56 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix misuse of table_index_fetch_tuple_check(). Commit 0d861bbb, which added deduplication to nbtree, had _bt_check_unique() pass a TID to table_index_fetch_tuple_check() that isn't safe to mutate. table_index_fetch_tuple_check()'s tid argument is modified when the TID in question is not the latest visible tuple in a hot chain, though this wasn't documented. To fix, go back to using a local copy of the TID in _bt_check_unique(), and update comments above table_index_fetch_tuple_check(). Backpatch: 13-, where B-Tree deduplication was introduced. Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/10f1ab2cb8bea3c6741a78f6dc19a5c91c0a34e1 Modified Files -------------- src/backend/access/nbtree/nbtinsert.c | 3 ++- src/backend/access/table/tableam.c | 4 ++++ src/include/access/tableam.h | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Fix misuse of table_index_fetch_tuple_check(). @ 2020-06-25 17:56 Peter Geoghegan <pg@bowt.ie> 0 siblings, 0 replies; 2+ messages in thread From: Peter Geoghegan @ 2020-06-25 17:56 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix misuse of table_index_fetch_tuple_check(). Commit 0d861bbb, which added deduplication to nbtree, had _bt_check_unique() pass a TID to table_index_fetch_tuple_check() that isn't safe to mutate. table_index_fetch_tuple_check()'s tid argument is modified when the TID in question is not the latest visible tuple in a hot chain, though this wasn't documented. To fix, go back to using a local copy of the TID in _bt_check_unique(), and update comments above table_index_fetch_tuple_check(). Backpatch: 13-, where B-Tree deduplication was introduced. Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/8c2010f12344ed8834c6f63406a78e5843ebec69 Modified Files -------------- src/backend/access/nbtree/nbtinsert.c | 3 ++- src/backend/access/table/tableam.c | 4 ++++ src/include/access/tableam.h | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2020-06-25 17:56 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-06-25 17:56 pgsql: Fix misuse of table_index_fetch_tuple_check(). Peter Geoghegan <pg@bowt.ie> 2020-06-25 17:56 pgsql: Fix misuse of table_index_fetch_tuple_check(). Peter Geoghegan <pg@bowt.ie>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox