Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5f7eef4

Browse files
author
Commitfest Bot
committed
[CF 5429] v2 - Adopt <inttypes.h> macros in format strings.
This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/5429 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/CA+hUKGLDnhaYB6aCXr3z=K6sU85S9OR7d2bUXZWpy_=yJebUyg@mail.gmail.com Author(s): Thomas Munro
2 parents e033696 + d030270 commit 5f7eef4

File tree

135 files changed

+1467
-1541
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+1467
-1541
lines changed

contrib/amcheck/verify_nbtree.c

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,9 +1037,9 @@ bt_report_duplicate(BtreeCheckState *state,
10371037
(errcode(ERRCODE_INDEX_CORRUPTED),
10381038
errmsg("index uniqueness is violated for index \"%s\"",
10391039
RelationGetRelationName(state->rel)),
1040-
errdetail("Index %s%s and%s%s (point to heap %s and %s) page lsn=%X/%X.",
1040+
errdetail("Index %s%s and%s%s (point to heap %s and %s) page lsn=%016" PRIX64 ".",
10411041
itid, pposting, nitid, pnposting, htid, nhtid,
1042-
LSN_FORMAT_ARGS(state->targetlsn))));
1042+
state->targetlsn)));
10431043
}
10441044

10451045
/* Check if current nbtree leaf entry complies with UNIQUE constraint */
@@ -1182,9 +1182,9 @@ bt_leftmost_ignoring_half_dead(BtreeCheckState *state,
11821182
(errcode(ERRCODE_NO_DATA),
11831183
errmsg_internal("harmless interrupted page deletion detected in index \"%s\"",
11841184
RelationGetRelationName(state->rel)),
1185-
errdetail_internal("Block=%u right block=%u page lsn=%X/%X.",
1185+
errdetail_internal("Block=%u right block=%u page lsn=%016" PRIX64 ".",
11861186
reached, reached_from,
1187-
LSN_FORMAT_ARGS(pagelsn))));
1187+
pagelsn)));
11881188

11891189
reached_from = reached;
11901190
reached = reached_opaque->btpo_prev;
@@ -1407,11 +1407,11 @@ bt_target_page_check(BtreeCheckState *state)
14071407
(errcode(ERRCODE_INDEX_CORRUPTED),
14081408
errmsg("wrong number of high key index tuple attributes in index \"%s\"",
14091409
RelationGetRelationName(state->rel)),
1410-
errdetail_internal("Index block=%u natts=%u block type=%s page lsn=%X/%X.",
1410+
errdetail_internal("Index block=%u natts=%u block type=%s page lsn=%016" PRIX64 ".",
14111411
state->targetblock,
14121412
BTreeTupleGetNAtts(itup, state->rel),
14131413
P_ISLEAF(topaque) ? "heap" : "index",
1414-
LSN_FORMAT_ARGS(state->targetlsn))));
1414+
state->targetlsn)));
14151415
}
14161416
}
14171417

@@ -1456,10 +1456,10 @@ bt_target_page_check(BtreeCheckState *state)
14561456
(errcode(ERRCODE_INDEX_CORRUPTED),
14571457
errmsg("index tuple size does not equal lp_len in index \"%s\"",
14581458
RelationGetRelationName(state->rel)),
1459-
errdetail_internal("Index tid=(%u,%u) tuple size=%zu lp_len=%u page lsn=%X/%X.",
1459+
errdetail_internal("Index tid=(%u,%u) tuple size=%zu lp_len=%u page lsn=%016" PRIX64 ".",
14601460
state->targetblock, offset,
14611461
tupsize, ItemIdGetLength(itemid),
1462-
LSN_FORMAT_ARGS(state->targetlsn)),
1462+
state->targetlsn),
14631463
errhint("This could be a torn page problem.")));
14641464

