pgsql: Fix memory leak in Incremental Sort rescans

2023-07-02 Thread Tomas Vondra
Fix memory leak in Incremental Sort rescans The Incremental Sort had a couple issues, resulting in leaking memory during rescans, possibly triggering OOM. The code had a couple of related flaws: 1. During rescans, the sort states were reset but then also set to NULL (despite the comment

pgsql: Fix memory leak in Incremental Sort rescans

2023-07-02 Thread Tomas Vondra
Fix memory leak in Incremental Sort rescans The Incremental Sort had a couple issues, resulting in leaking memory during rescans, possibly triggering OOM. The code had a couple of related flaws: 1. During rescans, the sort states were reset but then also set to NULL (despite the comment

pgsql: Fix memory leak in Incremental Sort rescans

2023-07-02 Thread Tomas Vondra
Fix memory leak in Incremental Sort rescans The Incremental Sort had a couple issues, resulting in leaking memory during rescans, possibly triggering OOM. The code had a couple of related flaws: 1. During rescans, the sort states were reset but then also set to NULL (despite the comment

pgsql: Fix memory leak in Incremental Sort rescans

2023-07-02 Thread Tomas Vondra
Fix memory leak in Incremental Sort rescans The Incremental Sort had a couple issues, resulting in leaking memory during rescans, possibly triggering OOM. The code had a couple of related flaws: 1. During rescans, the sort states were reset but then also set to NULL (despite the comment

pgsql: Fix memory leak in Incremental Sort rescans

2023-07-02 Thread Tomas Vondra
Fix memory leak in Incremental Sort rescans The Incremental Sort had a couple issues, resulting in leaking memory during rescans, possibly triggering OOM. The code had a couple of related flaws: 1. During rescans, the sort states were reset but then also set to NULL (despite the comment