Add missing CommandCounterIncrement() in stats import functions.
Reported-by: Alexander Lakhin Discussion: https://postgr.es/m/98b2fcf0-f701-369e-d63d-6be9739ce17c@gmail.com
This commit is contained in:
parent
30d47ec8c6
commit
f22e436bff
@ -752,6 +752,8 @@ upsert_pg_statistic(Relation starel, HeapTuple oldtup,
|
|||||||
}
|
}
|
||||||
|
|
||||||
heap_freetuple(newtup);
|
heap_freetuple(newtup);
|
||||||
|
|
||||||
|
CommandCounterIncrement();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -762,6 +764,7 @@ delete_pg_statistic(Oid reloid, AttrNumber attnum, bool stainherit)
|
|||||||
{
|
{
|
||||||
Relation sd = table_open(StatisticRelationId, RowExclusiveLock);
|
Relation sd = table_open(StatisticRelationId, RowExclusiveLock);
|
||||||
HeapTuple oldtup;
|
HeapTuple oldtup;
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
/* Is there already a pg_statistic tuple for this attribute? */
|
/* Is there already a pg_statistic tuple for this attribute? */
|
||||||
oldtup = SearchSysCache3(STATRELATTINH,
|
oldtup = SearchSysCache3(STATRELATTINH,
|
||||||
@ -773,12 +776,14 @@ delete_pg_statistic(Oid reloid, AttrNumber attnum, bool stainherit)
|
|||||||
{
|
{
|
||||||
CatalogTupleDelete(sd, &oldtup->t_self);
|
CatalogTupleDelete(sd, &oldtup->t_self);
|
||||||
ReleaseSysCache(oldtup);
|
ReleaseSysCache(oldtup);
|
||||||
table_close(sd, RowExclusiveLock);
|
result = true;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
table_close(sd, RowExclusiveLock);
|
table_close(sd, RowExclusiveLock);
|
||||||
return false;
|
|
||||||
|
CommandCounterIncrement();
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -171,6 +171,8 @@ relation_statistics_update(FunctionCallInfo fcinfo, int elevel)
|
|||||||
/* release the lock, consistent with vac_update_relstats() */
|
/* release the lock, consistent with vac_update_relstats() */
|
||||||
table_close(crel, RowExclusiveLock);
|
table_close(crel, RowExclusiveLock);
|
||||||
|
|
||||||
|
CommandCounterIncrement();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user