Skip to content

fixes gh-1737 describe the new way to write 'parts' option while creating indexes #2025

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 5 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions doc/reference/reference_lua/box_space/create_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,34 @@ On this page:
name: primary
...

.. _index_parts_declaration_note:

.. NOTE::

**Alternative way to declare index parts**

Before version :doc:`2.7.1 </release/2.7.1>`,
if an index consisted of a single part and had some options like
``is_nullable`` or ``collation`` and its definition was written as

.. code-block:: lua

my_space:create_index('one_part_idx', {parts = {1, 'unsigned', is_nullable=true}})

(with the only brackets) then options were ignored by Tarantool.

Since version :doc:`2.7.1 </release/2.7.1>` it is allowed to omit
extra braces in an index definition and use both ways:

.. code-block:: lua

-- with extra braces
my_space:create_index('one_part_idx', {parts = {{1, 'unsigned', is_nullable=true}}})

-- without extra braces
my_space:create_index('one_part_idx', {parts = {1, 'unsigned', is_nullable=true}})


.. _details_about_index_field_types:

.. _box_space-index_field_types:
Expand Down
3 changes: 2 additions & 1 deletion doc/release/2.7.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ Core
~~~~

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