- Notifications
You must be signed in to change notification settings - Fork28
Commitb66827c
committed
Fix tuple_data_split() to not open a relation without any lock.
contrib/pageinspect's tuple_data_split() function thought it could getaway with opening the referenced relation with NoLock. In practicethere's no guarantee that the current session holds any lock on thatrel (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 ofatt_isnull() for attributes past the end of the tuple.Per testing with a patch that complains if we open a relation withoutholding any lock on it. I don't plan to back-patch that patch, but weshould close the holes it identifies in all supported branches.Discussion:https://postgr.es/m/2038.1538335244@sss.pgh.pa.us1 parente27453b commitb66827c
1 file changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
302 | | - | |
303 | | - | |
| 301 | + | |
| 302 | + | |
304 | 303 | | |
305 | 304 | | |
306 | 305 | | |
| |||
317 | 316 | | |
318 | 317 | | |
319 | 318 | | |
320 | | - | |
321 | 319 | | |
322 | 320 | | |
323 | 321 | | |
| |||
327 | 325 | | |
328 | 326 | | |
329 | 327 | | |
| 328 | + | |
| 329 | + | |
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| 389 | + | |
| 390 | + | |
389 | 391 | | |
390 | 392 | | |
391 | 393 | | |
| |||
0 commit comments
Comments
(0)