From 0f358c9b9ab1c8fb366ed0b9879100d4881adca4 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Fri, 20 May 2022 13:55:20 +0900 Subject: [PATCH] Add volatile modifier to a variable used in the query cache module. "sts" variable used in pool_fetch_memory_cache() did not have volatile modifier although it is used in PG_TRY() block. If an exception arises the value set to variable will be lost in the PG_CATCH block. The bad effect of this will not be triggered unless error occurs and I think the bad effect has rarely been observed in the wild (as for as I know, I have never heard such a report). Anyway, bug is bug. --- src/query_cache/pool_memqcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/query_cache/pool_memqcache.c b/src/query_cache/pool_memqcache.c index a8cc5f712..4b127f50f 100644 --- a/src/query_cache/pool_memqcache.c +++ b/src/query_cache/pool_memqcache.c @@ -734,7 +734,7 @@ pool_fetch_from_memory_cache(POOL_CONNECTION * frontend, { char *qcache; size_t qcachelen; - int sts; + volatile int sts; pool_sigset_t oldmask; ereport(DEBUG1, -- 2.39.5