14651465
/* Check the number of index tuple attributes */
@@ -1480,12 +1480,12 @@ bt_target_page_check(BtreeCheckState *state)
14801480
(errcode(ERRCODE_INDEX_CORRUPTED),
14811481
errmsg("wrong number of index tuple attributes in index \"%s\"",
14821482
RelationGetRelationName(state->rel)),
1483-
errdetail_internal("Index tid=%s natts=%u points to %s tid=%s page lsn=%X/%X.",
1483+
errdetail_internal("Index tid=%s natts=%u points to %s tid=%s page lsn=%016" PRIX64 ".",
14841484
itid,
14851485
BTreeTupleGetNAtts(itup, state->rel),
14861486
P_ISLEAF(topaque) ? "heap" : "index",
14871487
htid,
1488-
LSN_FORMAT_ARGS(state->targetlsn))));
1488+
state->targetlsn)));
14891489
}
14901490

14911491
/*
@@ -1530,9 +1530,9 @@ bt_target_page_check(BtreeCheckState *state)
15301530
(errcode(ERRCODE_INDEX_CORRUPTED),
15311531
errmsg("could not find tuple using search from root page in index \"%s\"",
15321532
RelationGetRelationName(state->rel)),
1533-
errdetail_internal("Index tid=%s points to heap tid=%s page lsn=%X/%X.",
1533+
errdetail_internal("Index tid=%s points to heap tid=%s page lsn=%016" PRIX64 ".",
15341534
itid, htid,
1535-
LSN_FORMAT_ARGS(state->targetlsn))));
1535+
state->targetlsn)));
15361536
}
15371537

15381538
/*
@@ -1559,9 +1559,9 @@ bt_target_page_check(BtreeCheckState *state)
15591559
(errcode(ERRCODE_INDEX_CORRUPTED),
15601560
errmsg_internal("posting list contains misplaced TID in index \"%s\"",
15611561
RelationGetRelationName(state->rel)),
1562-
errdetail_internal("Index tid=%s posting list offset=%d page lsn=%X/%X.",
1562+
errdetail_internal("Index tid=%s posting list offset=%d page lsn=%016" PRIX64 ".",
15631563
itid, i,
1564-
LSN_FORMAT_ARGS(state->targetlsn))));
1564+
state->targetlsn)));
15651565
}
15661566

15671567
ItemPointerCopy(current, &last);
@@ -1613,11 +1613,11 @@ bt_target_page_check(BtreeCheckState *state)
16131613
(errcode(ERRCODE_INDEX_CORRUPTED),
16141614
errmsg("index row size %zu exceeds maximum for index \"%s\"",
16151615
tupsize, RelationGetRelationName(state->rel)),
1616-
errdetail_internal("Index tid=%s points to %s tid=%s page lsn=%X/%X.",
1616+
errdetail_internal("Index tid=%s points to %s tid=%s page lsn=%016" PRIX64 ".",
16171617
itid,
16181618
P_ISLEAF(topaque) ? "heap" : "index",
16191619
htid,
1620-
LSN_FORMAT_ARGS(state->targetlsn))));
1620+
state->targetlsn)));
16211621
}
16221622

16231623
/* Fingerprint leaf page tuples (those that point to the heap) */
@@ -1720,11 +1720,11 @@ bt_target_page_check(BtreeCheckState *state)
17201720
(errcode(ERRCODE_INDEX_CORRUPTED),
17211721
errmsg("high key invariant violated for index \"%s\"",
17221722
RelationGetRelationName(state->rel)),
1723-
errdetail_internal("Index tid=%s points to %s tid=%s page lsn=%X/%X.",
1723+
errdetail_internal("Index tid=%s points to %s tid=%s page lsn=%016" PRIX64 ".",
17241724
itid,
17251725
P_ISLEAF(topaque) ? "heap" : "index",
17261726
htid,
1727-
LSN_FORMAT_ARGS(state->targetlsn))));
1727+
state->targetlsn)));
17281728
}
17291729
/* Reset, in case scantid was set to (itup) posting tuple's max TID */
17301730
skey->scantid = scantid;
@@ -1768,14 +1768,14 @@ bt_target_page_check(BtreeCheckState *state)
17681768
RelationGetRelationName(state->rel)),
17691769
errdetail_internal("Lower index tid=%s (points to %s tid=%s) "
17701770
"higher index tid=%s (points to %s tid=%s) "
1771-
"page lsn=%X/%X.",
1771+
"page lsn=%016" PRIX64 ".",
17721772
itid,
17731773
P_ISLEAF(topaque) ? "heap" : "index",
17741774
htid,
17751775
nitid,
17761776
P_ISLEAF(topaque) ? "heap" : "index",
17771777
nhtid,
1778-
LSN_FORMAT_ARGS(state->targetlsn))));
1778+
state->targetlsn)));
17791779
}
17801780

