Execute a previously prepared plan */
| 758 | |
| 759 | /* Execute a previously prepared plan */ |
| 760 | int |
| 761 | SPI_execute_plan_with_paramlist(SPIPlanPtr plan, ParamListInfo params, |
| 762 | bool read_only, long tcount) |
| 763 | { |
| 764 | SPIExecuteOptions options; |
| 765 | int res; |
| 766 | |
| 767 | if (plan == NULL || plan->magic != _SPI_PLAN_MAGIC || tcount < 0) |
| 768 | return SPI_ERROR_ARGUMENT; |
| 769 | |
| 770 | res = _SPI_begin_call(true); |
| 771 | if (res < 0) |
| 772 | return res; |
| 773 | |
| 774 | memset(&options, 0, sizeof(options)); |
| 775 | options.params = params; |
| 776 | options.read_only = read_only; |
| 777 | options.tcount = tcount; |
| 778 | |
| 779 | res = _SPI_execute_plan(plan, &options, |
| 780 | InvalidSnapshot, InvalidSnapshot, |
| 781 | true); |
| 782 | |
| 783 | _SPI_end_call(true); |
| 784 | return res; |
| 785 | } |
| 786 | |
| 787 | /* |
| 788 | * SPI_execute_snapshot -- identical to SPI_execute_plan, except that we allow |
no test coverage detected