* Recognize one of the options that can be passed to both CREATE * FUNCTION and ALTER FUNCTION and return it via one of the out * parameters. Returns true if the passed option was recognized. If * the out parameter we were going to assign to points to non-NULL, * raise a duplicate-clause error. (We don't try to detect duplicate * SET parameters though --- if you're redundant, the last one wi
| 554 | * SET parameters though --- if you're redundant, the last one wins.) |
| 555 | */ |
| 556 | static bool |
| 557 | compute_common_attribute(ParseState *pstate, |
| 558 | bool is_procedure, |
| 559 | DefElem *defel, |
| 560 | DefElem **volatility_item, |
| 561 | DefElem **strict_item, |
| 562 | DefElem **security_item, |
| 563 | DefElem **leakproof_item, |
| 564 | List **set_items, |
| 565 | DefElem **cost_item, |
| 566 | DefElem **rows_item, |
| 567 | DefElem **support_item, |
| 568 | DefElem **parallel_item, |
| 569 | DefElem **describe_item, |
| 570 | DefElem **data_access_item, |
| 571 | DefElem **exec_location_item) |
| 572 | { |
| 573 | if (strcmp(defel->defname, "volatility") == 0) |
| 574 | { |
| 575 | if (is_procedure) |
| 576 | goto procedure_error; |
| 577 | if (*volatility_item) |
| 578 | goto duplicate_error; |
| 579 | |
| 580 | *volatility_item = defel; |
| 581 | } |
| 582 | else if (strcmp(defel->defname, "strict") == 0) |
| 583 | { |
| 584 | if (is_procedure) |
| 585 | goto procedure_error; |
| 586 | if (*strict_item) |
| 587 | goto duplicate_error; |
| 588 | |
| 589 | *strict_item = defel; |
| 590 | } |
| 591 | else if (strcmp(defel->defname, "security") == 0) |
| 592 | { |
| 593 | if (*security_item) |
| 594 | goto duplicate_error; |
| 595 | |
| 596 | *security_item = defel; |
| 597 | } |
| 598 | else if (strcmp(defel->defname, "leakproof") == 0) |
| 599 | { |
| 600 | if (is_procedure) |
| 601 | goto procedure_error; |
| 602 | if (*leakproof_item) |
| 603 | goto duplicate_error; |
| 604 | |
| 605 | *leakproof_item = defel; |
| 606 | } |
| 607 | else if (strcmp(defel->defname, "set") == 0) |
| 608 | { |
| 609 | *set_items = lappend(*set_items, defel->arg); |
| 610 | } |
| 611 | else if (strcmp(defel->defname, "cost") == 0) |
| 612 | { |
| 613 | if (is_procedure) |
no test coverage detected