17811781
/*
@@ -1885,9 +1885,9 @@ bt_target_page_check(BtreeCheckState *state)
18851885
(errcode(ERRCODE_INDEX_CORRUPTED),
18861886
errmsg("cross page item order invariant violated for index \"%s\"",
18871887
RelationGetRelationName(state->rel)),
1888-
errdetail_internal("Last item on page tid=(%u,%u) page lsn=%X/%X.",
1888+
errdetail_internal("Last item on page tid=(%u,%u) page lsn=%016" PRIX64 ".",
18891889
state->targetblock, offset,
1890-
LSN_FORMAT_ARGS(state->targetlsn))));
1890+
state->targetlsn)));
18911891
}
18921892

18931893
/*
@@ -1938,9 +1938,9 @@ bt_target_page_check(BtreeCheckState *state)
19381938
(errcode(ERRCODE_INDEX_CORRUPTED),
19391939
errmsg("right block of leaf block is non-leaf for index \"%s\"",
19401940
RelationGetRelationName(state->rel)),
1941-
errdetail_internal("Block=%u page lsn=%X/%X.",
1941+
errdetail_internal("Block=%u page lsn=%016" PRIX64 ".",
19421942
state->targetblock,
1943-
LSN_FORMAT_ARGS(state->targetlsn))));
1943+
state->targetlsn)));
19441944

19451945
itemid = PageGetItemIdCareful(state, rightblock_number,
19461946
rightpage,
@@ -2362,9 +2362,9 @@ bt_child_highkey_check(BtreeCheckState *state,
23622362
(errcode(ERRCODE_INDEX_CORRUPTED),
23632363
errmsg("the first child of leftmost target page is not leftmost of its level in index \"%s\"",
23642364
RelationGetRelationName(state->rel)),
2365-
errdetail_internal("Target block=%u child block=%u target page lsn=%X/%X.",
2365+
errdetail_internal("Target block=%u child block=%u target page lsn=%016" PRIX64 ".",
23662366
state->targetblock, blkno,
2367-
LSN_FORMAT_ARGS(state->targetlsn))));
2367+
state->targetlsn)));
23682368

23692369
/* Do level sanity check */
23702370
if ((!P_ISDELETED(opaque) || P_HAS_FULLXID(opaque)) &&
@@ -2448,9 +2448,9 @@ bt_child_highkey_check(BtreeCheckState *state,
24482448
(errcode(ERRCODE_INDEX_CORRUPTED),
24492449
errmsg("child high key is greater than rightmost pivot key on target level in index \"%s\"",
24502450
RelationGetRelationName(state->rel)),
2451-
errdetail_internal("Target block=%u child block=%u target page lsn=%X/%X.",
2451+
errdetail_internal("Target block=%u child block=%u target page lsn=%016" PRIX64 ".",
24522452
state->targetblock, blkno,
2453-
LSN_FORMAT_ARGS(state->targetlsn))));
2453+
state->targetlsn)));
24542454
pivotkey_offset = P_HIKEY;
24552455
}
24562456
itemid = PageGetItemIdCareful(state, state->targetblock,
@@ -2478,9 +2478,9 @@ bt_child_highkey_check(BtreeCheckState *state,
24782478
(errcode(ERRCODE_INDEX_CORRUPTED),
24792479
errmsg("can't find left sibling high key in index \"%s\"",
24802480
RelationGetRelationName(state->rel)),
2481-
errdetail_internal("Target block=%u child block=%u target page lsn=%X/%X.",
2481+
errdetail_internal("Target block=%u child block=%u target page lsn=%016" PRIX64 ".",
24822482
state->targetblock, blkno,
2483-
LSN_FORMAT_ARGS(state->targetlsn))));
2483+
state->targetlsn)));
24842484
itup = state->lowkey;
24852485
}
24862486

