Re: Segment fault when excuting SPI function On PG with commit 41c6a5be
Вложения
В списке pgsql-hackers по дате отправления:
| От | Michael Paquier |
|---|---|
| Тема | Re: Segment fault when excuting SPI function On PG with commit 41c6a5be |
| Дата | |
| Msg-id | YQPyqYrMy/6JTAKa@paquier.xyz обсуждение исходный текст |
| Ответ на | Segment fault when excuting SPI function On PG with commit 41c6a5be ("liuhuailing@fujitsu.com" <liuhuailing@fujitsu.com>) |
| Ответы |
Re: Segment fault when excuting SPI function On PG with commit 41c6a5be
|
| Список | pgsql-hackers |
On Fri, Jul 30, 2021 at 08:57:35AM +0000, liuhuailing@fujitsu.com wrote: > 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. I see nothing wrong in this commit, FWIW. > 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 > -------------------------- But I see an issue with your code. It seems to me that you should push a snapshot before doing SPI_prepare() and SPI_execute_plan(), as of: PushActiveSnapshot(GetTransactionSnapshot()); -- Michael
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера