Skip to content

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

Merged
merged 9 commits into from
Jul 23, 2020

Conversation

LeonidVas
Copy link
Contributor

@LeonidVas LeonidVas commented Jul 3, 2020

Add support new _index system space format.
Done some fixes and improvements.

Fixes #151

@LeonidVas LeonidVas requested a review from Totktonada July 3, 2020 00:47
@LeonidVas LeonidVas self-assigned this Jul 3, 2020
@Totktonada
Copy link
Member

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.

@LeonidVas LeonidVas linked an issue Jul 17, 2020 that may be closed by this pull request
@LeonidVas LeonidVas force-pushed the lvasiliev/gh-151-support-new-index-format branch 3 times, most recently from 919235c to 86c58a6 Compare July 17, 2020 12:41
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
@LeonidVas LeonidVas force-pushed the lvasiliev/gh-151-support-new-index-format branch from 86c58a6 to 6089295 Compare July 21, 2020 18:06
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.
@LeonidVas LeonidVas force-pushed the lvasiliev/gh-151-support-new-index-format branch from 6089295 to 7f8bc60 Compare July 21, 2020 20:55
Copy link
Member

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Thank you!

@Totktonada Totktonada merged commit f603e0d into master Jul 23, 2020
@Totktonada Totktonada deleted the lvasiliev/gh-151-support-new-index-format branch July 23, 2020 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support new _index system space format
2 participants