Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ All notable changes to this project will be documented in this file. It uses the
* No longer push down regular expression functions if the regular expression
argument is not a constant.
* Fixed a memory leak in the http driver when not using streaming ([#281]).
* Fixed a memory leak when a foreign scan repeatedly re-scans, typically a
nested-loop join with a parameterized inner foreign scan ([#282]).

### 🏗️ Build Setup

Expand All @@ -56,8 +58,10 @@ All notable changes to this project will be documented in this file. It uses the
"ClickHouse/pg_clickhouse#268 add compression option for binary protocol"
[#269]: https://github.com/ClickHouse/pg_clickhouse/pull/269
"ClickHouse/pg_clickhouse#269 Add support for PostgreSQL 19beta1"
[#218]: https://github.com/ClickHouse/pg_clickhouse/pull/218
"ClickHouse/pg_clickhouse#218 Properly free Curl memory on palloc error"
[#281]: https://github.com/ClickHouse/pg_clickhouse/pull/281
"ClickHouse/pg_clickhouse#281 Properly free Curl memory on palloc error"
[#282]: https://github.com/ClickHouse/pg_clickhouse/pull/282
"ClickHouse/pg_clickhouse#282 Free batch context on re-scan"
[clang-format]: https://clang.llvm.org/docs/ClangFormat.html
[#283]: https://github.com/ClickHouse/pg_clickhouse/pull/283
"ClickHouse/pg_clickhouse#283 clang-format"
Expand Down
9 changes: 6 additions & 3 deletions src/fdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1230,9 +1230,12 @@ clickhouseEndForeignScan(ForeignScanState* node) {
ChFdwScanState* fsstate = (ChFdwScanState*)node->fdw_state;

time_used = 0;
if (fsstate && fsstate->ch_cursor) {
MemoryContextDelete(fsstate->ch_cursor->memcxt);
fsstate->ch_cursor = NULL;
if (fsstate) {
if (fsstate->ch_cursor) {
MemoryContextDelete(fsstate->ch_cursor->memcxt);
fsstate->ch_cursor = NULL;
}
MemoryContextDelete(fsstate->batch_cxt);
}
}

Expand Down
Loading