pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Adjust bytea get_bit/set_bit to cope with bytea strings > 256MB. 5+ messages / 1 participants [nested] [flat]
* pgsql: Adjust bytea get_bit/set_bit to cope with bytea strings > 256MB. @ 2020-04-07 20:31 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2020-04-07 20:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e40c4d4914fd7e4682ae96ba8b772c96ec5b9414 Modified Files -------------- src/backend/utils/adt/varlena.c | 10 +++-- src/test/regress/expected/strings.out | 78 +++++++++++++++++++++++++++++++++++ src/test/regress/sql/strings.sql | 26 ++++++++++++ 3 files changed, 110 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Adjust bytea get_bit/set_bit to cope with bytea strings > 256MB. @ 2020-04-07 20:31 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2020-04-07 20:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/6e6b74a206c3b4ad9f22f4910b2e0ed9d922b312 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(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Adjust bytea get_bit/set_bit to cope with bytea strings > 256MB. @ 2020-04-07 20:31 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2020-04-07 20:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/dbb121038c74ba4491afc5a63c48b9e780c0ae12 Modified Files -------------- src/backend/utils/adt/varlena.c | 10 +++-- src/test/regress/expected/strings.out | 78 +++++++++++++++++++++++++++++++++++ src/test/regress/sql/strings.sql | 26 ++++++++++++ 3 files changed, 110 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Adjust bytea get_bit/set_bit to cope with bytea strings > 256MB. @ 2020-04-07 20:31 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2020-04-07 20:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Adjust bytea get_bit/set_bit to cope with bytea strings > 256MB. @ 2020-04-07 20:31 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2020-04-07 20:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/889786e0e8c1eba9e770d173bbef2244f67e72c9 Modified Files -------------- src/backend/utils/adt/varlena.c | 10 +++-- src/test/regress/expected/strings.out | 78 +++++++++++++++++++++++++++++++++++ src/test/regress/sql/strings.sql | 26 ++++++++++++ 3 files changed, 110 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2020-04-07 20:31 UTC | newest] Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-04-07 20:31 pgsql: Adjust bytea get_bit/set_bit to cope with bytea strings > 256MB. Tom Lane <tgl@sss.pgh.pa.us> 2020-04-07 20:31 pgsql: Adjust bytea get_bit/set_bit to cope with bytea strings > 256MB. Tom Lane <tgl@sss.pgh.pa.us> 2020-04-07 20:31 pgsql: Adjust bytea get_bit/set_bit to cope with bytea strings > 256MB. Tom Lane <tgl@sss.pgh.pa.us> 2020-04-07 20:31 pgsql: Adjust bytea get_bit/set_bit to cope with bytea strings > 256MB. Tom Lane <tgl@sss.pgh.pa.us> 2020-04-07 20:31 pgsql: Adjust bytea get_bit/set_bit to cope with bytea strings > 256MB. Tom Lane <tgl@sss.pgh.pa.us>
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