| От | Tom Lane |
|---|---|
| Тема | Re: Problem with Numerics multiplication in C-function |
| Дата | |
| Msg-id | 16363.1249309236@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Problem with Numerics multiplication in C-function (Martijn van Oosterhout <kleptog@svana.org>) |
| Ответы |
Re: Problem with Numerics multiplication in C-function
|
| Список | pgsql-general |
Martijn van Oosterhout <kleptog@svana.org> writes:
> What you need to do is copy the Datum you wish to return into the upper
> memory context. I'm not seeing a helpful SPI utility function or
> obvious example here you help you, but I'm sure it's something with
> MemoryContextSwitchTo() and datumCopy().
SPI_palloc is what to use to allocate the result in the right place.
My guess is that the reason the function appeared to work (most of the
time) before is that it wasn't being tested in an assert-enabled build.
CLOBBER_FREED_MEMORY is exposing the mistake.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера