diff options
author | Robert Haas <rhaas@postgresql.org> | 2016-03-10 06:07:57 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2016-03-10 06:07:57 -0500 |
commit | 090b287fc59e7a44da8c3e0823eecdc8ea4522f2 (patch) | |
tree | 514760ab070fb56cd51e51784e6165624f574dc0 | |
parent | cc402116ca156babcd3ef941317f462a96277e3a (diff) | |
download | postgresql-090b287fc59e7a44da8c3e0823eecdc8ea4522f2.tar.gz postgresql-090b287fc59e7a44da8c3e0823eecdc8ea4522f2.zip |
Code review for b6fb6471f6afaf649e52f38269fd8c5c60647669.
Reports by Tomas Vondra, Vinayak Pokale, and Aleksander Alekseev.
Patch by Amit Langote.
-rw-r--r-- | src/backend/postmaster/pgstat.c | 7 | ||||
-rw-r--r-- | src/backend/utils/adt/pgstatfuncs.c | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c index ce5da3e292e..4424cb8ed2b 100644 --- a/src/backend/postmaster/pgstat.c +++ b/src/backend/postmaster/pgstat.c @@ -2861,8 +2861,8 @@ pgstat_report_activity(BackendState state, const char *cmd_str) /*----------- * pgstat_progress_start_command() - * - * Set st_command in own backend entry. Also, zero-initialize - * st_progress_param array. + * Set st_progress_command (and st_progress_command_target) in own backend + * entry. Also, zero-initialize st_progress_param array. *----------- */ void @@ -2904,7 +2904,8 @@ pgstat_progress_update_param(int index, int64 val) /*----------- * pgstat_progress_end_command() - * - * Update index'th member in st_progress_param[] of own backend entry. + * Reset st_progress_command (and st_progress_command_target) in own backend + * entry. This signals the end of the command. *----------- */ void diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c index 0c790ff3ec5..2fb51fa6788 100644 --- a/src/backend/utils/adt/pgstatfuncs.c +++ b/src/backend/utils/adt/pgstatfuncs.c @@ -614,7 +614,7 @@ pg_stat_get_progress_info(PG_FUNCTION_ARGS) else { nulls[2] = true; - for (i = 1; i < PGSTAT_NUM_PROGRESS_PARAM + 1; i++) + for (i = 0; i < PGSTAT_NUM_PROGRESS_PARAM; i++) nulls[i+3] = true; } |