Skip to content

Commit 59c50eb

Browse files
authored
fixes gh-1737 describe the new way to write 'parts' option while creating indexes (#2025)
* fixes gh-1737 describe the new way to write 'parts' option while creating indexes
1 parent 9d41bb4 commit 59c50eb

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

doc/reference/reference_lua/box_space/create_index.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,34 @@ On this page:
152152
name: primary
153153
...
154154
155+
.. _index_parts_declaration_note:
156+
157+
.. NOTE::
158+
159+
**Alternative way to declare index parts**
160+
161+
Before version :doc:`2.7.1 </release/2.7.1>`,
162+
if an index consisted of a single part and had some options like
163+
``is_nullable`` or ``collation`` and its definition was written as
164+
165+
.. code-block:: lua
166+
167+
my_space:create_index('one_part_idx', {parts = {1, 'unsigned', is_nullable=true}})
168+
169+
(with the only brackets) then options were ignored by Tarantool.
170+
171+
Since version :doc:`2.7.1 </release/2.7.1>` it is allowed to omit
172+
extra braces in an index definition and use both ways:
173+
174+
.. code-block:: lua
175+
176+
-- with extra braces
177+
my_space:create_index('one_part_idx', {parts = {{1, 'unsigned', is_nullable=true}}})
178+
179+
-- without extra braces
180+
my_space:create_index('one_part_idx', {parts = {1, 'unsigned', is_nullable=true}})
181+
182+
155183
.. _details_about_index_field_types:
156184

157185
.. _box_space-index_field_types:

doc/release/2.7.1.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ Core
3939
~~~~
4040

4141
- Now it is allowed to define an index without extra braces when there
42-
is only one part: ``parts = {field1, type1, ...}`` (gh-2866).
42+
is only one part: ``parts = {field1, type1, ...}`` (gh-2866). Read more in
43+
the :ref:`note about index parts declaration <index_parts_declaration_note>`.
4344
- :ref:`Bitset index <indexes-bitset>` now supports the varbinary type (gh-5392).
4445
- Index-related options now can’t be specified in their definition due
4546
to a more pedantic key-parts verification (gh-5473).

0 commit comments

Comments
 (0)