postgresql/src/test
Heikki Linnakangas fd298cd639 Fix predicate-locking of HOT updated rows.
In serializable mode, heap_hot_search_buffer() incorrectly acquired a
predicate lock on the root tuple, not the returned tuple that satisfied
the visibility checks. As explained in README-SSI, the predicate lock does
not need to be copied or extended to other tuple versions, but for that to
work, the correct, visible, tuple version must be locked in the first
place.

The original SSI commit had this bug in it, but it was fixed back in 2013,
in commit 81fbbfe335. But unfortunately, it was reintroduced a few months
later in commit b89e151054. Wising up from that, add a regression test
to cover this, so that it doesn't get reintroduced again. Also, move the
code that sets 't_self', so that it happens at the same time that the
other HeapTuple fields are set, to make it more clear that all the code in
the loop operate on the "current" tuple in the chain, not the root tuple.

Bug spotted by Andres Freund, analysis and original fix by Thomas Munro,
test case and some additional changes to the fix by Heikki Linnakangas.
Backpatch to all supported versions (9.4).

Discussion: https://www.postgresql.org/message-id/20190731210630.nqhszuktygwftjty%40alap3.anarazel.de
2019-08-07 12:41:31 +03:00
..
examples Client-side fixes for delayed NOTIFY receipt. 2018-10-19 22:22:57 -04:00
isolation Fix predicate-locking of HOT updated rows. 2019-08-07 12:41:31 +03:00
locale Add a temp-install prerequisite to "check"-like targets not having one. 2017-11-05 18:54:52 -08:00
mb Revert "Fix broken multibyte regression tests." 2016-01-26 09:00:33 +09:00
modules Solve cross-version-upgrade testing problem induced by 1fb57af92. 2019-02-09 21:02:06 -05:00
perl Fix old TAP tests' method for selecting a valid PGPORT value. 2018-11-19 20:01:35 -05:00
regress Fix some incorrect parsing of time with time zone strings 2019-08-07 18:17:57 +09:00
ssl Fix searchpath and module location for pg_rewind and ssl TAP tests 2019-02-07 11:10:59 -05:00
thread Fix up .gitignore and cleanup actions in some src/test/ subdirectories. 2015-04-24 17:13:06 -04:00
Makefile Install TAP test infrastructure so it's available for extension testing. 2016-09-23 15:50:00 -04:00