From: vlsi (@vlsi) <noreply+vlsi@github.com>
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
Subject: Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
Date: Wed, 14 Oct 2026 06:22:27 +0000
Message-ID: <gh-pgjdbc-pgjdbc-4332-rc4267444415@github.com> (raw)
In-Reply-To: <gh-pgjdbc-pgjdbc-4332@github.com>
References: <gh-pgjdbc-pgjdbc-4332@github.com>
(on pgjdbc/src/test/java/org/postgresql/core/v3/BindLogTest.java)
The line above already asserts that the log is at most 256 characters, so it cannot contain a 500000-character string, and this assertion holds whatever the formatter does. The same is true at line 85. A formatter that calls `toString` on the value, or builds the whole literal, and discards the result passes both tests. Here the `toString` override can set a flag, and the test can assert that it stayed unset.