gpdb icon indicating copy to clipboard operation
gpdb copied to clipboard

change the default char to signed char to fix 15206 and 15207

Open wxzkenny opened this issue 1 year ago • 8 comments

gp_sparse_vector relies on char being a signed number, while char is
unsigned by default on ARM platform, which makes *((char *)(ptr)) in
int8compstoragesize impossible to be negative.  This results in an
error where int8compstoragesize is used, resulting in compword_to_int8
size is not 0, 1, 3, 5, 9 as specified in the case, thus returning a
num, but num is not initialized, so it may be random. The subsequent
execution logic is faulty.

There are three main parts to this fix:
1.  Specify the type of char as the desired signed type via the gcc argument -fsign-char argument
2.  Preventative error reporting when the wrong size is obtained
3.  Modify the exit conditions in op_sdata_by_sdata that may cause an endless loop

wxzkenny avatar Jan 05 '24 08:01 wxzkenny