From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Adjust bytea get_bit/set_bit to cope with bytea strings > 256MB.
Date: Tue, 07 Apr 2020 20:31:26 +0000
Message-ID: <E1jLusY-0000xv-8l@gemulon.postgresql.org> (raw)
Adjust bytea get_bit/set_bit to cope with bytea strings > 256MB.
Since the existing bit number argument can't exceed INT32_MAX, it's
not possible for these functions to manipulate bits beyond the first
256MB of a bytea value. However, it'd be good if they could do at
least that much, and not fall over entirely for longer bytea values.
Adjust the comparisons to be done in int64 arithmetic so that works.
Also tweak the error reports to show sane values in case of overflow.
Also add some test cases to improve the miserable code coverage
of these functions.
Apply patch to back branches only; HEAD has a better solution
as of commit 26a944cf2.
Extracted from a much larger patch by Movead Li
Discussion: https://postgr.es/m/20200312115135445367128@highgo.ca
Branch
------
REL_11_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/5d79fc60c57d6fee25bc694d466702fc5edb8855
Modified Files
--------------
src/backend/utils/adt/varlena.c | 10 +++--
src/test/regress/expected/strings.out | 76 +++++++++++++++++++++++++++++++++++
src/test/regress/sql/strings.sql | 23 +++++++++++
3 files changed, 105 insertions(+), 4 deletions(-)
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-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Adjust bytea get_bit/set_bit to cope with bytea strings > 256MB.
In-Reply-To: <E1jLusY-0000xv-8l@gemulon.postgresql.org>
References: <E1jLusY-0000xv-8l@gemulon.postgresql.org>
* 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