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
Showing
- src/box/key_def.cc 54 additions, 4 deletionssrc/box/key_def.cc
- src/box/key_def.h 2 additions, 0 deletionssrc/box/key_def.h
- src/box/lua/net_box.lua 2 additions, 2 deletionssrc/box/lua/net_box.lua
- src/box/lua/schema.lua 54 additions, 33 deletionssrc/box/lua/schema.lua
- test/box/alter.result 15 additions, 5 deletionstest/box/alter.result
- test/box/alter.test.lua 5 additions, 0 deletionstest/box/alter.test.lua
- test/box/alter_limits.result 3 additions, 6 deletionstest/box/alter_limits.result
- test/engine/ddl.result 56 additions, 0 deletionstest/engine/ddl.result
- test/engine/ddl.test.lua 17 additions, 0 deletionstest/engine/ddl.test.lua
- test/engine/iterator.result 1 addition, 1 deletiontest/engine/iterator.result
- test/vinyl/ddl.result 5 additions, 6 deletionstest/vinyl/ddl.result
- test/vinyl/layout.result 1 addition, 1 deletiontest/vinyl/layout.result
Loading
Please register or sign in to comment