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
Showing
- src/box/field_def.c 2 additions, 0 deletionssrc/box/field_def.c
- src/box/field_def.h 9 additions, 0 deletionssrc/box/field_def.h
- src/box/tuple_format.c 18 additions, 15 deletionssrc/box/tuple_format.c
- src/box/tuple_format.h 5 additions, 6 deletionssrc/box/tuple_format.h
- src/box/vy_stmt.c 31 additions, 34 deletionssrc/box/vy_stmt.c
- test/vinyl/misc.result 74 additions, 0 deletionstest/vinyl/misc.result
- test/vinyl/misc.test.lua 33 additions, 0 deletionstest/vinyl/misc.test.lua
Loading
Please register or sign in to comment