When I used SPI_execute_plan function on PG12 which commit 41c6a5be is used, Segment fault occurred.
PS: If commit 41c6a5be is not used, this phenomenon will not happen.
Reproduce: In a background process, the following steps are executed. -------------------------- StartTransactionCommand(); SPI_connect(); plan = SPI_prepare(query,0,NULL); ★the query is a SELECT SQL. SPI_keepplan(plan); SPI_finish(); CommitTransactionCommand(); StartTransactionCommand(); SPI_connect(); SPI_execute_plan(plan, NULL, NULL, true, 0); ★Segment fault --------------------------