From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp29.i.mail.ru (smtp29.i.mail.ru [94.100.177.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 1EC974696C3 for ; Tue, 11 Feb 2020 00:18:52 +0300 (MSK) References: <20200210161609.GJ1110@tarantool.org> From: Vladislav Shpilevoy Message-ID: <5c69219b-9dde-f9ef-403e-7b6f4456f4bd@tarantool.org> Date: Mon, 10 Feb 2020 22:18:50 +0100 MIME-Version: 1.0 In-Reply-To: <20200210161609.GJ1110@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH v2 4/4] tuple: use field type in update of a float/double List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikita Pettik Cc: tarantool-patches@dev.tarantool.org Thanks for the review! The test was broken here. I fixed it and added a new test for update operations, having a common prefix. To test that xrow_update_route.c uses correct index base for JSON indexes. ================================================================================ diff --git a/test/box/update.result b/test/box/update.result index 04866006a..65f14ea86 100644 --- a/test/box/update.result +++ b/test/box/update.result @@ -1736,9 +1736,10 @@ _ = s:delete{1} --- ... -- Check deep fields. -_ = s:create_index('deep_sk', {'field3', 'double', path = '[1].key1.key2[2]'}) +_ = s:create_index('deep_sk', { \ + parts = {{'field3', 'double', path = '[1].key1.key2[2]'}} \ +}) --- -- error: Illegal parameters, unexpected option '1' ... _ = s:replace{1, dbl1, {{key1 = {key2 = {1, dbl1}}}}} --- @@ -1747,6 +1748,13 @@ s:update({1}, {{'+', 'field3[1].key1.key2[2]', dbl1}}) --- - [1, 1, [{'key1': {'key2': [1, 2]}}]] ... +-- Check update operations with common prefix. +s:update({1}, { \ + {'=', 'field3[1].key1.key3', 100}, {'+', 'field3[1].key1.key2[2]', dbl1} \ +}) +--- +- [1, 1, [{'key1': {'key2': [1, 3], 'key3': 100}}]] +... s:drop() --- ... diff --git a/test/box/update.test.lua b/test/box/update.test.lua index d52be4f3b..d4a2f455c 100644 --- a/test/box/update.test.lua +++ b/test/box/update.test.lua @@ -654,8 +654,14 @@ _ = s:replace{1, dbl1, 1} s:update({1}, {{'+', 2, dbl1}}) _ = s:delete{1} -- Check deep fields. -_ = s:create_index('deep_sk', {'field3', 'double', path = '[1].key1.key2[2]'}) +_ = s:create_index('deep_sk', { \ + parts = {{'field3', 'double', path = '[1].key1.key2[2]'}} \ +}) _ = s:replace{1, dbl1, {{key1 = {key2 = {1, dbl1}}}}} s:update({1}, {{'+', 'field3[1].key1.key2[2]', dbl1}}) +-- Check update operations with common prefix. +s:update({1}, { \ + {'=', 'field3[1].key1.key3', 100}, {'+', 'field3[1].key1.key2[2]', dbl1} \ +}) s:drop()