Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nwQU0-0003H3-Sd for pgsql-jdbc@arkaria.postgresql.org; Wed, 01 Jun 2022 15:42:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nwQTz-0005Bf-Jw for pgsql-jdbc@arkaria.postgresql.org; Wed, 01 Jun 2022 15:42:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nwQTz-0005BV-As for pgsql-jdbc@lists.postgresql.org; Wed, 01 Jun 2022 15:42:03 +0000 Received: from out-26.smtp.github.com ([192.30.252.209] helo=smtp.github.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nwQTw-0003Fj-S8 for pgsql-jdbc@lists.postgresql.org; Wed, 01 Jun 2022 15:42:02 +0000 Received: from github.com (hubbernetes-node-5334bc5.ash1-iad.github.net [10.56.128.17]) by smtp.github.com (Postfix) with ESMTPA id 8F1575E0217 for ; Wed, 1 Jun 2022 08:41:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1654098119; bh=uvX54pF8S5uoI+AdaHUDUpOy2AtKe15MnrcmoQST6BY=; h=Date:From:To:Subject:From; b=MfoCX8lu2FmN5n9zxSPoxBUsLtm4RwxYjw/gJvU5rn17eE9ikNtQawJEtjqJKQfQ6 TMZT1xSWAkddj8qNfU4TS95b02/Tvr6CD7KhpoE+A/uQZ4c1y4hpFD28YMzPk94v+P kwxIyrbgrzUZ902M3oai2sGvdZH88uY2Q0CAcCxU= Date: Wed, 01 Jun 2022 08:41:59 -0700 From: Vladimir Sitnikov To: pgsql-jdbc@lists.postgresql.org Message-ID: Subject: [pgjdbc/pgjdbc] 6c0c5d: fix: support queries with up to 65535 (inclusive) ... Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Approved: 58GruLoMopuc X-GitHub-Recipient-Address: pgsql-jdbc@lists.postgresql.org X-Auto-Response-Suppress: All List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Branch: refs/heads/master Home: https://github.com/pgjdbc/pgjdbc Commit: 6c0c5da4075960e1dffa91480fb8b3a4932f8e1b https://github.com/pgjdbc/pgjdbc/commit/6c0c5da4075960e1dffa91480fb8b3a4932f8e1b Author: Vladimir Sitnikov 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