Fix incorrect format placeholders in pgstat.c
authorMichael Paquier <[email protected]>
Sat, 3 Aug 2024 18:07:20 +0000 (03:07 +0900)
committerMichael Paquier <[email protected]>
Sat, 3 Aug 2024 18:07:20 +0000 (03:07 +0900)
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.

src/backend/utils/activity/pgstat.c

index 143478aca0f0cff558bea96ad27321f281aa36b8..2e13670fc1f4955ae996c1e4dd21d75807e0c0fa 100644 (file)
@@ -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;
                    }