pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Use heap_modify_tuple not SPI_modifytuple in pl/perl triggers. 2+ messages / 1 participants [nested] [flat]
* pgsql: Use heap_modify_tuple not SPI_modifytuple in pl/perl triggers. @ 2016-11-08 16:35 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2016-11-08 16:35 UTC (permalink / raw) To: pgsql-committers Use heap_modify_tuple not SPI_modifytuple in pl/perl triggers. The code here would need some change anyway given planned change in SPI_modifytuple semantics, since this executes after we've exited the SPI environment. But really it's better to just use heap_modify_tuple. The code's actually shorter this way, and this avoids depending on some rather indirect reasoning about why the temporary arrays can't be overrun. (I think the old code is safe, as long as Perl hashes can't contain duplicate keys; but with this way we don't need that assumption, only the assumption that SPI_fnumber doesn't return an out-of-range attnum.) While at it, normalize use of SPI_fnumber: make error messages distinguish no-such-column from can't-set-system-column, and remove test for deleted column which is going to migrate into SPI_fnumber. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/0d4446083df56a36ecec8e8bd321a45ecac7e7c6 Modified Files -------------- src/pl/plperl/plperl.c | 56 ++++++++++++++++++++++---------------------------- 1 file changed, 25 insertions(+), 31 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Use heap_modify_tuple not SPI_modifytuple in pl/python triggers. @ 2016-11-08 17:00 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2016-11-08 17:00 UTC (permalink / raw) To: pgsql-committers Use heap_modify_tuple not SPI_modifytuple in pl/python triggers. The code here would need some change anyway given planned change in SPI_modifytuple semantics, since this executes after we've exited the SPI environment. But really it's better to just use heap_modify_tuple. While at it, normalize use of SPI_fnumber: make error messages distinguish no-such-column from can't-set-system-column, and remove test for deleted column which is going to migrate into SPI_fnumber. The lack of a check for system column names is actually a pre-existing bug here, and might even qualify as a security bug except that we don't have any trusted version of plpython. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/de4026c673f195cfdb7aa7cc87cc60e36963f094 Modified Files -------------- src/pl/plpython/plpy_exec.c | 86 +++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 45 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2016-11-08 17:00 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2016-11-08 16:35 pgsql: Use heap_modify_tuple not SPI_modifytuple in pl/perl triggers. Tom Lane <tgl@sss.pgh.pa.us> 2016-11-08 17:00 pgsql: Use heap_modify_tuple not SPI_modifytuple in pl/python triggers. Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox