Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 090b287

Browse files
committed
Code review for b6fb647.
Reports by Tomas Vondra, Vinayak Pokale, and Aleksander Alekseev. Patch by Amit Langote.
1 parent cc40211 commit 090b287

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/backend/postmaster/pgstat.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2861,8 +2861,8 @@ pgstat_report_activity(BackendState state, const char *cmd_str)
28612861
/*-----------
28622862
* pgstat_progress_start_command() -
28632863
*
2864-
* Set st_command in own backend entry. Also, zero-initialize
2865-
* st_progress_param array.
2864+
* Set st_progress_command (and st_progress_command_target) in own backend
2865+
* entry. Also, zero-initialize st_progress_param array.
28662866
*-----------
28672867
*/
28682868
void
@@ -2904,7 +2904,8 @@ pgstat_progress_update_param(int index, int64 val)
29042904
/*-----------
29052905
* pgstat_progress_end_command() -
29062906
*
2907-
* Update index'th member in st_progress_param[] of own backend entry.
2907+
* Reset st_progress_command (and st_progress_command_target) in own backend
2908+
* entry. This signals the end of the command.
29082909
*-----------
29092910
*/
29102911
void

src/backend/utils/adt/pgstatfuncs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ pg_stat_get_progress_info(PG_FUNCTION_ARGS)
614614
else
615615
{
616616
nulls[2] = true;
617-
for (i = 1; i < PGSTAT_NUM_PROGRESS_PARAM + 1; i++)
617+
for (i = 0; i < PGSTAT_NUM_PROGRESS_PARAM; i++)
618618
nulls[i+3] = true;
619619
}
620620

0 commit comments

Comments
 (0)