diff options
author | Michael Paquier <michael@paquier.xyz> | 2024-08-04 03:07:20 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2024-08-04 03:07:20 +0900 |
commit | 028b4b21df26fee67b3ce75c6f14fcfd3c7cf2ee (patch) | |
tree | 5bdc1e2b597b796648f371cceaa58d3ab27b4933 | |
parent | 66188912566b5614dff095ae86f4b1e06d58e875 (diff) | |
download | postgresql-028b4b21df26fee67b3ce75c6f14fcfd3c7cf2ee.tar.gz postgresql-028b4b21df26fee67b3ce75c6f14fcfd3c7cf2ee.zip |
Fix incorrect format placeholders in pgstat.c
These should have been switched from %d to %u in 3188a4582a8c in the
debugging elogs added in ca1ba50fcb6f. PgStat_Kind should never be
higher than INT32_MAX, but let's be clean.
Issue noticed while hacking more on this area.
-rw-r--r-- | src/backend/utils/activity/pgstat.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/backend/utils/activity/pgstat.c b/src/backend/utils/activity/pgstat.c index 143478aca0f..2e13670fc1f 100644 --- a/src/backend/utils/activity/pgstat.c +++ b/src/backend/utils/activity/pgstat.c @@ -1598,7 +1598,7 @@ pgstat_read_statsfile(XLogRecPtr redo) if (!pgstat_is_kind_valid(kind)) { - elog(WARNING, "invalid stats kind %d for entry of type %c", + elog(WARNING, "invalid stats kind %u for entry of type %c", kind, t); goto error; } @@ -1607,7 +1607,7 @@ pgstat_read_statsfile(XLogRecPtr redo) if (!info->fixed_amount) { - elog(WARNING, "invalid fixed_amount in stats kind %d for entry of type %c", + elog(WARNING, "invalid fixed_amount in stats kind %u for entry of type %c", kind, t); goto error; } @@ -1618,7 +1618,7 @@ pgstat_read_statsfile(XLogRecPtr redo) if (!read_chunk(fpin, ptr, info->shared_data_len)) { - elog(WARNING, "could not read data of stats kind %d for entry of type %c with size %u", + elog(WARNING, "could not read data of stats kind %u for entry of type %c with size %u", kind, t, info->shared_data_len); goto error; } @@ -1645,7 +1645,7 @@ pgstat_read_statsfile(XLogRecPtr redo) if (!pgstat_is_kind_valid(key.kind)) { - elog(WARNING, "invalid stats kind for entry %d/%u/%u of type %c", + elog(WARNING, "invalid stats kind for entry %u/%u/%u of type %c", key.kind, key.dboid, key.objoid, t); goto error; } @@ -1664,13 +1664,13 @@ pgstat_read_statsfile(XLogRecPtr redo) } if (!read_chunk_s(fpin, &name)) { - elog(WARNING, "could not read name of stats kind %d for entry of type %c", + elog(WARNING, "could not read name of stats kind %u for entry of type %c", kind, t); goto error; } if (!pgstat_is_kind_valid(kind)) { - elog(WARNING, "invalid stats kind %d for entry of type %c", + elog(WARNING, "invalid stats kind %u for entry of type %c", kind, t); goto error; } @@ -1679,7 +1679,7 @@ pgstat_read_statsfile(XLogRecPtr redo) if (!kind_info->from_serialized_name) { - elog(WARNING, "invalid from_serialized_name in stats kind %d for entry of type %c", + elog(WARNING, "invalid from_serialized_name in stats kind %u for entry of type %c", kind, t); goto error; } @@ -1689,7 +1689,7 @@ pgstat_read_statsfile(XLogRecPtr redo) /* skip over data for entry we don't care about */ if (fseek(fpin, pgstat_get_entry_len(kind), SEEK_CUR) != 0) { - elog(WARNING, "could not seek \"%s\" of stats kind %d for entry of type %c", + elog(WARNING, "could not seek \"%s\" of stats kind %u for entry of type %c", NameStr(name), kind, t); goto error; } @@ -1711,7 +1711,7 @@ pgstat_read_statsfile(XLogRecPtr redo) if (found) { dshash_release_lock(pgStatLocal.shared_hash, p); - elog(WARNING, "found duplicate stats entry %d/%u/%u of type %c", + elog(WARNING, "found duplicate stats entry %u/%u/%u of type %c", key.kind, key.dboid, key.objoid, t); goto error; } @@ -1723,7 +1723,7 @@ pgstat_read_statsfile(XLogRecPtr redo) pgstat_get_entry_data(key.kind, header), pgstat_get_entry_len(key.kind))) { - elog(WARNING, "could not read data for entry %d/%u/%u of type %c", + elog(WARNING, "could not read data for entry %u/%u/%u of type %c", key.kind, key.dboid, key.objoid, t); goto error; } |