Thanks for the reply. >Why have you used size? Shouldn't we use int64? Yes, thanks for the point, I have changed the patch. >If get_bit()/set_bit() accept the second argument as int32, it can not >be used to set bits whose number does not fit 32 bits. I think we need >to change the type of the second argument as well. Because int32 can cover the length of bytea that PostgreSQL support, and I have decided to follow your next point 'not use 64bit int for len', so I think the second argument can keep int32.
>Also, I think declaring len to be int is fine since 1G would fit an >int, but what does not fit is len * 8, when performing that >calculation, we have to widen the result. So, instead of changing the >datatype of len, it might be better to perform the calculation as >(int64)len * 8. If we use int64, we could also use INT64_FORMAT >instead of using %ld. Have followed and changed the patch. >Since this is a bug it shouldn't wait another commitfest, but still >add this patch to the commitfest so that it's not forgotten. Will do. Highgo Software (Canada/China/Pakistan) URL : www.highgo.ca EMAIL: mailto:movead(dot)li(at)highgo(dot)ca
long_bytea_string_bug_fix_ver2.patch
Description: Binary data