Silence compiler warning
My original coding was questionable anyway. Reported-by: Sergei Kornilov Discussion: https://postgr.es/m/9645101543575886@myt6-27270b78ac4f.qloud-c.yandex.net
This commit is contained in:
parent
dcfdf56e89
commit
9dc1225855
|
@ -2244,12 +2244,13 @@ check_log_duration(char *msec_str, bool was_logged)
|
||||||
/*
|
/*
|
||||||
* Do not log if log_statement_sample_rate = 0. Log a sample if
|
* Do not log if log_statement_sample_rate = 0. Log a sample if
|
||||||
* log_statement_sample_rate <= 1 and avoid unecessary random() call
|
* log_statement_sample_rate <= 1 and avoid unecessary random() call
|
||||||
* if log_statement_sample_rate = 1.
|
* if log_statement_sample_rate = 1. But don't compute any of this
|
||||||
|
* unless needed.
|
||||||
*/
|
*/
|
||||||
if (exceeded)
|
in_sample = exceeded &&
|
||||||
in_sample = log_statement_sample_rate != 0 &&
|
log_statement_sample_rate != 0 &&
|
||||||
(log_statement_sample_rate == 1 ||
|
(log_statement_sample_rate == 1 ||
|
||||||
random() <= log_statement_sample_rate * MAX_RANDOM_VALUE);
|
random() <= log_statement_sample_rate * MAX_RANDOM_VALUE);
|
||||||
|
|
||||||
if ((exceeded && in_sample) || log_duration)
|
if ((exceeded && in_sample) || log_duration)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue