]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix log_statement_max_length test with verbose logs
authorFujii Masao <fujii@postgresql.org>
Fri, 3 Jul 2026 05:41:44 +0000 (14:41 +0900)
committerFujii Masao <fujii@postgresql.org>
Fri, 3 Jul 2026 05:41:44 +0000 (14:41 +0900)
Buildfarm member prion reported a failure in the test added by commit
c8bd8387c27 to verify that the server logs an empty statement body
when log_statement_max_length = 0.

The test assumed that "statement:" would appear immediately after
"LOG:" in the logged statement message. However, prion runs with
log_error_verbosity = verbose, which inserts the SQLSTATE between
"LOG:" and the message text. As a result, the test failed even though
the server behaved correctly.

Per buildfarm member prion.

Discussion: https://postgr.es/m/CAHGQGwFiQKwvLVG+U0WWNo2kgkQ88FVGhYH_MBZu9Y0SJ8BjDw@mail.gmail.com

src/test/modules/test_misc/t/014_log_statement_max_length.pl

index 6cd45f2ee83304191a09b062bcb84cd3e8dfdbe5..b1ce6068f5d4e27768b8db24e35e37a06b970239 100644 (file)
@@ -62,7 +62,7 @@ $node->psql(
        'postgres', "
        SET log_statement_max_length TO 0;
        SELECT '123456789ABCDEF';");
-ok($node->log_contains(qr/LOG:\s+statement:\s*$/m, $log_offset),
+ok($node->log_contains(qr/statement:\s*$/m, $log_offset),
        "0 logs an empty statement body");
 
 # Verify truncation via the extended query protocol (execute message).