Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9dc1225

Browse files
committed
Silence compiler warning
My original coding was questionable anyway.Reported-by: Sergei KornilovDiscussion:https://postgr.es/m/9645101543575886@myt6-27270b78ac4f.qloud-c.yandex.net
1 parentdcfdf56 commit9dc1225

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎src/backend/tcop/postgres.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,12 +2244,13 @@ check_log_duration(char *msec_str, bool was_logged)
22442244
/*
22452245
* Do not log if log_statement_sample_rate = 0. Log a sample if
22462246
* log_statement_sample_rate <= 1 and avoid unecessary random() call
2247-
* if log_statement_sample_rate = 1.
2247+
* if log_statement_sample_rate = 1. But don't compute any of this
2248+
* unless needed.
22482249
*/
2249-
if (exceeded)
2250-
in_sample=log_statement_sample_rate!=0&&
2251-
(log_statement_sample_rate==1||
2252-
random() <=log_statement_sample_rate*MAX_RANDOM_VALUE);
2250+
in_sample=exceeded&&
2251+
log_statement_sample_rate!=0&&
2252+
(log_statement_sample_rate==1||
2253+
random() <=log_statement_sample_rate*MAX_RANDOM_VALUE);
22532254

22542255
if ((exceeded&&in_sample)||log_duration)
22552256
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp