| 927 | } |
| 928 | |
| 929 | SPIPlanPtr |
| 930 | SPI_prepare_extended(const char *src, |
| 931 | const SPIPrepareOptions *options) |
| 932 | { |
| 933 | _SPI_plan plan; |
| 934 | SPIPlanPtr result; |
| 935 | |
| 936 | if (src == NULL || options == NULL) |
| 937 | { |
| 938 | SPI_result = SPI_ERROR_ARGUMENT; |
| 939 | return NULL; |
| 940 | } |
| 941 | |
| 942 | SPI_result = _SPI_begin_call(true); |
| 943 | if (SPI_result < 0) |
| 944 | return NULL; |
| 945 | |
| 946 | memset(&plan, 0, sizeof(_SPI_plan)); |
| 947 | plan.magic = _SPI_PLAN_MAGIC; |
| 948 | plan.parse_mode = options->parseMode; |
| 949 | plan.cursor_options = options->cursorOptions; |
| 950 | plan.nargs = 0; |
| 951 | plan.argtypes = NULL; |
| 952 | plan.parserSetup = options->parserSetup; |
| 953 | plan.parserSetupArg = options->parserSetupArg; |
| 954 | |
| 955 | _SPI_prepare_plan(src, &plan); |
| 956 | |
| 957 | /* copy plan to procedure context */ |
| 958 | result = _SPI_make_plan_non_temp(&plan); |
| 959 | |
| 960 | _SPI_end_call(true); |
| 961 | |
| 962 | return result; |
| 963 | } |
| 964 | |
| 965 | SPIPlanPtr |
| 966 | SPI_prepare_params(const char *src, |
no test coverage detected