@@ -2490,9 +2490,9 @@ bt_child_highkey_check(BtreeCheckState *state,
24902490
(errcode(ERRCODE_INDEX_CORRUPTED),
24912491
errmsg("mismatch between parent key and child high key in index \"%s\"",
24922492
RelationGetRelationName(state->rel)),
2493-
errdetail_internal("Target block=%u child block=%u target page lsn=%X/%X.",
2493+
errdetail_internal("Target block=%u child block=%u target page lsn=%016" PRIX64 ".",
24942494
state->targetblock, blkno,
2495-
LSN_FORMAT_ARGS(state->targetlsn))));
2495+
state->targetlsn)));
24962496
}
24972497
}
24982498

@@ -2630,9 +2630,9 @@ bt_child_check(BtreeCheckState *state, BTScanInsert targetkey,
26302630
(errcode(ERRCODE_INDEX_CORRUPTED),
26312631
errmsg("downlink to deleted page found in index \"%s\"",
26322632
RelationGetRelationName(state->rel)),
2633-
errdetail_internal("Parent block=%u child block=%u parent page lsn=%X/%X.",
2633+
errdetail_internal("Parent block=%u child block=%u parent page lsn=%016" PRIX64 ".",
26342634
state->targetblock, childblock,
2635-
LSN_FORMAT_ARGS(state->targetlsn))));
2635+
state->targetlsn)));
26362636

26372637
for (offset = P_FIRSTDATAKEY(copaque);
26382638
offset <= maxoffset;
@@ -2671,9 +2671,9 @@ bt_child_check(BtreeCheckState *state, BTScanInsert targetkey,
26712671
(errcode(ERRCODE_INDEX_CORRUPTED),
26722672
errmsg("down-link lower bound invariant violated for index \"%s\"",
26732673
RelationGetRelationName(state->rel)),
2674-
errdetail_internal("Parent block=%u child index tid=(%u,%u) parent page lsn=%X/%X.",
2674+
errdetail_internal("Parent block=%u child index tid=(%u,%u) parent page lsn=%016" PRIX64 ".",
26752675
state->targetblock, childblock, offset,
2676-
LSN_FORMAT_ARGS(state->targetlsn))));
2676+
state->targetlsn)));
26772677
}
26782678

26792679
pfree(child);
@@ -2741,10 +2741,10 @@ bt_downlink_missing_check(BtreeCheckState *state, bool rightsplit,
27412741
(errcode(ERRCODE_NO_DATA),
27422742
errmsg_internal("harmless interrupted page split detected in index \"%s\"",
27432743
RelationGetRelationName(state->rel)),
2744-
errdetail_internal("Block=%u level=%u left sibling=%u page lsn=%X/%X.",
2744+
errdetail_internal("Block=%u level=%u left sibling=%u page lsn=%016" PRIX64 ".",
27452745
blkno, opaque->btpo_level,
27462746
opaque->btpo_prev,
2747-
LSN_FORMAT_ARGS(pagelsn))));
2747+
pagelsn)));
27482748
return;
27492749
}
27502750

@@ -2763,9 +2763,9 @@ bt_downlink_missing_check(BtreeCheckState *state, bool rightsplit,
27632763
(errcode(ERRCODE_INDEX_CORRUPTED),
27642764
errmsg("leaf index block lacks downlink in index \"%s\"",
27652765
RelationGetRelationName(state->rel)),
2766-
errdetail_internal("Block=%u page lsn=%X/%X.",
2766+
errdetail_internal("Block=%u page lsn=%016" PRIX64 ".",
27672767
blkno,
2768-
LSN_FORMAT_ARGS(pagelsn))));
2768+
pagelsn)));
27692769

