box: introduce fixed-size numeric field types#9592
Merged
locker merged 3 commits intotarantool:masterfrom Jan 16, 2024
Gumix:iverbin/gh-9548-introduce-fixed-size-numeric-types
Merged
box: introduce fixed-size numeric field types#9592locker merged 3 commits intotarantool:masterfrom Gumix:iverbin/gh-9548-introduce-fixed-size-numeric-types
locker merged 3 commits intotarantool:masterfrom
Gumix:iverbin/gh-9548-introduce-fixed-size-numeric-types
Conversation
commit 51af059 ("box: compare and hash msgpack value of double key field as double") changed `field_mp_type[FIELD_TYPE_DOUBLE]', but the corresponding column of `field_type_compatibility[]' wasn't updated. Now a field of type DOUBLE can store MP_UINT and MP_INT, i.e. it can store any value from fields of type UNSIGNED, NUMBER, INTEGER. In fact, FIELD_TYPE_DOUBLE is now an alias for FIELD_TYPE_NUMBER. It's hard to create a test, because e.g. during CheckSpaceFormat even if field_type1_contains_type2() erroneously returns false, then each tuple is correctly validated anyway. So this patch actually fixes performance issue. NO_TEST=see above NO_DOC=minor fix NO_CHANGELOG=minor fix
All the information needed by this function is stored in `field_mp_type[]' and `field_ext_type[]'. Get rid of redundant `field_type_compatibility[]', which is hard to extend and which can introduce additional bugs. NO_DOC=refactoring NO_CHANGELOG=refactoring
andreyaksenov
approved these changes
Jan 15, 2024
locker
requested changes
Jan 15, 2024
ochaplashkin
approved these changes
Jan 15, 2024
locker
reviewed
Jan 16, 2024
See the docbot request for details. Closes #9548 @TarantoolBot document Title: Document fixed-size numeric field types Product: Tarantool Since: 3.1 Root document: https://www.tarantool.io/en/doc/latest/concepts/data_model/value_store/#field-type-details ### Fixed-size field types Tarantool supports the following fixed-size numeric field types: * `uint8`: integer in range [0 .. 255] * `int8`: integer in range [-128 .. 127] * `uint16`: integer in range [0 .. 65,535] * `int16`: integer in range [-32,768 .. 32,767] * `uint32`: integer in range [0 .. 4,294,967,295] * `int32`: integer in range [-2,147,483,648 .. 2,147,483,647] * `uint64`: integer in range [0 .. 18,446,744,073,709,551,615] * `int64`: integer in range [-9,223,372,036,854,775,808 .. 9,223,372,036,854,775,807] * `float32`: 32-bit floating point number * `float64`: 64-bit floating point number These types don't affect how data is stored in Tarantool's memtx or vinyl engines but they enforce the limits when a tuple is inserted or updated.
locker
approved these changes
Jan 16, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9548