[pgjdbc/pgjdbc] b37115: Prevent use of extended query protocol for BEGIN b...

Craig Ringer <[email protected]> Fri, 06 Dec 2019 05:21:35 -0800
Newsgroups gmane.comp.db.postgresql.jdbc
Message-ID <pgjdbc/pgjdbc/push/refs/heads/master/[email protected]>
  Branch: refs/heads/master
  Home:   https://github.com/pgjdbc/pgjdbc
  Commit: b37115373935732b1ab5e59b56837ac49942718a
      https://github.com/pgjdbc/pgjdbc/commit/b37115373935732b1ab5e59b56837ac49942718a
  Author: Craig Ringer <[email protected]>
  Date:   2019-12-06 (Fri, 06 Dec 2019)

  Changed paths:
    M pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java

  Log Message:
  -----------
  Prevent use of extended query protocol for BEGIN before COPY (#1639)

When autocommit is off and the first query in a transaction is a COPY, we were
sending a BEGIN using the extended query protocol. It was being permitted to
use named portals as well, ignoring prepareThreshold.

Fix by forcing simple query mode and marking the BEGIN as oneshot.

Fixes #1638