forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4a0aab1
committed
Defend against self-referential views in relation_is_updatable().
While a self-referential view doesn't actually work, it's possibleto create one, and it turns out that this breaks some of theinformation_schema views. Those views call relation_is_updatable(),which neglected to consider the hazards of being recursive. Inolder PG versions you get a "stack depth limit exceeded" error,but since v10 it'd recurse to the point of stack overrun and crash,because commita4c35ea took out the expression_returns_set() callthat was incidentally checking the stack depth.Since this function is only used by information_schema views, itseems like it'd be better to return "not updatable" than sufferan error. Hence, add tracking of what views we're examining,in just the same way that the nearby fireRIRrules() code detectsself-referential views. I added a check_stack_depth() call too,just to be defensive.Per private report from Manuel Rigger. Back-patch to allsupported versions.1 parent2e4db24 commit4a0aab1
File tree
3 files changed
+24
-2
lines changed- src
- backend
- rewrite
- utils/adt
- include/rewrite
3 files changed
+24
-2
lines changedLines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| 30 | + | |
30 | 31 |
| |
31 | 32 |
| |
32 | 33 |
| |
| |||
2619 | 2620 |
| |
2620 | 2621 |
| |
2621 | 2622 |
| |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
2622 | 2628 |
| |
2623 | 2629 |
| |
2624 | 2630 |
| |
| |||
2637 | 2643 |
| |
2638 | 2644 |
| |
2639 | 2645 |
| |
| 2646 | + | |
2640 | 2647 |
| |
2641 | 2648 |
| |
2642 | 2649 |
| |
| |||
2646 | 2653 |
| |
2647 | 2654 |
| |
2648 | 2655 |
| |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
2649 | 2659 |
| |
2650 | 2660 |
| |
2651 | 2661 |
| |
| |||
2657 | 2667 |
| |
2658 | 2668 |
| |
2659 | 2669 |
| |
| 2670 | + | |
| 2671 | + | |
| 2672 | + | |
| 2673 | + | |
| 2674 | + | |
| 2675 | + | |
| 2676 | + | |
2660 | 2677 |
| |
2661 | 2678 |
| |
2662 | 2679 |
| |
| |||
2777 | 2794 |
| |
2778 | 2795 |
| |
2779 | 2796 |
| |
| 2797 | + | |
| 2798 | + | |
2780 | 2799 |
| |
2781 | 2800 |
| |
2782 | 2801 |
| |
| 2802 | + | |
2783 | 2803 |
| |
2784 | 2804 |
| |
| 2805 | + | |
2785 | 2806 |
| |
2786 | 2807 |
| |
2787 | 2808 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
509 | 509 |
| |
510 | 510 |
| |
511 | 511 |
| |
512 |
| - | |
| 512 | + | |
513 | 513 |
| |
514 | 514 |
| |
515 | 515 |
| |
| |||
533 | 533 |
| |
534 | 534 |
| |
535 | 535 |
| |
536 |
| - | |
| 536 | + | |
537 | 537 |
| |
538 | 538 |
| |
539 | 539 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
| 33 | + | |
33 | 34 |
| |
34 | 35 |
| |
35 | 36 |
| |
|
0 commit comments
Comments
(0)