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

Commitdc1b8ce

Browse files
committed
Fix plancache's invalidation callback to do the right thing for a SI
reset event, namely invalidate everything. This oversight probablyexplains the rare failures that some buildfarm machines have beenshowing for the plancache regression test.
1 parent1cc97d1 commitdc1b8ce

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* Portions Copyright (c) 1994, Regents of the University of California
3434
*
3535
* IDENTIFICATION
36-
* $PostgreSQL: pgsql/src/backend/utils/cache/plancache.c,v 1.4 2007/03/23 19:53:51 tgl Exp $
36+
* $PostgreSQL: pgsql/src/backend/utils/cache/plancache.c,v 1.5 2007/03/26 00:36:19 tgl Exp $
3737
*
3838
*-------------------------------------------------------------------------
3939
*/
@@ -812,6 +812,9 @@ PlanCacheComputeResultDesc(List *stmt_list)
812812
/*
813813
* PlanCacheCallback
814814
*Relcache inval callback function
815+
*
816+
* Invalidate all plans mentioning the given rel, or all plans mentioning
817+
* any rel at all if relid == InvalidOid.
815818
*/
816819
staticvoid
817820
PlanCacheCallback(Datumarg,Oidrelid)
@@ -843,7 +846,7 @@ PlanCacheCallback(Datum arg, Oid relid)
843846

844847
if (rte->rtekind!=RTE_RELATION)
845848
continue;
846-
if (relid==rte->relid)
849+
if (relid==rte->relid||relid==InvalidOid)
847850
{
848851
/* Invalidate the plan! */
849852
plan->dead= true;
@@ -883,10 +886,11 @@ PlanCacheCallback(Datum arg, Oid relid)
883886
staticvoid
884887
InvalRelid(Oidrelid,LOCKMODElockmode,InvalRelidContext*context)
885888
{
886-
if (relid==context->inval_relid)
889+
if (relid==context->inval_relid||context->inval_relid==InvalidOid)
887890
context->plan->dead= true;
888891
}
889892

893+
890894
/*
891895
* HaveCachedPlans
892896
*Check if the plancache has stored any plans at all.
@@ -896,4 +900,3 @@ HaveCachedPlans(void)
896900
{
897901
return (cached_plans_list!=NIL);
898902
}
899-

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp