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

Commit 21b3aa9

Browse files
committed
Remove newly added useless assertion check
Coverity complained that my commit 80ba4bb added a dubious coding for a consistency check that there isn't more than one row for a certain tgrelid/tgparentid combination. But we don't check for that explicitly anywhere else, and if we were to do it, it should be a full shouldn't-happen elog not just an assert. It doesn't seem that this is very important anyway, so remove it. Discussion: https://postgr.es/m/1337562.1627224583@sss.pgh.pa.us
1 parent f68b609 commit 21b3aa9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/commands/trigger.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,6 @@ renametrig_partition(Relation tgrel, Oid partitionId, Oid parentTriggerOid,
16151615
SysScanDesc tgscan;
16161616
ScanKeyData key;
16171617
HeapTuple tuple;
1618-
int found PG_USED_FOR_ASSERTS_ONLY = 0;
16191618

16201619
/*
16211620
* Given a relation and the OID of a trigger on parent relation, find the
@@ -1636,8 +1635,6 @@ renametrig_partition(Relation tgrel, Oid partitionId, Oid parentTriggerOid,
16361635
if (tgform->tgparentid != parentTriggerOid)
16371636
continue; /* not our trigger */
16381637

1639-
Assert(found++ <= 0);
1640-
16411638
partitionRel = table_open(partitionId, NoLock);
16421639

16431640
/* Rename the trigger on this partition */
@@ -1658,6 +1655,9 @@ renametrig_partition(Relation tgrel, Oid partitionId, Oid parentTriggerOid,
16581655
}
16591656
}
16601657
table_close(partitionRel, NoLock);
1658+
1659+
/* There should be at most one matching tuple */
1660+
break;
16611661
}
16621662
systable_endscan(tgscan);
16631663
}

0 commit comments

Comments
 (0)