1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-15 03:41:20 +03:00

Fix interaction of log_line_prefix's query_id and log_statement

log_statement is issued before query_id can be computed, so properly
clear the value, and document the interaction.

Reported-by: Fujii Masao, Michael Paquier

Discussion: https://postgr.es/m/YHPkU8hFi4no4NSw@paquier.xyz

Author: Julien Rouhaud
This commit is contained in:
Bruce Momjian
2021-04-20 12:57:59 -04:00
parent 9660834dd8
commit db01f797dd
2 changed files with 11 additions and 0 deletions

View File

@@ -398,6 +398,7 @@ pgstat_bestart(void)
lbeentry.st_state = STATE_UNDEFINED;
lbeentry.st_progress_command = PROGRESS_COMMAND_INVALID;
lbeentry.st_progress_command_target = InvalidOid;
lbeentry.st_query_id = UINT64CONST(0);
/*
* we don't zero st_progress_param here to save cycles; nobody should