[tarantool-patches] Re: [PATCH v9] sql: add index_def to struct Index
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Wed Jul 4 03:08:31 MSK 2018
>> + uint32_t iid, const char *name, uint32_t name_len, bool is_unique,
>> + struct ExprList *expr_list, u8 idx_type)
>> +{
>> + struct space_def *space_def = table->def;
>> + size_t sql_size = 0;
>> + struct index_opts opts;
>> + index_opts_create(&opts);
>> + index->def = NULL;
>> + opts.is_unique = is_unique;
>> + int rc = -1;
>
> You don’t use this variable and in the end just reassign it:
This variable is reassigned on success only. On any error we
go to cleanup or tnt_error and rc remains -1.
>
> + if (index->def == NULL)
> + goto tnt_error;
> + rc = 0;
> +cleanup:
> + if (key_def != NULL)
> + key_def_delete(key_def);
> + return rc;
>
More information about the Tarantool-patches
mailing list