From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [tarantool-patches] [PATCH v4 4/5] box: fix memtx_tree_index_build_array_deduplicate References: From: Kirill Shcherbatov Message-ID: Date: Wed, 24 Jul 2019 15:25:44 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit To: tarantool-patches@freelists.org, kostja@tarantool.org Cc: vdavydov.dev@gmail.com List-ID: 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