pgsql: Fix missing tts_tid assignments in ExecForceStoreHeapTuple().

Поиск
Список
Период
Сортировка
Искать

pgsql: Fix missing tts_tid assignments in ExecForceStoreHeapTuple().

От:
Nathan Bossart <nathan@postgresql.org>
Дата:
Fix missing tts_tid assignments in ExecForceStoreHeapTuple().

ExecForceStoreHeapTuple() clears the slot before storing the tuple,
which invalidates the slot's TID, but it only sets the TID again
for slots of type TTSOpsHeapTuple.  Besides producing wrong query
results, this can lead to data corruption if an affected tuple is
locked (e.g., via SELECT ... FOR UPDATE).  To fix, set the slot's
TID for the other kinds of slots, too.

Oversight in commit b8d71745ea.

Author: Virender Singla 
Co-authored-by: Greg Burd 
Reviewed-by: Dilip Kumar 
Reviewed-by: Andres Freund 
Reviewed-by: Nikolay Samokhvalov 
Reviewed-by: Heikki Linnakangas 
Tested-by: Shihao Zhong 
Discussion: https://postgr.es/m/CAM6Zo8wZOLnCWRO_tuuXVX9J4N4JN6GsEnk8WJtT0%3D_0zy-1dw%40mail.gmail.com
Discussion: https://postgr.es/m/0498c10f-839b-4f68-9994-c29b454e55a4%40app.fastmail.com
Backpatch-through: 14

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4e9a5dc1f57c7b1e64601825a497b94b1f36359c

Modified Files
--------------
src/backend/executor/execTuples.c | 2 ++
1 file changed, 2 insertions(+)

FAQ