pgbench: fix misprocessing of some nested \if constructs.
authorTom Lane <[email protected]>
Sun, 15 Dec 2024 19:14:15 +0000 (14:14 -0500)
committerTom Lane <[email protected]>
Sun, 15 Dec 2024 19:14:15 +0000 (14:14 -0500)
commitec0dc2c596ff7c950ea3d47bf0994ef0e322ceb7
treeb4d4ba062c0153bfadd5bc0ed4b4de49f17ae4d2
parentb6df2d6e5d83e6204bcb74977c12d4ccbf18e8cd
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