tuple_format_iterator: don't set multikey_idx for multikey array itself
Currently, we set multikey_idx to multikey_frame->idx for the field corresponding to the multikey_frame itself. This is wrong, because this field doesn't have any indirection in the field map - we simply store offset to the multikey array there. It works by a happy coincidence - the frame has index -1 and we treat -1 as no-multikey case, see MULTIKEY_NONE. Should we change MULTIKEY_NONE to e.g. -2 or INT_MAX, we would get a crash because of it. So let's move the code setting multikey_idx before initializing multikey_frame in tuple_format_iterator_next().
Loading
Please register or sign in to comment