Re: A bug when use get_bit() function for a long bytea string
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: "Daniel Verite" <daniel@manitou-mail.org>
Cc: "Ashutosh Bapat" <ashutosh.bapat@2ndquadrant.com>,
"movead.li@highgo.ca" <movead.li@highgo.ca>,
"pgsql-hackers" <pgsql-hackers@lists.postgresql.org>
Date: 2020-03-27T19:19:59Z
Lists: pgsql-hackers
"Daniel Verite" <daniel@manitou-mail.org> writes: > So aside from the integer overflow bug, isn't there the issue that the > "offset" argument of get_bit() and set_bit() should have been an > int8 in the first place? Good point, but a fix for that wouldn't be back-patchable. It does suggest that we should just make all the internal logic use int8 for these values (as the solution to the overflow issue), and then in HEAD only, adjust the function signatures so that int8 can be passed in. regards, tom lane
Commits
-
Adjust bytea get_bit/set_bit to cope with bytea strings > 256MB.
- e40c4d4914fd 9.6.18 landed
- dbb121038c74 9.5.22 landed
- 889786e0e8c1 10.13 landed
- 6e6b74a206c3 12.3 landed
- 5d79fc60c57d 11.8 landed
-
Adjust bytea get_bit/set_bit to use int8 not int4 for bit numbering.
- 26a944cf29ba 13.0 landed