postgresql/contrib/pageinspect
Tom Lane b66827ca7c Fix tuple_data_split() to not open a relation without any lock.
contrib/pageinspect's tuple_data_split() function thought it could get
away with opening the referenced relation with NoLock.  In practice
there's no guarantee that the current session holds any lock on that
rel (even if we just read a page from it), so that this is unsafe.

Switch to using AccessShareLock.  Also, postpone closing the relation,
so that we needn't copy its tupdesc.  Also, fix unsafe use of
att_isnull() for attributes past the end of the tuple.

Per testing with a patch that complains if we open a relation without
holding any lock on it.  I don't plan to back-patch that patch, but we
should close the holes it identifies in all supported branches.

Discussion: https://postgr.es/m/2038.1538335244@sss.pgh.pa.us
2018-10-01 11:51:07 -04:00
..
expected pgstatindex, pageinspect: handle partitioned indexes 2018-05-09 14:22:59 -03:00
sql pgstatindex, pageinspect: handle partitioned indexes 2018-05-09 14:22:59 -03:00
.gitignore
brinfuncs.c
btreefuncs.c Make error message of pageinspect more consistent for raw page inputs 2018-07-29 23:50:35 +09:00
fsmfuncs.c
ginfuncs.c
hashfuncs.c Clean up warnings from -Wimplicit-fallthrough. 2018-05-01 19:35:08 -04:00
heapfuncs.c Fix tuple_data_split() to not open a relation without any lock. 2018-10-01 11:51:07 -04:00
Makefile
pageinspect--1.0--1.1.sql
pageinspect--1.1--1.2.sql
pageinspect--1.2--1.3.sql
pageinspect--1.3--1.4.sql
pageinspect--1.4--1.5.sql
pageinspect--1.5--1.6.sql
pageinspect--1.5.sql
pageinspect--1.6--1.7.sql
pageinspect--unpackaged--1.0.sql
pageinspect.control
pageinspect.h
rawpage.c Make error message of pageinspect more consistent for raw page inputs 2018-07-29 23:50:35 +09:00