diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2023-09-19 11:29:45 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2023-09-19 11:35:01 +0200 |
commit | c5b0582841a5785aaf20fa77b507f7041e119d68 (patch) | |
tree | 20a5bbb31b2f5ef9a2363d5d67604e342ab80168 /src/backend/utils/adt/pgstatfuncs.c | |
parent | bf094372d14bf00f1c04f70f6ec5790f8b2c8801 (diff) | |
download | postgresql-c5b0582841a5785aaf20fa77b507f7041e119d68.tar.gz postgresql-c5b0582841a5785aaf20fa77b507f7041e119d68.zip |
Replace more MemSet calls with struct initialization
This fixes up 10ea0f924a2 to use the style introduced by 9fd45870c1.
Author: Richard Guo <guofenglinux@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CAMbWs490gJf5A=ydqyjh+Z8mVQa_foTGtcmBtHGLra0aOwLWHQ@mail.gmail.com
Diffstat (limited to 'src/backend/utils/adt/pgstatfuncs.c')
-rw-r--r-- | src/backend/utils/adt/pgstatfuncs.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c index dd5094a2d45..3b44af80066 100644 --- a/src/backend/utils/adt/pgstatfuncs.c +++ b/src/backend/utils/adt/pgstatfuncs.c @@ -709,15 +709,11 @@ pg_stat_get_backend_subxact(PG_FUNCTION_ARGS) { #define PG_STAT_GET_SUBXACT_COLS 2 TupleDesc tupdesc; - Datum values[PG_STAT_GET_SUBXACT_COLS]; - bool nulls[PG_STAT_GET_SUBXACT_COLS]; + Datum values[PG_STAT_GET_SUBXACT_COLS] = {0}; + bool nulls[PG_STAT_GET_SUBXACT_COLS] = {0}; int32 beid = PG_GETARG_INT32(0); LocalPgBackendStatus *local_beentry; - /* Initialise values and NULL flags arrays */ - MemSet(values, 0, sizeof(values)); - MemSet(nulls, 0, sizeof(nulls)); - /* Initialise attributes information in the tuple descriptor */ tupdesc = CreateTemplateTupleDesc(PG_STAT_GET_SUBXACT_COLS); TupleDescInitEntry(tupdesc, (AttrNumber) 1, "subxact_count", |