]> granicus.if.org Git - postgresql/commitdiff
Code review for b6fb6471f6afaf649e52f38269fd8c5c60647669.
authorRobert Haas <rhaas@postgresql.org>
Thu, 10 Mar 2016 11:07:57 +0000 (06:07 -0500)
committerRobert Haas <rhaas@postgresql.org>
Thu, 10 Mar 2016 11:07:57 +0000 (06:07 -0500)
Reports by Tomas Vondra, Vinayak Pokale, and Aleksander Alekseev.
Patch by Amit Langote.

src/backend/postmaster/pgstat.c
src/backend/utils/adt/pgstatfuncs.c

index ce5da3e292ed224f880c12965a2958a75856eb2c..4424cb8ed2b2dd1435d9e57625944e1931d66e17 100644 (file)
@@ -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
index 0c790ff3ec56dd02e2c3a45b1fde26bc6cbda0d5..2fb51fa6788001f0e52bb8a5df57644e4dd1836c 100644 (file)
@@ -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;
                }