MPP-6923: */
| 274 | |
| 275 | /* MPP-6923: */ |
| 276 | static void |
| 277 | AlterResqueueCapabilityEntry(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), |
no test coverage detected