Skip to content

Commit e36578c

Browse files
committed
fix initialization of pgspHashKey structure
1 parent a073869 commit e36578c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pg_store_plans.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ _PG_init(void)
548548

549549
EmitWarningsOnPlaceholders("pg_store_plans");
550550

551-
#if PG_VERSION_NUM < 150000
551+
#if PG_VERSION_NUM < 150000
552552
pgsp_shmem_request();
553553
#endif
554554

@@ -1216,6 +1216,8 @@ pgsp_store(char *plan, queryid_t queryId,
12161216

12171217
Assert(plan != NULL && queryId != PGSP_NO_QUERYID);
12181218

1219+
memset(&key, 0, sizeof(pgspHashKey));
1220+
12191221
/* Safety check... */
12201222
if (!shared_state || !hash_table)
12211223
return;
@@ -1292,7 +1294,7 @@ pgsp_store(char *plan, queryid_t queryId,
12921294
/* shorten_plan is terminated by NUL */
12931295
if (plan_storage == PLAN_STORAGE_SHMEM)
12941296
memcpy(SHMEM_PLAN_PTR(entry), shorten_plan, plan_len + 1);
1295-
1297+
12961298

12971299
/* If needed, perform garbage collection while exclusive lock held */
12981300
if (do_gc)

0 commit comments

Comments
 (0)