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

Commit8bb0c97

Browse files
committed
Try to avoid a compiler warning about using fxid uninitialized.
Mark Dilger, with a couple of stray semicolons removed by me.Discussion:http://postgr.es/m/2A7DA1A8-C4AA-43DF-A985-3CA52F4DC775@enterprisedb.com
1 parent94929f1 commit8bb0c97

File tree

1 file changed

+31
-36
lines changed

1 file changed

+31
-36
lines changed

‎contrib/amcheck/verify_heapam.c

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ check_tuple_header_and_visibilty(HeapTupleHeader tuphdr, HeapCheckContext *ctx)
555555
{
556556
uint16infomask=tuphdr->t_infomask;
557557
boolheader_garbled= false;
558-
unsignedexpected_hoff;;
558+
unsignedexpected_hoff;
559559

560560
if (ctx->tuphdr->t_hoff>ctx->lp_len)
561561
{
@@ -1368,60 +1368,55 @@ check_mxid_valid_in_rel(MultiXactId mxid, HeapCheckContext *ctx)
13681368
* truly been valid at that time.
13691369
*
13701370
* If the status argument is not NULL, and if and only if the transaction ID
1371-
* appears to be valid in this relation,clogwill beconsulted and the commit
1372-
*status argument will be set withthe status of the transaction ID.
1371+
* appears to be valid in this relation,the status argumentwill beset with
1372+
* the commit status of the transaction ID.
13731373
*/
13741374
staticXidBoundsViolation
13751375
get_xid_status(TransactionIdxid,HeapCheckContext*ctx,
13761376
XidCommitStatus*status)
13771377
{
1378-
XidBoundsViolationresult;
13791378
FullTransactionIdfxid;
13801379
FullTransactionIdclog_horizon;
13811380

13821381
/* Quick check for special xids */
13831382
if (!TransactionIdIsValid(xid))
1384-
result=XID_INVALID;
1383+
returnXID_INVALID;
13851384
elseif (xid==BootstrapTransactionId||xid==FrozenTransactionId)
1386-
result=XID_BOUNDS_OK;
1387-
else
13881385
{
1389-
/* Check if the xid is within bounds */
1390-
fxid=FullTransactionIdFromXidAndCtx(xid,ctx);
1391-
if (!fxid_in_cached_range(fxid,ctx))
1392-
{
1393-
/*
1394-
* We may have been checking against stale values. Update the
1395-
* cached range to be sure, and since we relied on the cached
1396-
* range when we performed the full xid conversion, reconvert.
1397-
*/
1398-
update_cached_xid_range(ctx);
1399-
fxid=FullTransactionIdFromXidAndCtx(xid,ctx);
1400-
}
1386+
if (status!=NULL)
1387+
*status=XID_COMMITTED;
1388+
returnXID_BOUNDS_OK;
1389+
}
14011390

1402-
if (FullTransactionIdPrecedesOrEquals(ctx->next_fxid,fxid))
1403-
result=XID_IN_FUTURE;
1404-
elseif (FullTransactionIdPrecedes(fxid,ctx->oldest_fxid))
1405-
result=XID_PRECEDES_CLUSTERMIN;
1406-
elseif (FullTransactionIdPrecedes(fxid,ctx->relfrozenfxid))
1407-
result=XID_PRECEDES_RELMIN;
1408-
else
1409-
result=XID_BOUNDS_OK;
1391+
/* Check if the xid is within bounds */
1392+
fxid=FullTransactionIdFromXidAndCtx(xid,ctx);
1393+
if (!fxid_in_cached_range(fxid,ctx))
1394+
{
1395+
/*
1396+
* We may have been checking against stale values. Update the
1397+
* cached range to be sure, and since we relied on the cached
1398+
* range when we performed the full xid conversion, reconvert.
1399+
*/
1400+
update_cached_xid_range(ctx);
1401+
fxid=FullTransactionIdFromXidAndCtx(xid,ctx);
14101402
}
14111403

1412-
/*
1413-
* Early return if the caller does not request clog checking, or if the
1414-
* xid is already known to be out of bounds. We dare not check clog for
1415-
* out of bounds transaction IDs.
1416-
*/
1417-
if (status==NULL||result!=XID_BOUNDS_OK)
1418-
returnresult;
1404+
if (FullTransactionIdPrecedesOrEquals(ctx->next_fxid,fxid))
1405+
returnXID_IN_FUTURE;
1406+
if (FullTransactionIdPrecedes(fxid,ctx->oldest_fxid))
1407+
returnXID_PRECEDES_CLUSTERMIN;
1408+
if (FullTransactionIdPrecedes(fxid,ctx->relfrozenfxid))
1409+
returnXID_PRECEDES_RELMIN;
1410+
1411+
/* Early return if the caller does not request clog checking */
1412+
if (status==NULL)
1413+
returnXID_BOUNDS_OK;
14191414

14201415
/* Early return if we just checked this xid in a prior call */
14211416
if (xid==ctx->cached_xid)
14221417
{
14231418
*status=ctx->cached_status;
1424-
returnresult;
1419+
returnXID_BOUNDS_OK;
14251420
}
14261421

14271422
*status=XID_COMMITTED;
@@ -1443,5 +1438,5 @@ get_xid_status(TransactionId xid, HeapCheckContext *ctx,
14431438
LWLockRelease(XactTruncationLock);
14441439
ctx->cached_xid=xid;
14451440
ctx->cached_status=*status;
1446-
returnresult;
1441+
returnXID_BOUNDS_OK;
14471442
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp