diff options
Diffstat (limited to 'src/backend/executor/spi.c')
-rw-r--r-- | src/backend/executor/spi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c index 7ba1fd90663..cfa4a24686f 100644 --- a/src/backend/executor/spi.c +++ b/src/backend/executor/spi.c @@ -2037,7 +2037,9 @@ _SPI_execute_plan(SPIPlanPtr plan, ParamListInfo paramLI, * Parameter datatypes are driven by parserSetup hook if provided, * otherwise we use the fixed parameter list. */ - if (plan->parserSetup != NULL) + if (parsetree == NULL) + stmt_list = NIL; + else if (plan->parserSetup != NULL) { Assert(plan->nargs == 0); stmt_list = pg_analyze_and_rewrite_params(parsetree, |