Thread
Commits
-
pgbench: fix misprocessing of some nested \if constructs.
- ff9dc96f370a 17.3 landed
- ff88db91036f 15.11 landed
- ec0dc2c596ff 13.19 landed
- 2a23dbcf3594 14.16 landed
- 076b09123078 16.7 landed
- 530f89e648da 18.0 landed
-
[BUG] pgbench nested \if conditions incorrectly processed
Michail Nikolaev <michail.nikolaev@gmail.com> — 2024-12-15T14:12:55Z
Hello, I’ve found an issue with pgbench: it processes nested \if conditions incorrectly. For example: \if false \if true DROP TABLE money CASCADE; \endif \endif In this case, the table will be dropped, which is unexpected behavior. Attached is a fix that addresses this issue, along with a regression test. Best regards, Mikhail -
Re: [BUG] pgbench nested \if conditions incorrectly processed
Tom Lane <tgl@sss.pgh.pa.us> — 2024-12-15T18:40:27Z
Michail Nikolaev <michail.nikolaev@gmail.com> writes: > I’ve found an issue with pgbench: it processes nested \if conditions > incorrectly. Right you are. > Attached is a fix that addresses this issue, along with a regression test. Code fix looks good, but I don't agree with creating a separate test script for this --- that entails spinning up an entire new server instance, which is an awful lot of cycles to expend in every check-world run forevermore for this size of problem. I'll just add the test case to 001_pgbench_with_server.pl instead. Looking at the code coverage report [1], it seems we are also missing any test that covers \if in the IFSTATE_IGNORED/IFSTATE_ELSE_FALSE case. That code appears correct, but given this bug it seems prudent to extend the test to cover that path too. I'll do that and push. regards, tom lane [1] https://coverage.postgresql.org/src/bin/pgbench/pgbench.c.gcov.html#3915