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

Commit489e6ac

Browse files
committed
Fix comparison of an array of characters with zero to compare with '\0' instead.
Report from Andres Freund.
1 parentc1fe08e commit489e6ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/backend/utils/adt/pgstatfuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,7 +1751,7 @@ pg_stat_get_archiver(PG_FUNCTION_ARGS)
17511751

17521752
/* Fill values and NULLs */
17531753
values[0]=Int64GetDatum(archiver_stats->archived_count);
1754-
if (archiver_stats->last_archived_wal==0)
1754+
if (*(archiver_stats->last_archived_wal)=='\0')
17551755
nulls[1]= true;
17561756
else
17571757
values[1]=CStringGetTextDatum(archiver_stats->last_archived_wal);
@@ -1762,7 +1762,7 @@ pg_stat_get_archiver(PG_FUNCTION_ARGS)
17621762
values[2]=TimestampTzGetDatum(archiver_stats->last_archived_timestamp);
17631763

17641764
values[3]=Int64GetDatum(archiver_stats->failed_count);
1765-
if (archiver_stats->last_failed_wal==0)
1765+
if (*(archiver_stats->last_failed_wal)=='\0')
17661766
nulls[4]= true;
17671767
else
17681768
values[4]=CStringGetTextDatum(archiver_stats->last_failed_wal);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp