pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vladimir Sitnikov <noreply@github.com>
To: pgsql-jdbc@lists.postgresql.org
Subject: [pgjdbc/pgjdbc] 6c0c5d: fix: support queries with up to 65535 (inclusive) ...
Date: Wed, 01 Jun 2022 08:41:59 -0700
Message-ID: <pgjdbc/pgjdbc/push/refs/heads/master/82dbbe-6c0c5d@github.com> (raw)

  Branch: refs/heads/master
  Home:   https://github.com/pgjdbc/pgjdbc
  Commit: 6c0c5da4075960e1dffa91480fb8b3a4932f8e1b
      https://github.com/pgjdbc/pgjdbc/commit/6c0c5da4075960e1dffa91480fb8b3a4932f8e1b
  Author: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  Date:   2022-06-01 (Wed, 01 Jun 2022)

  Changed paths:
    M CHANGELOG.md
    M pgjdbc/src/main/java/org/postgresql/core/PGStream.java
    M pgjdbc/src/main/java/org/postgresql/jdbc/PgPreparedStatement.java
    M pgjdbc/src/test/java/org/postgresql/test/jdbc2/BatchedInsertReWriteEnabledTest.java
    A pgjdbc/src/test/java/org/postgresql/test/jdbc42/PreparedStatement64KBindsTest.java

  Log Message:
  -----------
  fix: support queries with up to 65535 (inclusive) parameters

Previously the execution failed with "Tried to send an out-of-range integer as a 2-byte value"
when the user attempted executing a query with more than 32767 parameters.

Technically speaking, the wire protocol limit is 2-byte-unsigned-int,
so we should support 65535 parameters.

In practice, simple mode (preferQueryMode=simple) allows executing queries
with an arbitrary number of parameters, however, that escape hatch is not recommended
as it still has limits on the SQL length, and it would likely be slow.

fixes #1311







Message-ID: <pgjdbc/pgjdbc/push/refs/heads/master/82dbbe-6c0c5d@github.com>
Permalink:  ../pgjdbc%2Fpgjdbc%2Fpush%2Frefs%2Fheads%2Fmaster%2F82dbbe-6c0c5d@github.com/
Also on:    postgresql.org/message-id/pgjdbc/pgjdbc/push/refs/heads/master/82dbbe-6c0c5d@github.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: noreply@github.com
  Subject: Re: [pgjdbc/pgjdbc] 6c0c5d: fix: support queries with up to 65535 (inclusive) ...
  In-Reply-To: <pgjdbc/pgjdbc/push/refs/heads/master/82dbbe-6c0c5d@github.com>
  References: <pgjdbc/pgjdbc/push/refs/heads/master/82dbbe-6c0c5d@github.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox