]> git.ipfire.org Git - thirdparty/postgresql.git/commit
hstore_plperl: Add CHECK_FOR_INTERRUPTS() in reference-unwinding loop.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 18 Jun 2026 16:22:55 +0000 (12:22 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 18 Jun 2026 16:22:55 +0000 (12:22 -0400)
commitd65cf6f800f00a560cd479b426a17f73dd0020f7
treef9f802d4644e6d10c071df96c263f0c4c9bd2020
parent5562b2657f942113b77bd557234a2ac4d08a49c5
hstore_plperl: Add CHECK_FOR_INTERRUPTS() in reference-unwinding loop.

Add CHECK_FOR_INTERRUPTS() to the while loop in plperl_to_hstore()
that dereferences chains of Perl references, so that a circular
reference (e.g. $x = \$x) can be cancelled by the user instead of
spinning indefinitely.  (We looked at detecting such circular
references, but it seems more trouble than it's worth.)

This is a follow-up to da82fbb8f, which fixed the same issue in
SV_to_JsonbValue() in jsonb_plperl.

Author: Aleksander Alekseev <aleksander@tigerdata.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAJ7c6TPbjkzUk4qJ5dHvDNEz0hBuFue3A-XWz_=897z+BC+z8A@mail.gmail.com
Backpatch-through: 14
contrib/hstore_plperl/hstore_plperl.c