Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix SkipScan crash due to pruned unique path
When SkipScan paths are added it can result in a crash if the new SkipScan dominates the PostgreSQL planned unique path. In that case, the previous unique path is pruned and freed, leading to a potential memory corruption since a pointer to the original unique path is used when looping over all subpaths to try to apply SkipScan. Thus, if the original unique path is pruned, and there are multiple subpaths, a crash will occur in the next iteration over the subpaths. The crash is fixed by making a shallow copy of the original unique path while iterating the subpaths.
- Loading branch information