Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
To: tarantool-patches@freelists.org, kostja@tarantool.org
Cc: vdavydov.dev@gmail.com
Subject: Re: [tarantool-patches] [PATCH v4 4/5] box: fix memtx_tree_index_build_array_deduplicate
Date: Wed, 24 Jul 2019 15:25:44 +0300	[thread overview]
Message-ID: <c109c7be-257d-539c-d377-16f359641867@tarantool.org> (raw)
In-Reply-To: <cover.1563953154.git.kshcherbatov@tarantool.org>

Function memtx_tree_index_build_array_deduplicate worked
incorrectly: when build_array is empty it changed it size to 1.

Follow up #1257
Needed for #1260
---
 src/box/memtx_tree.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/box/memtx_tree.c b/src/box/memtx_tree.c
index 41eb6dbec..dc167e113 100644
--- a/src/box/memtx_tree.c
+++ b/src/box/memtx_tree.c
@@ -862,6 +862,8 @@ memtx_tree_index_build_next_multikey(struct index *base, struct tuple *tuple)
 static void
 memtx_tree_index_build_array_deduplicate(struct memtx_tree_index *index)
 {
+	if (index->build_array_size == 0)
+		return;
 	struct key_def *cmp_def = memtx_tree_cmp_def(&index->tree);
 	size_t w_idx = 0, r_idx = 1;
 	while (r_idx < index->build_array_size) {
-- 
2.22.0

      parent reply	other threads:[~2019-07-24 12:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-24  7:36 [PATCH v4 0/4] box: functional indexes Kirill Shcherbatov
2019-07-24  7:36 ` [PATCH v4 1/4] box: introduce tuple_chunk infrastructure Kirill Shcherbatov
2019-07-24  7:36 ` [PATCH v4 2/4] box: generalize memtx_multikey_tree methods Kirill Shcherbatov
2019-07-24 19:24   ` Konstantin Osipov
2019-07-24  7:36 ` [PATCH v4 3/4] box: refactor memtx_tree_delete_identical Kirill Shcherbatov
2019-07-24 19:24   ` Konstantin Osipov
2019-07-24  7:36 ` [PATCH v4 4/4] box: introduce functional indexes Kirill Shcherbatov
2019-07-24 12:24   ` [tarantool-patches] " Kirill Shcherbatov
2019-07-24 19:41   ` Konstantin Osipov
2019-07-24 20:04   ` Konstantin Osipov
2019-07-24 20:22   ` Konstantin Osipov
2019-07-25 11:20     ` [tarantool-patches] " Kirill Shcherbatov
2019-07-24 20:44   ` Konstantin Osipov
2019-07-25 11:22     ` [tarantool-patches] " Kirill Shcherbatov
2019-07-24 21:07   ` Konstantin Osipov
2019-07-25  8:27     ` [tarantool-patches] " Kirill Shcherbatov
2019-07-25  8:40       ` Konstantin Osipov
2019-07-25 11:18         ` Kirill Shcherbatov
2019-07-24 21:17   ` Konstantin Osipov
2019-07-24 21:56   ` Konstantin Osipov
2019-07-25  8:33     ` [tarantool-patches] " Kirill Shcherbatov
2019-07-24 12:25 ` Kirill Shcherbatov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c109c7be-257d-539c-d377-16f359641867@tarantool.org \
    --to=kshcherbatov@tarantool.org \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [tarantool-patches] [PATCH v4 4/5] box: fix memtx_tree_index_build_array_deduplicate' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox