-
Notifications
You must be signed in to change notification settings - Fork 24
Support new _index format #164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I looked briefly into the patchset. Except several coments above I have a couple of general comments (below). I would add some test cases within commits, where a new functionality is implemented. Say, 'update processing the field type' surely adds the new functionality and it would be more clear if a test case will show what exactly becomes supported. I would add 'build', 'refactoring' prefixes to explicitly mark commits that does not chamge any behaviour. I would maybe also introduce 'schema' prefix, it may be convenient. I didn't look thoroughly into the patch, so sorry that my comments are mostly formatting nitpickings and questions. |
919235c
to
86c58a6
Compare
Before the patch, the default compiler compilation mode is used (including C89, version dependent). But support the C89 dialect in 2020 is strange. Accordingly, set C99 as preffered.
There is serious "inline disease" in the code. It seems that "inline" is set to all static function. The patch clears the tarantool_schema.c file.
Alignment of structure members to "natural" address boundaries will cause to a 4-byte gap between field_name and field_name_len on 64-bit platform. If the members will be swapped, the gap is gone.
To simplify adding further changes, move decoding index parts to a separate function and update it in accordance with the decoding function from tarantool. Part of #151
Add collation and is_nullable opts to schema_field_value. Part of #151
Update processing the field type in accordance with the same in tarantool. Part of #151
86c58a6
to
6089295
Compare
After tarantool-1.7.5-153-g1651fc9be the new _index format was introduced. We should support it to fetch a schema from a tarantool-1.7.5.153+ instance. When an index parts do not use parameters except name and type the index info is stored in the old format in _index system space. When an index part uses is_nullable or collation parameter, then the new format will be used. Close #151
Doesn't change user visible behaviour. * Add support is_nullable to parsing _space system space. * Replace string comparation. It's no always correct and safe to use memcmp to compare a null-terminated string with a length specified string, because it doesn't check the end of null-terminated string (like strncmp) which may be less.
Added support for the new _index format. The time is come to enable tests for tarantool-2.2.
6089295
to
7f8bc60
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thank you!
Add support new _index system space format.
Done some fixes and improvements.
Fixes #151