Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Nikita Pettik <korablev@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2 4/4] tuple: use field type in update of a float/double
Date: Mon, 10 Feb 2020 22:18:50 +0100	[thread overview]
Message-ID: <5c69219b-9dde-f9ef-403e-7b6f4456f4bd@tarantool.org> (raw)
In-Reply-To: <20200210161609.GJ1110@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()

  reply	other threads:[~2020-02-10 21:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04 22:53 [Tarantool-patches] [PATCH v2 0/4] Don't truncate float in update Vladislav Shpilevoy
2020-02-04 22:53 ` [Tarantool-patches] [PATCH v2 1/4] tuple: don't truncate float in :update() Vladislav Shpilevoy
2020-02-10 14:41   ` Nikita Pettik
2020-02-10 21:18     ` Vladislav Shpilevoy
2020-02-19 21:36       ` Nikita Pettik
2020-02-04 22:53 ` [Tarantool-patches] [PATCH v2 2/4] tuple: pass tuple format to xrow_update_*_store() Vladislav Shpilevoy
2020-02-10 16:51   ` Nikita Pettik
2020-02-10 21:18     ` Vladislav Shpilevoy
2020-02-04 22:53 ` [Tarantool-patches] [PATCH v2 3/4] tuple: allow xrow_update sizeof reserve more memory Vladislav Shpilevoy
2020-02-10 16:05   ` Nikita Pettik
2020-02-04 22:53 ` [Tarantool-patches] [PATCH v2 4/4] tuple: use field type in update of a float/double Vladislav Shpilevoy
2020-02-10 16:16   ` Nikita Pettik
2020-02-10 21:18     ` Vladislav Shpilevoy [this message]
2020-02-05 11:09 ` [Tarantool-patches] [PATCH v2 0/4] Don't truncate float in update Konstantin Osipov
2020-02-05 22:11   ` Vladislav Shpilevoy
2020-02-20  6:15 ` Kirill Yukhin
2020-02-20 13:27   ` Nikita Pettik
2020-02-20 20:30   ` Vladislav Shpilevoy

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=5c69219b-9dde-f9ef-403e-7b6f4456f4bd@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 4/4] tuple: use field type in update of a float/double' \
    /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