Skip to content
Snippets Groups Projects
Commit 1651fc9b authored by Alexandr Lyapunov's avatar Alexandr Lyapunov Committed by Roman Tsisyk
Browse files

Introduce new index part format in _index and Lua

Support [{field=<field_no>, type=<type>}, ...] index part format
both in box.space._index and box.schema.index.create() Lua API.

box.space_index now supports the following formats of index parts:

 1. <field_no>, <type>, <field_no>, <type>, ... -- Tarantool 1.6.0+
 2. [[<field_no>, <type>], ...] -- Tarantool 1.6.6+
 3. [{field=<field_no>, type=<type>}] -- Tarantool 1.7.6+, this patch

box.schema.upgrade() converts format #1 to #2. Format #2 is not converted
automatically to #3 yet. Let's extend box.schema.upgrade() to do that later
in order to keep upward compatibility for existing 1.7.x customers.

Lua API now supports the following formats:

1. [<field1_no>, <type1>, ,..] -- Tarantool 1.6.0+
2. [{field=<field_no>, type=<type>}] -- Tarantool 1.7.6+, this patch

In addition to format #2, [{<field_no>, type = <type>}] and
[<field_no>, <type>, may_be_added_in_the_future=xxx}] shortcut is supported.
box.schema.space.create() automatically converts format #1 to #2,
therefor all new indexes will have the new format.

Closes #2802
parent 338746c2
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment