pgbench: fix misprocessing of some nested \if constructs.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 15 Dec 2024 19:14:14 +0000 (14:14 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 15 Dec 2024 19:14:14 +0000 (14:14 -0500)
commit530f89e648da3a5505920322dcd4e00e15559f66
treebdd4d7a6389ace6e38be7478b024a07e084d62b1
parent56499315a74f97d220373e396903c389d85c8933
pgbench: fix misprocessing of some nested \if constructs.

An \if command appearing within a false (not-to-be-executed) \if
branch was incorrectly treated the same as \elif.  This could allow
statements within the inner \if to be executed when they should
not be.  Also the missing inner \if stack entry would result in an
assertion failure (in assert-enabled builds) when the final \endif
is reached.

Report and patch by Michail Nikolaev.  Back-patch to all
supported branches.

Discussion: https://postgr.es/m/CANtu0oiA1ke=SP6tauhNqkUdv5QFsJtS1p=aOOf_iU+EhyKkjQ@mail.gmail.com
src/bin/pgbench/pgbench.c
src/bin/pgbench/t/001_pgbench_with_server.pl