From aa3ed3c1ee3365d14516309f35ae85fa8a59e9e9 Mon Sep 17 00:00:00 2001 From: Natalia Ogoreltseva Date: Fri, 2 Apr 2021 14:31:47 +0300 Subject: [PATCH 1/4] fixes gh-1737 describe the new way to write 'parts' option while creating indexes --- .../reference_lua/box_space/create_index.rst | 15 +++++++++++++++ doc/release/2.7.1.rst | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/doc/reference/reference_lua/box_space/create_index.rst b/doc/reference/reference_lua/box_space/create_index.rst index 9bddfa09b3..aadbff1bf6 100644 --- a/doc/reference/reference_lua/box_space/create_index.rst +++ b/doc/reference/reference_lua/box_space/create_index.rst @@ -152,6 +152,21 @@ On this page: name: primary ... + .. NOTE:: + + Since version :doc:`2.7.1 ` it is allowed to omit + extra braces in index definition if it consists of only one part. + + .. code-block:: lua + + --old way with extra braces (still correct) + my_space:create_index('one_part_idx', {parts = {{1, 'unsigned'}}}) + + --new way + my_space:create_index('one_part_idx', {parts = {1, 'unsigned'}}) + + + .. _details_about_index_field_types: .. _box_space-index_field_types: diff --git a/doc/release/2.7.1.rst b/doc/release/2.7.1.rst index 4fa42d5d85..b4394aaf99 100644 --- a/doc/release/2.7.1.rst +++ b/doc/release/2.7.1.rst @@ -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 note after the example in :doc:`/reference/reference_lua/box_space/create_index`. - Bitset index 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). From 05604ba5efea52c229e4bd507b72a5b2e7beed09 Mon Sep 17 00:00:00 2001 From: Natalia Ogoreltseva Date: Mon, 5 Apr 2021 14:10:22 +0300 Subject: [PATCH 2/4] correct content of the note --- .../reference_lua/box_space/create_index.rst | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/doc/reference/reference_lua/box_space/create_index.rst b/doc/reference/reference_lua/box_space/create_index.rst index aadbff1bf6..69b4a9b48d 100644 --- a/doc/reference/reference_lua/box_space/create_index.rst +++ b/doc/reference/reference_lua/box_space/create_index.rst @@ -154,17 +154,29 @@ On this page: .. NOTE:: - Since version :doc:`2.7.1 ` it is allowed to omit - extra braces in index definition if it consists of only one part. + **Alternative way to declare index parts** + + Before version :doc:`2.7.1 `, + if an index consisted of only one part and had some options like + ``is_nullable`` or ``collation`` and its definition was written as .. code-block:: lua - --old way with extra braces (still correct) - my_space:create_index('one_part_idx', {parts = {{1, 'unsigned'}}}) + 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 ` it is allowed to omit + extra braces in index definition and one can use both ways of index + definition: + + .. code-block:: lua - --new way - my_space:create_index('one_part_idx', {parts = {1, 'unsigned'}}) + -- 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: From bc30f2e67b9af1c3e186a533681ffde73de2fe97 Mon Sep 17 00:00:00 2001 From: Natalia Ogoreltseva Date: Mon, 5 Apr 2021 14:57:54 +0300 Subject: [PATCH 3/4] apply suggestions after review --- doc/reference/reference_lua/box_space/create_index.rst | 5 +++-- doc/release/2.7.1.rst | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/reference/reference_lua/box_space/create_index.rst b/doc/reference/reference_lua/box_space/create_index.rst index 69b4a9b48d..18afa841c9 100644 --- a/doc/reference/reference_lua/box_space/create_index.rst +++ b/doc/reference/reference_lua/box_space/create_index.rst @@ -152,6 +152,8 @@ On this page: name: primary ... + .. _index_parts_declaration_note: + .. NOTE:: **Alternative way to declare index parts** @@ -167,8 +169,7 @@ On this page: (with the only brackets) then options were ignored by Tarantool. Since version :doc:`2.7.1 ` it is allowed to omit - extra braces in index definition and one can use both ways of index - definition: + extra braces in an index definition and one can use both ways: .. code-block:: lua diff --git a/doc/release/2.7.1.rst b/doc/release/2.7.1.rst index b4394aaf99..bd923d53bf 100644 --- a/doc/release/2.7.1.rst +++ b/doc/release/2.7.1.rst @@ -40,7 +40,7 @@ Core - Now it is allowed to define an index without extra braces when there is only one part: ``parts = {field1, type1, ...}`` (gh-2866). Read more in - the note after the example in :doc:`/reference/reference_lua/box_space/create_index`. + the :ref:`note about index parts declaration `. - Bitset index 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). From 386598c47210a20f42235d9becf5ffe081a4100c Mon Sep 17 00:00:00 2001 From: Natalia Ogoreltseva Date: Mon, 5 Apr 2021 15:00:54 +0300 Subject: [PATCH 4/4] more fixes --- doc/reference/reference_lua/box_space/create_index.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/reference/reference_lua/box_space/create_index.rst b/doc/reference/reference_lua/box_space/create_index.rst index 18afa841c9..46f10deb61 100644 --- a/doc/reference/reference_lua/box_space/create_index.rst +++ b/doc/reference/reference_lua/box_space/create_index.rst @@ -159,7 +159,7 @@ On this page: **Alternative way to declare index parts** Before version :doc:`2.7.1 `, - if an index consisted of only one part and had some options like + 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 @@ -169,7 +169,7 @@ On this page: (with the only brackets) then options were ignored by Tarantool. Since version :doc:`2.7.1 ` it is allowed to omit - extra braces in an index definition and one can use both ways: + extra braces in an index definition and use both ways: .. code-block:: lua