]> git.ipfire.org Git - thirdparty/postgresql.git/commit
pgbench: Fix assertion failure with retriable errors in pipeline mode.
authorFujii Masao <fujii@postgresql.org>
Fri, 26 Sep 2025 12:23:43 +0000 (21:23 +0900)
committerFujii Masao <fujii@postgresql.org>
Fri, 26 Sep 2025 12:25:05 +0000 (21:25 +0900)
commitf39d9164b70a8ead8e1b6847f067532b784bbf0e
treec341c4a74aa8e9fbc671a6a5ce7c4c4971795174
parentb4ef835f5e7d66c9a72f8e6c011cf68ed4907f0b
pgbench: Fix assertion failure with retriable errors in pipeline mode.

When running pgbench with --verbose-errors option and a custom script that
triggered retriable errors (e.g., serialization errors) in pipeline mode,
an assertion failure could occur:

    Assertion failed: (sql_script[st->use_file].commands[st->command]->type == 1), function commandError, file pgbench.c, line 3062.

The failure happened because pgbench assumed these errors would only occur
during SQL commands, but in pipeline mode they can also happen during
\endpipeline meta command.

This commit fixes the assertion failure by adjusting the assertion check to
allow such errors during either SQL commands or \endpipeline.

Backpatch to v15, where the assertion check was introduced.

Author: Yugo Nagata <nagata@sraoss.co.jp>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwGWQMOzNkQs-LmpDHdNC0h8dmAuUMRvZrEntQi5a-b=Kg@mail.gmail.com
src/bin/pgbench/pgbench.c