Skip to content

Commit dc7523f

Browse files
LeonidVasTotktonada
authored andcommitted
schema: add collation and is_nullable opts
Add collation and is_nullable opts to schema_field_value. Part of #151
1 parent d1bdb6c commit dc7523f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/tarantool_schema.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ decode_index_parts_166(struct schema_field_value *parts, uint32_t part_count,
297297

298298
for (uint32_t j = 2; j < item_count; ++j)
299299
mp_next(data);
300+
/* Set default values. */
301+
part->is_nullable = false;
302+
part->coll_id = COLL_NONE;
300303
}
301304
return 0;
302305
}

src/tarantool_schema.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef PHP_TNT_SCHEMA_H
22
#define PHP_TNT_SCHEMA_H
33

4+
#include <stdint.h>
5+
46
struct schema_key {
57
const char *id;
68
uint32_t id_len;
@@ -13,11 +15,17 @@ enum field_type {
1315
FT_OTHER = 2
1416
};
1517

18+
#define COLL_NONE UINT32_MAX
19+
1620
struct schema_field_value {
1721
uint32_t field_number;
1822
uint32_t field_name_len;
1923
char *field_name;
2024
enum field_type field_type;
25+
/* Collation ID for string comparison. */
26+
uint32_t coll_id;
27+
/* True if a key part can store NULLs. */
28+
bool is_nullable;
2129
};
2230

2331
struct schema_index_value {

0 commit comments

Comments
 (0)