MCPcopy Create free account
hub / github.com/apache/cloudberry / ATGetQueueEntry

Function ATGetQueueEntry

src/backend/commands/tablecmds.c:7750–7781  ·  view source on GitHub ↗

* ATGetQueueEntry: find or create an entry in the ALTER TABLE work queue */

Source from the content-addressed store, hash-verified

7748 * ATGetQueueEntry: find or create an entry in the ALTER TABLE work queue
7749 */
7750static AlteredTableInfo *
7751ATGetQueueEntry(List **wqueue, Relation rel)
7752{
7753 Oid relid = RelationGetRelid(rel);
7754 AlteredTableInfo *tab;
7755 ListCell *ltab;
7756
7757 foreach(ltab, *wqueue)
7758 {
7759 tab = (AlteredTableInfo *) lfirst(ltab);
7760 if (tab->relid == relid)
7761 return tab;
7762 }
7763
7764 /*
7765 * Not there, so add it. Note that we make a copy of the relation's
7766 * existing descriptor before anything interesting can happen to it.
7767 */
7768 tab = makeNode(AlteredTableInfo);
7769 tab->relid = relid;
7770 tab->rel = NULL; /* set later */
7771 tab->relkind = rel->rd_rel->relkind;
7772 tab->oldDesc = CreateTupleDescCopyConstr(RelationGetDescr(rel));
7773 tab->newAccessMethod = InvalidOid;
7774 tab->newTableSpace = InvalidOid;
7775 tab->newrelpersistence = RELPERSISTENCE_PERMANENT;
7776 tab->chgPersistence = false;
7777
7778 *wqueue = lappend(*wqueue, tab);
7779
7780 return tab;
7781}
7782
7783/*
7784 * ATSimplePermissions

Callers 8

ATPrepCmdFunction · 0.85
ATExecAddColumnFunction · 0.85
ATAddCheckConstraintFunction · 0.85
addFkRecurseReferencingFunction · 0.85
ATExecValidateConstraintFunction · 0.85
ATPostAlterTypeParseFunction · 0.85

Calls 3

lappendFunction · 0.85
foreachFunction · 0.50

Tested by

no test coverage detected