Re: plperl and inline functions -- first draft
Andrew Dunstan <andrew@dunslane.net>
From: Andrew Dunstan <andrew@dunslane.net>
To: Joshua Tolley <eggyknap@gmail.com>
Cc: Alexey Klyukin <alexk@waki.ru>, pgsql-hackers@postgresql.org
Date: 2009-11-18T03:46:31Z
Lists: pgsql-hackers
Joshua Tolley wrote:
> + plperl_call_data *save_call_data = current_call_data;
> + bool oldcontext = trusted_context;
> +
> + if (SPI_connect() != SPI_OK_CONNECT)
> + elog(ERROR, "could not connect to SPI manager");
>
...
> + current_call_data = (plperl_call_data *) palloc0(sizeof(plperl_call_data));
> + current_call_data->fcinfo = &fake_fcinfo;
> + current_call_data->prodesc = &desc;
>
I don't think this is done in the right order. If it is then this
comment in plperl_func_handler is wrong (as well as containing a typo):
/*
* Create the call_data beforing connecting to SPI, so that it is not
* allocated in the SPI memory context
*/
cheers
andrew