postgresql/src/backend
Tom Lane 26a944cf29 Adjust bytea get_bit/set_bit to use int8 not int4 for bit numbering.
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.  Lift that restriction by redeclaring the
bit number arguments as int8 (which requires a catversion bump,
hence is not back-patchable).

The similarly-named functions for bit/varbit don't really have a
problem because we restrict those types to at most VARBITMAXLEN bits;
hence leave them alone.

While here, extend the encode/decode functions in utils/adt/encode.c
to allow dealing with values wider than 1GB.  This is not a live bug
or restriction in current usage, because no input could be more than
1GB, and since none of the encoders can expand a string more than 4X,
the result size couldn't overflow uint32.  But it might be desirable
to support more in future, so make the input length values size_t
and the potential-output-length values uint64.

Also add some test cases to improve the miserable code coverage
of these functions.

Movead Li, editorialized some by me; also reviewed by Ashutosh Bapat

Discussion: https://postgr.es/m/20200312115135445367128@highgo.ca
2020-04-07 15:57:58 -04:00
..
access Prevent archive recovery from scanning non-existent WAL files. 2020-04-08 00:49:29 +09:00
bootstrap Skip WAL for new relfilenodes, under wal_level=minimal. 2020-04-04 12:25:34 -07:00
catalog Skip WAL for new relfilenodes, under wal_level=minimal. 2020-04-04 12:25:34 -07:00
commands Minor improvements in Incremental Sort explain 2020-04-07 18:25:13 +02:00
executor Implement Incremental Sort 2020-04-06 21:35:10 +02:00
foreign Update copyrights for 2020 2020-01-01 12:21:45 -05:00
jit Extend ExecBuildAggTrans() to support a NULL pointer check. 2020-03-04 17:29:18 -08:00
lib Move src/backend/utils/hash/hashfn.c to src/common 2020-02-27 09:25:41 +05:30
libpq Provide a TLS init hook 2020-03-25 17:13:17 -04:00
main Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nodes Implement Incremental Sort 2020-04-06 21:35:10 +02:00
optimizer Consider Incremental Sort paths at additional places 2020-04-07 16:43:22 +02:00
parser Remove bogus Assert, add some regression test cases showing why. 2020-04-04 18:03:30 -04:00
partitioning Add object names to partition integrity violations. 2020-03-23 08:09:15 +05:30
po Translation updates 2019-06-17 15:30:20 +02:00
port Update copyrights for 2020 2020-01-01 12:21:45 -05:00
postmaster Remove debugging elog from pgstat_recv_resetslrucounter 2020-04-07 19:20:20 +02:00
regex Update copyrights for 2020 2020-01-01 12:21:45 -05:00
replication Add logical replication support to replicate into partitioned tables 2020-04-06 15:15:52 +02:00
rewrite Fix INSERT OVERRIDING USER VALUE behavior 2020-03-31 08:50:39 +02:00
snowball Update copyrights for 2020 2020-01-01 12:21:45 -05:00
statistics Fix race condition in statext_store(). 2020-03-31 17:06:22 -04:00
storage Skip WAL for new relfilenodes, under wal_level=minimal. 2020-04-04 12:25:34 -07:00
tcop Improve user control over truncation of logged bind-parameter values. 2020-04-02 15:04:51 -04:00
tsearch Remove useless pfree()s at the ends of various ValuePerCall SRFs. 2020-03-16 21:36:53 -04:00
utils Adjust bytea get_bit/set_bit to use int8 not int4 for bit numbering. 2020-04-07 15:57:58 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Update copyrights for 2020 2020-01-01 12:21:45 -05:00
nls.mk Translation updates 2019-05-20 16:00:53 +02:00