Re: A bug when use get_bit() function for a long bytea string
movead.li@highgo.ca <movead.li@highgo.ca>
From: "movead.li@highgo.ca" <movead.li@highgo.ca>
To: "Daniel Verite" <daniel@manitou-mail.org>
Cc: "Tom Lane" <tgl@sss.pgh.pa.us>, ashutosh.bapat <ashutosh.bapat@2ndquadrant.com>, pgsql-hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-04-07T01:29:51Z
Lists: pgsql-hackers
>In existing releases, the SQL definitions are set_bit(bytea,int4,int4) >and get_bit(bytea,int4) and cannot be changed to not break the API. >So the patch meant for existing releases has to deal with a too-narrow >int32 bit number. >Internally in the C functions, you may convert that number to int64 >if you think it's necessary, but you may not use PG_GETARG_INT64 >to pick a 32-bit argument. The input parameter of 'set_bit()' function for 'byteaGetBit' has changed to 'bytea int8 int4', but maybe another 'set_bit()' for 'bitgetbit' need not changed. The same with 'get_bit()'. Regards, Highgo Software (Canada/China/Pakistan) URL : www.highgo.ca EMAIL: mailto:movead(dot)li(at)highgo(dot)ca
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