forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf02137d
committed
Make viewquery a copy in rewriteTargetView()
Rather than expect the Query returned by get_view_query() to beread-only and then copy bits and pieces of it out, simply copy theentire structure when we get it. This addresses an issue whereAcquireRewriteLocks, which is called by acquireLocksOnSubLinks(),scribbles on the parsetree passed in, which was actually an entryin relcache, leading to segfaults with certain view definitions.This also future-proofs us a bit for anyone adding more code to thispath.The acquireLocksOnSubLinks() was added in commitc3e0ddd.Back-patch to 9.3 as that commit was.1 parent590d201 commitf02137d
File tree
3 files changed
+133
-12
lines changed- src
- backend/rewrite
- test/regress
- expected
- sql
3 files changed
+133
-12
lines changedLines changed: 22 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1908 | 1908 |
| |
1909 | 1909 |
| |
1910 | 1910 |
| |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
1911 | 1914 |
| |
1912 | 1915 |
| |
1913 | 1916 |
| |
| |||
2494 | 2497 |
| |
2495 | 2498 |
| |
2496 | 2499 |
| |
2497 |
| - | |
2498 |
| - | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
2499 | 2508 |
| |
| 2509 | + | |
2500 | 2510 |
| |
2501 | 2511 |
| |
2502 | 2512 |
| |
| |||
2648 | 2658 |
| |
2649 | 2659 |
| |
2650 | 2660 |
| |
2651 |
| - | |
| 2661 | + | |
2652 | 2662 |
| |
2653 | 2663 |
| |
2654 | 2664 |
| |
| |||
2660 | 2670 |
| |
2661 | 2671 |
| |
2662 | 2672 |
| |
2663 |
| - | |
2664 |
| - | |
2665 |
| - | |
2666 |
| - | |
2667 |
| - | |
2668 |
| - | |
| 2673 | + | |
| 2674 | + | |
| 2675 | + | |
| 2676 | + | |
| 2677 | + | |
| 2678 | + | |
2669 | 2679 |
| |
2670 |
| - | |
| 2680 | + | |
2671 | 2681 |
| |
2672 | 2682 |
| |
2673 | 2683 |
| |
| |||
2813 | 2823 |
| |
2814 | 2824 |
| |
2815 | 2825 |
| |
2816 |
| - | |
| 2826 | + | |
2817 | 2827 |
| |
2818 | 2828 |
| |
2819 | 2829 |
| |
| |||
2890 | 2900 |
| |
2891 | 2901 |
| |
2892 | 2902 |
| |
2893 |
| - | |
| 2903 | + | |
2894 | 2904 |
| |
2895 | 2905 |
| |
2896 | 2906 |
| |
|
Lines changed: 67 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2284 | 2284 |
| |
2285 | 2285 |
| |
2286 | 2286 |
| |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
| 2323 | + | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + | |
| 2336 | + | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + |
Lines changed: 44 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1011 | 1011 |
| |
1012 | 1012 |
| |
1013 | 1013 |
| |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + |
0 commit comments
Comments
(0)