Merge pull request #130 from darkfronza/PG-272_fix_server_crash

PG-272: Fix server crash when calling pg_stat_monitor_reset().
pull/132/head
Ibrar Ahmed 2021-11-12 20:42:29 +05:00 committed by GitHub
commit f1166c306a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1579,7 +1579,7 @@ pg_stat_monitor_reset(PG_FUNCTION_ARGS)
LWLockAcquire(pgss->lock, LW_EXCLUSIVE); LWLockAcquire(pgss->lock, LW_EXCLUSIVE);
hash_entry_dealloc(-1, -1, NULL); hash_entry_dealloc(-1, -1, NULL);
/* Reset query buffers. */ /* Reset query buffers. */
for (size_t i = 0; i < MAX_BUCKETS; ++i) for (size_t i = 0; i < PGSM_MAX_BUCKETS; ++i)
{ {
*(uint64 *)pgss_qbuf[i] = 0; *(uint64 *)pgss_qbuf[i] = 0;
} }