get_config() uses ctime() to generate printable form of
memqcache_stats_start_time. But it did not take into account that
ctime() adds newline at the end of result. As a result, not only the
output of memqcache_stats_start_time was with unnecessary newline but
next row printed empty items.
Author: Tatsuo Ishii <ishii@postgresql.org>
Discussion: https://www.postgresql.org/message-id/
20251130.102712.
131456481338876013.ishii%40postgresql.org
Backpatch-through: v4.3
StrNCpy(status[i].name, "memqcache_stats_start_time", POOLCONFIG_MAXNAMELEN);
snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", ctime(&pool_get_memqcache_stats()->start_time));
+ /* remove a newline added by ctime() */
+ *(strchrnul(status[i].value, '\n')) = '\0';
StrNCpy(status[i].desc, "Start time of query cache stats", POOLCONFIG_MAXDESCLEN);
i++;