Skip to content
Snippets Groups Projects
Commit 223c6265 authored by Vladislav Shpilevoy's avatar Vladislav Shpilevoy
Browse files

vinyl: do not check types of not indexed surrogate fields

Vinyl surrogate tuple can be constructed using a key and filling
not indexed fields with NULL values. But not indexed field can be
formatted using space:format. Such fields can not store NULLs and
tuple_init_field_map raises an error on it.

But vinyl actually does not use not indexed fields in surrogate
tuples so we can store NULLs in surrogate not indexed formatted
fields.

Besides, we can not use field->type != FIELD_TYPE_ANY as a flag
that a field is not indexed and is not formatted. Now ANY field
type is available for users. To check if a field can be nullified
in a surrogate tuple we must use key_def.

The same problem is actual for construction a surrogate tuple from
a normal tuple - we can not anymore use type != FIELD_TYPE_ANY to
define a field is not indexed. Moreover in such a case we also can
skip fields not used by an index and placed after the last field
used by an index.
For this optimization introduce tuple_format.index_field_count and
field_def.is_key_part.

Closes #2784
parent d121e7c4
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment