diff --git a/src/tarantool_schema.c b/src/tarantool_schema.c index fab5b41..256dba3 100644 --- a/src/tarantool_schema.c +++ b/src/tarantool_schema.c @@ -297,6 +297,9 @@ decode_index_parts_166(struct schema_field_value *parts, uint32_t part_count, for (uint32_t j = 2; j < item_count; ++j) mp_next(data); + /* Set default values. */ + part->is_nullable = false; + part->coll_id = COLL_NONE; } return 0; } diff --git a/src/tarantool_schema.h b/src/tarantool_schema.h index 2a970cd..1bdd5c7 100644 --- a/src/tarantool_schema.h +++ b/src/tarantool_schema.h @@ -1,6 +1,8 @@ #ifndef PHP_TNT_SCHEMA_H #define PHP_TNT_SCHEMA_H +#include + struct schema_key { const char *id; uint32_t id_len; @@ -13,11 +15,17 @@ enum field_type { FT_OTHER = 2 }; +#define COLL_NONE UINT32_MAX + struct schema_field_value { uint32_t field_number; uint32_t field_name_len; char *field_name; enum field_type field_type; + /* Collation ID for string comparison. */ + uint32_t coll_id; + /* True if a key part can store NULLs. */ + bool is_nullable; }; struct schema_index_value {