[BUG] pgbench nested \if conditions incorrectly processed

From: Michail Nikolaev <michail(dot)nikolaev(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: [BUG] pgbench nested \if conditions incorrectly processed
Date: 2024-12-15 14:12:55
Message-ID: CANtu0oiA1ke=SP6tauhNqkUdv5QFsJtS1p=aOOf_iU+EhyKkjQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
v1-0001-pgbench-Fix-nested-if-elif-else-handling-in-scrip.patch application/octet-stream 3.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2024-12-15 14:44:04 Re: Reject Windows command lines not convertible to system locale
Previous Message Vladimír Houba jr. 2024-12-15 11:04:14 transaction priority feature request