forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6919b7e
committed
Fix failure to ignore leftover temp tables after a server crash.
During crash recovery, we remove disk files belonging to temporary tables,but the system catalog entries for such tables are intentionally notcleaned up right away. Instead, the first backend that uses a temp schemais expected to clean out any leftover objects therein. This approachrequires that we be careful to ignore leftover temp tables (since anyactual access attempt would fail), *even if their BackendId matches oursession*, if we have not yet established use of the session's correspondingtemp schema. That worked fine in the past, but was broken by commitdebcec7 which incorrectly removed therd_islocaltemp relcache flag. Put it back, and undo various changesthat substituted tests like "rel->rd_backend == MyBackendId" for useof a state-aware flag. Per trouble report from Heikki Linnakangas.Back-patch to 9.1 where the erroneous change was made. In the backbranches, be careful to add rd_islocaltemp in a spot in the struct thatwas alignment padding before, so as not to break existing add-on code.1 parentc299477 commit6919b7e
File tree
7 files changed
+64
-24
lines changed- src
- backend
- catalog
- commands
- utils
- adt
- cache
- include/utils
7 files changed
+64
-24
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
196 | 196 |
| |
197 | 197 |
| |
198 | 198 |
| |
199 |
| - | |
| 199 | + | |
200 | 200 |
| |
201 | 201 |
| |
202 | 202 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
806 | 806 |
| |
807 | 807 |
| |
808 | 808 |
| |
809 |
| - | |
| 809 | + | |
810 | 810 |
| |
811 | 811 |
| |
812 | 812 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
553 | 553 |
| |
554 | 554 |
| |
555 | 555 |
| |
556 |
| - | |
| 556 | + | |
557 | 557 |
| |
558 | 558 |
| |
559 | 559 |
| |
| |||
846 | 846 |
| |
847 | 847 |
| |
848 | 848 |
| |
849 |
| - | |
| 849 | + | |
850 | 850 |
| |
851 | 851 |
| |
852 | 852 |
| |
|
Lines changed: 29 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1451 | 1451 |
| |
1452 | 1452 |
| |
1453 | 1453 |
| |
1454 |
| - | |
1455 |
| - | |
| 1454 | + | |
| 1455 | + | |
1456 | 1456 |
| |
1457 | 1457 |
| |
1458 | 1458 |
| |
1459 | 1459 |
| |
1460 | 1460 |
| |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
1461 | 1468 |
| |
1462 | 1469 |
| |
1463 | 1470 |
| |
| |||
5768 | 5775 |
| |
5769 | 5776 |
| |
5770 | 5777 |
| |
| 5778 | + | |
| 5779 | + | |
| 5780 | + | |
| 5781 | + | |
5771 | 5782 |
| |
5772 | 5783 |
| |
5773 | 5784 |
| |
| |||
8884 | 8895 |
| |
8885 | 8896 |
| |
8886 | 8897 |
| |
8887 |
| - | |
8888 |
| - | |
| 8898 | + | |
| 8899 | + | |
8889 | 8900 |
| |
8890 | 8901 |
| |
8891 | 8902 |
| |
8892 | 8903 |
| |
8893 | 8904 |
| |
| 8905 | + | |
| 8906 | + | |
| 8907 | + | |
| 8908 | + | |
| 8909 | + | |
| 8910 | + | |
| 8911 | + | |
| 8912 | + | |
| 8913 | + | |
| 8914 | + | |
| 8915 | + | |
| 8916 | + | |
| 8917 | + | |
| 8918 | + | |
8894 | 8919 |
| |
8895 | 8920 |
| |
8896 | 8921 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
260 | 260 |
| |
261 | 261 |
| |
262 | 262 |
| |
| 263 | + | |
| 264 | + | |
| 265 | + | |
263 | 266 |
| |
264 | 267 |
| |
265 | 268 |
| |
| |||
314 | 317 |
| |
315 | 318 |
| |
316 | 319 |
| |
317 |
| - | |
| 320 | + | |
318 | 321 |
| |
319 | 322 |
| |
320 | 323 |
| |
|
Lines changed: 21 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
853 | 853 |
| |
854 | 854 |
| |
855 | 855 |
| |
| 856 | + | |
856 | 857 |
| |
857 | 858 |
| |
858 | 859 |
| |
| 860 | + | |
859 | 861 |
| |
| 862 | + | |
| 863 | + | |
860 | 864 |
| |
861 | 865 |
| |
862 | 866 |
| |
863 |
| - | |
864 |
| - | |
865 |
| - | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
866 | 878 |
| |
867 | 879 |
| |
868 | 880 |
| |
869 | 881 |
| |
| 882 | + | |
870 | 883 |
| |
871 | 884 |
| |
872 | 885 |
| |
| |||
1387 | 1400 |
| |
1388 | 1401 |
| |
1389 | 1402 |
| |
| 1403 | + | |
1390 | 1404 |
| |
1391 | 1405 |
| |
1392 | 1406 |
| |
| |||
2538 | 2552 |
| |
2539 | 2553 |
| |
2540 | 2554 |
| |
2541 |
| - | |
| 2555 | + | |
2542 | 2556 |
| |
2543 | 2557 |
| |
2544 | 2558 |
| |
2545 | 2559 |
| |
2546 | 2560 |
| |
2547 | 2561 |
| |
| 2562 | + | |
2548 | 2563 |
| |
2549 | 2564 |
| |
| 2565 | + | |
2550 | 2566 |
| |
| 2567 | + | |
2551 | 2568 |
| |
2552 | 2569 |
| |
2553 | 2570 |
| |
|
Lines changed: 6 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
81 | 81 |
| |
82 | 82 |
| |
83 | 83 |
| |
| 84 | + | |
84 | 85 |
| |
85 | 86 |
| |
86 | 87 |
| |
| |||
362 | 363 |
| |
363 | 364 |
| |
364 | 365 |
| |
365 |
| - | |
366 |
| - | |
367 |
| - | |
368 |
| - | |
369 |
| - | |
370 |
| - | |
371 |
| - | |
372 | 366 |
| |
373 | 367 |
| |
374 | 368 |
| |
375 |
| - | |
| 369 | + | |
| 370 | + | |
376 | 371 |
| |
377 | 372 |
| |
378 | 373 |
| |
379 | 374 |
| |
380 |
| - | |
| 375 | + | |
381 | 376 |
| |
382 | 377 |
| |
383 | 378 |
| |
| |||
387 | 382 |
| |
388 | 383 |
| |
389 | 384 |
| |
390 |
| - | |
391 |
| - | |
| 385 | + | |
| 386 | + | |
392 | 387 |
| |
393 | 388 |
| |
394 | 389 |
| |
|
0 commit comments
Comments
(0)