forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbcddad2
committed
Ensure mark_dummy_rel doesn't create dangling pointers in RelOptInfos.
When we are doing GEQO join planning, the current memory context is ashort-lived context that will be reset at the end of geqo_eval(). However,the RelOptInfos for base relations are set up before that and then re-usedacross many GEQO cycles. Hence, any code that modifies a baserel duringjoin planning has to be careful not to put pointers to the short-livedcontext into the baserel struct. mark_dummy_rel got this wrong, leading toeasy-to-reproduce-once-you-know-how crashes in 8.4, as reported off-list byLeo Carson of SDSC. Some improvements made in 9.0 make it difficult todemonstrate the crash in 9.0 or HEAD; but there's no doubt that there'sstill a risk factor here, so patch all branches that have the function.(Note: 8.3 has a similar function, but it's only applied to joinrels andthus is not a hazard.)1 parent078a930 commitbcddad2
1 file changed
+25
-1
lines changedLines changed: 25 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| 20 | + | |
20 | 21 |
| |
21 | 22 |
| |
22 | 23 |
| |
| |||
933 | 934 |
| |
934 | 935 |
| |
935 | 936 |
| |
936 |
| - | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
937 | 950 |
| |
938 | 951 |
| |
939 | 952 |
| |
940 | 953 |
| |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
941 | 963 |
| |
942 | 964 |
| |
943 | 965 |
| |
| |||
949 | 971 |
| |
950 | 972 |
| |
951 | 973 |
| |
| 974 | + | |
| 975 | + | |
952 | 976 |
| |
953 | 977 |
| |
954 | 978 |
| |
|
0 commit comments
Comments
(0)