* ProcessUtility * general utility function invoker * * pstmt: PlannedStmt wrapper for the utility statement * queryString: original source text of command * readOnlyTree: if true, pstmt's node tree must not be modified * context: identifies source of statement (toplevel client command, * non-toplevel client command, subcommand of a larger utility command) * params: parameters to use dur
| 567 | * and stmt_len that were given for the whole statement. |
| 568 | */ |
| 569 | void |
| 570 | ProcessUtility(PlannedStmt *pstmt, |
| 571 | const char *queryString, |
| 572 | bool readOnlyTree, |
| 573 | ProcessUtilityContext context, |
| 574 | ParamListInfo params, |
| 575 | QueryEnvironment *queryEnv, |
| 576 | DestReceiver *dest, |
| 577 | QueryCompletion *qc) |
| 578 | { |
| 579 | Assert(IsA(pstmt, PlannedStmt)); |
| 580 | Assert(pstmt->commandType == CMD_UTILITY); |
| 581 | Assert(queryString != NULL); /* required as of 8.4 */ |
| 582 | Assert(qc == NULL || qc->commandTag == CMDTAG_UNKNOWN); |
| 583 | |
| 584 | /* |
| 585 | * Greenplum specific code: |
| 586 | * Please refer to the comments at the definition of process_utility_nesting_level. |
| 587 | */ |
| 588 | process_utility_nesting_level++; |
| 589 | PG_TRY(); |
| 590 | { |
| 591 | /* |
| 592 | * We provide a function hook variable that lets loadable plugins get |
| 593 | * control when ProcessUtility is called. Such a plugin would normally |
| 594 | * call standard_ProcessUtility(). |
| 595 | */ |
| 596 | if (ProcessUtility_hook) |
| 597 | (*ProcessUtility_hook) (pstmt, queryString, readOnlyTree, |
| 598 | context, params, queryEnv, |
| 599 | dest, qc); |
| 600 | else |
| 601 | standard_ProcessUtility(pstmt, queryString, readOnlyTree, |
| 602 | context, params, queryEnv, |
| 603 | dest, qc); |
| 604 | process_utility_nesting_level--; |
| 605 | } |
| 606 | PG_CATCH(); |
| 607 | { |
| 608 | process_utility_nesting_level--; |
| 609 | PG_RE_THROW(); |
| 610 | } |
| 611 | PG_END_TRY(); |
| 612 | } |
| 613 | |
| 614 | /* |
| 615 | * standard_ProcessUtility itself deals only with utility commands for |
no test coverage detected