27702770
/* Descend from the given page, which is an internal page */
27712771
elog(DEBUG1, "checking for interrupted multi-level deletion due to missing downlink in index \"%s\"",
@@ -2829,9 +2829,9 @@ bt_downlink_missing_check(BtreeCheckState *state, bool rightsplit,
28292829
(errcode(ERRCODE_INDEX_CORRUPTED),
28302830
errmsg_internal("downlink to deleted leaf page found in index \"%s\"",
28312831
RelationGetRelationName(state->rel)),
2832-
errdetail_internal("Top parent/target block=%u leaf block=%u top parent/under check lsn=%X/%X.",
2832+
errdetail_internal("Top parent/target block=%u leaf block=%u top parent/under check lsn=%016" PRIX64 ".",
28332833
blkno, childblk,
2834-
LSN_FORMAT_ARGS(pagelsn))));
2834+
pagelsn)));
28352835

28362836
/*
28372837
* Iff leaf page is half-dead, its high key top parent link should point
@@ -2855,9 +2855,9 @@ bt_downlink_missing_check(BtreeCheckState *state, bool rightsplit,
28552855
(errcode(ERRCODE_INDEX_CORRUPTED),
28562856
errmsg("internal index block lacks downlink in index \"%s\"",
28572857
RelationGetRelationName(state->rel)),
2858-
errdetail_internal("Block=%u level=%u page lsn=%X/%X.",
2858+
errdetail_internal("Block=%u level=%u page lsn=%016" PRIX64 ".",
28592859
blkno, opaque->btpo_level,
2860-
LSN_FORMAT_ARGS(pagelsn))));
2860+
pagelsn)));
28612861
}
28622862

28632863
/*

contrib/file_fdw/file_fdw.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -794,8 +794,8 @@ fileIterateForeignScan(ForeignScanState *node)
794794
cstate->num_errors > cstate->opts.reject_limit)
795795
ereport(ERROR,
796796
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
797-
errmsg("skipped more than REJECT_LIMIT (%lld) rows due to data type incompatibility",
798-
(long long) cstate->opts.reject_limit)));
797+
errmsg("skipped more than REJECT_LIMIT (%" PRId64 ") rows due to data type incompatibility",
798+
cstate->opts.reject_limit)));
799799

800800
/* Repeat NextCopyFrom() until no soft error occurs */
801801
goto retry;
@@ -851,10 +851,10 @@ fileEndForeignScan(ForeignScanState *node)
851851
festate->cstate->num_errors > 0 &&
852852
festate->cstate->opts.log_verbosity >= COPY_LOG_VERBOSITY_DEFAULT)
853853
ereport(NOTICE,
854-
errmsg_plural("%llu row was skipped due to data type incompatibility",
855-
"%llu rows were skipped due to data type incompatibility",
856-
(unsigned long long) festate->cstate->num_errors,
857-
(unsigned long long) festate->cstate->num_errors));
854+
errmsg_plural("%" PRIu64 " row was skipped due to data type incompatibility",
855+
"%" PRIu64 " rows were skipped due to data type incompatibility",
856+
festate->cstate->num_errors,
857+
festate->cstate->num_errors));
858858

859859
EndCopyFrom(festate->cstate);
860860
}
@@ -1315,10 +1315,10 @@ file_acquire_sample_rows(Relation onerel, int elevel,
13151315
cstate->num_errors > 0 &&
13161316
cstate->opts.log_verbosity >= COPY_LOG_VERBOSITY_DEFAULT)
13171317
ereport(NOTICE,
1318-
errmsg_plural("%llu row was skipped due to data type incompatibility",
1319-
"%llu rows were skipped due to data type incompatibility",
1320-
(unsigned long long) cstate->num_errors,
1321-
(unsigned long long) cstate->num_errors));
1318+
errmsg_plural("%" PRIu64 " row was skipped due to data type incompatibility",
1319+
"%" PRIu64 " rows were skipped due to data type incompatibility",
1320+
cstate->num_errors,
1321+
cstate->num_errors));
13221322

