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

Commitadd3e9c

Browse files
committed
remove dead code & fix logic in get_pathman_relation_info()
1 parent2133015 commitadd3e9c

File tree

1 file changed

+11
-20
lines changed

1 file changed

+11
-20
lines changed

‎src/relation_info.c‎

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,6 @@ PartRelationInfo *
322322
get_pathman_relation_info(Oidrelid)
323323
{
324324
PartStatusInfo*psin;
325-
boolrefresh;
326325

327326
/* Should always be called in transaction */
328327
Assert(IsTransactionState());
@@ -331,24 +330,18 @@ get_pathman_relation_info(Oid relid)
331330
if (relid<FirstNormalObjectId)
332331
returnNULL;
333332

334-
/*Create a new entry for thistable if needed */
333+
/*Do we know anything about thisrelation? */
335334
psin=pathman_cache_search_relid(status_cache,
336335
relid,HASH_FIND,
337336
NULL);
338337

339-
/* Should we build a new PartRelationInfo? */
340-
refresh=psin ?
341-
(psin->prel&&
342-
!PrelIsFresh(psin->prel)&&
343-
PrelReferenceCount(psin->prel)==0) :
344-
true;
345-
346-
if (refresh)
338+
if (!psin)
347339
{
348340
PartRelationInfo*prel=NULL;
349341
ItemPointerDataiptr;
350342
Datumvalues[Natts_pathman_config];
351343
boolisnull[Natts_pathman_config];
344+
boolfound;
352345

353346
/* Check if PATHMAN_CONFIG table contains this relation */
354347
if (pathman_config_contains_relation(relid,values,isnull,NULL,&iptr))
@@ -364,21 +357,19 @@ get_pathman_relation_info(Oid relid)
364357
prel=build_pathman_relation_info(relid,values);
365358
}
366359

367-
/* Create a new entry for this table if needed */
368-
if (!psin)
369-
{
370-
boolfound;
371-
372-
psin=pathman_cache_search_relid(status_cache,
373-
relid,HASH_ENTER,
374-
&found);
375-
Assert(!found);
376-
}
360+
/* Create a new entry for this relation */
361+
psin=pathman_cache_search_relid(status_cache,
362+
relid,HASH_ENTER,
363+
&found);
364+
Assert(!found);/* it shouldn't just appear out of thin air */
377365

378366
/* Cache fresh entry */
379367
psin->prel=prel;
380368
}
381369

370+
/* Check invariants */
371+
Assert(!psin->prel||PrelIsFresh(psin->prel));
372+
382373
#ifdefUSE_RELINFO_LOGGING
383374
elog(DEBUG2,
384375
"fetching %s record for parent %u [%u]",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp