Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Mon, 02 Jun 2025 08:29:59 +0000 Subject: Re: [pgjdbc/pgjdbc] PR #3631: fix: isValid incorrectly called execute, instead of executeWithFlags fixes Issue #3630 In-Reply-To: References: List-Id: X-GitHub-Author-Login: vlsi X-GitHub-Comment-Id: 2929417551 X-GitHub-Comment-Type: issue_comment X-GitHub-Edited-At: 2025-06-02T08:31:12Z X-GitHub-Issue: 3631 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3631#issuecomment-2929417551 Content-Type: text/plain; charset=utf-8 The PR did not change much though as `QueryExecutorImpl#updateQueryMode` resets `AS_SINGLE` flag anyway: https://github.com/pgjdbc/pgjdbc/blob/0a88ea425e86dce691a96d6aa7023c20ac887b98/pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java#L317-L322 We'd better write explicit tests rather than rely on the code change alone. So it still ends up with the unwanted error when calling `isValid`: ``` org.postgresql.util.PSQLException: ERROR: prepared statement "S_3" does not exist at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2736) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2423) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:374) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:518) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:435) at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:357) at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:342) at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:318) at org.postgresql.jdbc.PgConnection.isValid(PgConnection.java:1554) at org.postgresql.test.jdbc2.AutoRollbackTest.run(AutoRollbackTest.java:314) ```