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

Function AlterResqueueCapabilityEntry

src/backend/commands/queue.c:276–639  ·  view source on GitHub ↗

MPP-6923: */

Source from the content-addressed store, hash-verified

274
275/* MPP-6923: */
276static void
277AlterResqueueCapabilityEntry(Oid queueid,
278 List *list,
279 ListCell *initcell,
280 bool bCreate)
281{
282 ListCell *lc;
283 List *elems = NIL;
284 List *dropelems = NIL;
285 List *dupcheck = NIL;
286 HeapTuple tuple;
287 Relation rel = NULL;
288 bool bWithout = false;
289 TupleDesc tupdesc = NULL;
290
291#ifdef USE_ASSERT_CHECKING
292 {
293 DefElem *defel = (DefElem *) lfirst(initcell);
294 Assert(0 == strcmp(defel->defname, "withliststart"));
295 }
296#endif
297
298 initcell = lnext(list, initcell);
299
300 /* walk the original list and build a list of valid entries */
301
302 for_each_cell(lc, list, initcell)
303 {
304 DefElem *defel = (DefElem *) lfirst(lc);
305 Oid resTypeOid = InvalidOid;
306 int resTypeInt = 0;
307 List *pentry = NIL;
308 Value *pKeyVal = NULL;
309 Value *pStrVal = NULL;
310
311 if (!bWithout && (strcmp(defel->defname, "withoutliststart") == 0))
312 {
313 bWithout = true;
314
315 rel = heap_open(ResourceTypeRelationId, RowExclusiveLock);
316 tupdesc = RelationGetDescr(rel);
317
318 goto L_loop_cont;
319 }
320
321 /* ignore the basic threshold entries -- should already be processed */
322 if (strcmp(defel->defname, "active_statements") == 0)
323 goto L_loop_cont;
324 if (strcmp(defel->defname, "max_cost") == 0)
325 goto L_loop_cont;
326 if (strcmp(defel->defname, "cost_overcommit") == 0)
327 goto L_loop_cont;
328 if (strcmp(defel->defname, "min_cost") == 0)
329 goto L_loop_cont;
330
331 if (!GetResourceTypeByName(defel->defname, &resTypeInt, &resTypeOid))
332 ereport(ERROR,
333 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),

Callers 2

CreateQueueFunction · 0.85
AlterQueueFunction · 0.85

Calls 15

lnextFunction · 0.85
GetResourceTypeByNameFunction · 0.85
makeStringFunction · 0.85
defGetStringFunction · 0.85
ScanKeyInitFunction · 0.85
Int16GetDatumFunction · 0.85
systable_beginscanFunction · 0.85
systable_getnextFunction · 0.85
heap_getattrFunction · 0.85
systable_endscanFunction · 0.85
list_memberFunction · 0.85
lappendFunction · 0.85

Tested by

no test coverage detected