13231323
EndCopyFrom(cstate);
13241324

contrib/pageinspect/btreefuncs.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,12 @@ check_relation_block_range(Relation rel, int64 blkno)
206206
if (blkno < 0 || blkno > MaxBlockNumber)
207207
ereport(ERROR,
208208
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
209-
errmsg("invalid block number %lld",
210-
(long long) blkno)));
209+
errmsg("invalid block number %" PRId64, blkno)));
211210

212211
if ((BlockNumber) (blkno) >= RelationGetNumberOfBlocks(rel))
213212
ereport(ERROR,
214213
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
215-
errmsg("block number %lld is out of range",
216-
(long long) blkno)));
214+
errmsg("block number %" PRId64 " is out of range", blkno)));
217215
}
218216

219217
/* -----------------------------------------------

contrib/pageinspect/expected/gist.out

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ CREATE UNLOGGED TABLE test_gist AS SELECT point(i,i) p, i::text t FROM
55
CREATE INDEX test_gist_idx ON test_gist USING gist (p);
66
-- Page 0 is the root, the rest are leaf pages
77
SELECT * FROM gist_page_opaque_info(get_raw_page('test_gist_idx', 0));
8-
lsn | nsn | rightlink | flags
9-
-----+-----+------------+-------
10-
0/1 | 0/0 | 4294967295 | {}
8+
lsn | nsn | rightlink | flags
9+
------------------+------------------+------------+-------
10+
0000000000000001 | 0000000000000000 | 4294967295 | {}
1111
(1 row)
1212

1313
SELECT * FROM gist_page_opaque_info(get_raw_page('test_gist_idx', 1));
14-
lsn | nsn | rightlink | flags
15-
-----+-----+------------+--------
16-
0/1 | 0/0 | 4294967295 | {leaf}
14+
lsn | nsn | rightlink | flags
15+
------------------+------------------+------------+--------
16+
0000000000000001 | 0000000000000000 | 4294967295 | {leaf}
1717
(1 row)
1818

1919
SELECT * FROM gist_page_opaque_info(get_raw_page('test_gist_idx', 2));
20-
lsn | nsn | rightlink | flags
21-
-----+-----+-----------+--------
22-
0/1 | 0/0 | 1 | {leaf}
20+
lsn | nsn | rightlink | flags
21+
------------------+------------------+-----------+--------
22+
0000000000000001 | 0000000000000000 | 1 | {leaf}
2323
(1 row)
2424

2525
SELECT * FROM gist_page_items(get_raw_page('test_gist_idx', 0), 'test_gist_idx');

contrib/pageinspect/expected/page.out

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,9 @@ SELECT fsm_page_contents(decode(repeat('00', :block_size), 'hex'));
265265
(1 row)
266266

267267
SELECT page_header(decode(repeat('00', :block_size), 'hex'));
268-
page_header
269-
-----------------------
270-
(0/0,0,0,0,0,0,0,0,0)
268+
page_header
269+
------------------------------------
270+
(0000000000000000,0,0,0,0,0,0,0,0)
271271
(1 row)
272272

273273
SELECT page_checksum(decode(repeat('00', :block_size), 'hex'), 1);

contrib/pageinspect/hashfuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,8 @@ hash_bitmap_info(PG_FUNCTION_ARGS)
436436
if (ovflblkno >= RelationGetNumberOfBlocks(indexRel))
437437
ereport(ERROR,
438438
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
439-
errmsg("block number %lld is out of range for relation \"%s\"",
440-
(long long int) ovflblkno, RelationGetRelationName(indexRel))));
439+
errmsg("block number %" PRId64 " is out of range for relation \"%s\"",
440+
ovflblkno, RelationGetRelationName(indexRel))));
441441

442442
/* Read the metapage so we can determine which bitmap page to use */
443443
metabuf = _hash_getbuf(indexRel, HASH_METAPAGE, HASH_READ, LH_META_PAGE);

0 commit comments

Comments
 (0)