[Tarantool-patches] [PATCH v1 1/1] sql: define format of ephemeral spaces
Safin Timur
tsafin at tarantool.org
Thu Aug 12 21:56:42 MSK 2021
On 12.08.2021 21:32, Vladislav Shpilevoy via Tarantool-patches wrote:
> Hi! Thanks for the fixes!
>
> See 7 comments below.
>
>> - if (def != NULL && i < def->part_count) {
>> - assert(def->parts[i].type < field_type_MAX);
>> - field->type = def->parts[i].type;
>> - field->coll_id = def->parts[i].coll_id;
>> - } else {
>> - field->coll_id = COLL_NONE;
>> - field->type = FIELD_TYPE_SCALAR;
>> - }
>> + struct key_part_def *parts = (void *)fields + parts_indent;
>
> 2. Are you sure void * + integer works bytewise? Shouldn't it be
> cast to char * to move the pointer? In other places you use char *.
Good point. Such void pointer arithmetic is gcc specific language
extension (https://gcc.gnu.org/onlinedocs/gcc/Pointer-Arith.html), and
is not a standard approach.
Timur
More information about the Tarantool-patches
mailing list