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

Commite69b8d4

Browse files
committed
Fix memory leak in relcache handling of rules: allocate rule parsetrees
in per-entry sub-memory-context, where they were supposed to go, ratherthan in CacheMemoryContext where the code was putting them. Must'vesuffered a severe brain fade when I wrote this :-(
1 parentca88243 commite69b8d4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/backend/utils/cache/relcache.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.124 2001/01/0601:48:59 inoue Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.125 2001/01/0621:53:18 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -881,7 +881,7 @@ RelationBuildRuleLock(Relation relation)
881881
Assert(!isnull);
882882
ruleaction_str=DatumGetCString(DirectFunctionCall1(textout,
883883
ruleaction));
884-
oldcxt=MemoryContextSwitchTo(CacheMemoryContext);
884+
oldcxt=MemoryContextSwitchTo(rulescxt);
885885
rule->actions= (List*)stringToNode(ruleaction_str);
886886
MemoryContextSwitchTo(oldcxt);
887887
pfree(ruleaction_str);
@@ -893,7 +893,7 @@ RelationBuildRuleLock(Relation relation)
893893
Assert(!isnull);
894894
rule_evqual_str=DatumGetCString(DirectFunctionCall1(textout,
895895
rule_evqual));
896-
oldcxt=MemoryContextSwitchTo(CacheMemoryContext);
896+
oldcxt=MemoryContextSwitchTo(rulescxt);
897897
rule->qual= (Node*)stringToNode(rule_evqual_str);
898898
MemoryContextSwitchTo(oldcxt);
899899
pfree(rule_evqual_str);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp