aboutsummaryrefslogtreecommitdiff
path: root/contrib/jsonb_plpython
diff options
context:
space:
mode:
authorAlexander Korotkov <akorotkov@postgresql.org>2024-03-08 13:00:40 +0200
committerAlexander Korotkov <akorotkov@postgresql.org>2024-03-08 13:18:30 +0200
commitfefd9a3fed275cecd9ed4091b00698deed39b92e (patch)
treee4a2769c715a7fd8ed27d7cee872ebba6334ceee /contrib/jsonb_plpython
parent6d9751fa8fd40c988541c9c72ac7a2095ba73c19 (diff)
downloadpostgresql-fefd9a3fed275cecd9ed4091b00698deed39b92e.tar.gz
postgresql-fefd9a3fed275cecd9ed4091b00698deed39b92e.zip
Turn tail recursion into iteration in CommitTransactionCommand()
Usually the compiler will optimize away the tail recursion anyway, but if it doesn't, you can drive the function into stack overflow. For example: (n=1000000; printf "BEGIN;"; for ((i=1;i<=$n;i++)); do printf "SAVEPOINT s$i;"; done; printf "ERROR; COMMIT;") | psql >/dev/null In order to get better readability and less changes to the existing code the recursion-replacing loop is implemented as a wrapper function. Report by Egor Chindyaskin and Alexander Lakhin. Discussion: https://postgr.es/m/1672760457.940462079%40f306.i.mail.ru Author: Alexander Korotkov, Heikki Linnakangas
Diffstat (limited to 'contrib/jsonb_plpython')
0 files changed, 0 insertions, 0 deletions