Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit09914f4

Browse files
committed
Reset internal ctxs in fini_local_cache only when they actually exist.
1 parent9c2ab5f commit09914f4

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

‎expected/pathman_cache_pranks.out

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ CREATE EXTENSION pg_pathman;
1414
DROP EXTENSION pg_pathman;
1515
-- create it for further tests
1616
CREATE EXTENSION pg_pathman;
17+
-- make sure nothing breaks on disable/enable
18+
SET pg_pathman.enable = false;
19+
NOTICE: RuntimeAppend, RuntimeMergeAppend and PartitionFilter nodes and some other options have been disabled
20+
SET pg_pathman.enable = true;
21+
NOTICE: RuntimeAppend, RuntimeMergeAppend and PartitionFilter nodes and some other options have been enabled
1722
-- 079797e0d5
1823
CREATE TABLE part_test(val serial);
1924
INSERT INTO part_test SELECT generate_series(1, 30);

‎sql/pathman_cache_pranks.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ DROP EXTENSION pg_pathman;
1616
-- create it for further tests
1717
CREATE EXTENSION pg_pathman;
1818

19+
-- make sure nothing breaks on disable/enable
20+
SETpg_pathman.enable= false;
21+
SETpg_pathman.enable= true;
22+
1923
-- 079797e0d5
2024
CREATETABLEpart_test(valserial);
2125
INSERT INTO part_testSELECT generate_series(1,30);

‎src/init.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,12 @@ fini_local_cache(void)
403403
}
404404

405405
/* Now we can clear allocations */
406-
MemoryContextReset(PathmanParentsCacheContext);
407-
MemoryContextReset(PathmanStatusCacheContext);
408-
MemoryContextReset(PathmanBoundsCacheContext);
406+
if (TopPathmanContext)
407+
{
408+
MemoryContextReset(PathmanParentsCacheContext);
409+
MemoryContextReset(PathmanStatusCacheContext);
410+
MemoryContextReset(PathmanBoundsCacheContext);
411+
}
409412
}
410413

411414

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp