forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitec5f71a
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 parent0360c53 commitec5f71a
1 file changed
+6
-4
lines changedLines changed: 6 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
296 | 296 |
| |
297 | 297 |
| |
298 | 298 |
| |
299 |
| - | |
300 |
| - | |
301 |
| - | |
| 299 | + | |
| 300 | + | |
302 | 301 |
| |
303 | 302 |
| |
304 | 303 |
| |
| |||
315 | 314 |
| |
316 | 315 |
| |
317 | 316 |
| |
318 |
| - | |
319 | 317 |
| |
320 | 318 |
| |
321 | 319 |
| |
| |||
325 | 323 |
| |
326 | 324 |
| |
327 | 325 |
| |
| 326 | + | |
| 327 | + | |
328 | 328 |
| |
329 | 329 |
| |
330 | 330 |
| |
| |||
384 | 384 |
| |
385 | 385 |
| |
386 | 386 |
| |
| 387 | + | |
| 388 | + | |
387 | 389 |
| |
388 | 390 |
| |
389 | 391 |
| |
|
0 commit comments
Comments
(0)