Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Sergey Ostanevich <sergos@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 3/3] tuple: JSON path update intersection at maps
Date: Fri, 27 Dec 2019 18:52:03 +0300	[thread overview]
Message-ID: <b40e6304-300c-3e1c-967f-9065732e5ddd@tarantool.org> (raw)
In-Reply-To: <20191227145704.GB1222@tarantool.org>

Thanks for the review!

On 27/12/2019 15:57, Sergey Ostanevich wrote:
> Hi!
> 
> Thanks for the patch!
> Just the spaces after unaries - otherwise LGTM.

Fixed:

================================================================================
diff --git a/src/box/xrow_update_map.c b/src/box/xrow_update_map.c
index 65dcb7408..b4251cc3b 100644
--- a/src/box/xrow_update_map.c
+++ b/src/box/xrow_update_map.c
@@ -224,7 +224,7 @@ xrow_update_op_do_map_insert(struct xrow_update_op *op,
 	struct xrow_update_map_item *item;
 	if (xrow_update_map_extract_opt_item(field, op, &item) != 0)
 		return -1;
-	if (! xrow_update_op_is_term(op)) {
+	if (!xrow_update_op_is_term(op)) {
 		if (item == NULL)
 			return xrow_update_err_no_such_field(op);
 		op->is_token_consumed = true;
@@ -247,7 +247,7 @@ xrow_update_op_do_map_set(struct xrow_update_op *op,
 	struct xrow_update_map_item *item;
 	if (xrow_update_map_extract_opt_item(field, op, &item) != 0)
 		return -1;
-	if (! xrow_update_op_is_term(op)) {
+	if (!xrow_update_op_is_term(op)) {
 		if (item == NULL)
 			return xrow_update_err_no_such_field(op);
 		op->is_token_consumed = true;
@@ -275,7 +275,7 @@ xrow_update_op_do_map_delete(struct xrow_update_op *op,
 	struct xrow_update_map_item *item;
 	if (xrow_update_map_extract_opt_item(field, op, &item) != 0)
 		return -1;
-	if (! xrow_update_op_is_term(op)) {
+	if (!xrow_update_op_is_term(op)) {
 		if (item == NULL)
 			return xrow_update_err_no_such_field(op);
 		op->is_token_consumed = true;
@@ -318,7 +318,7 @@ xrow_update_op_do_map_##op_type(struct xrow_update_op *op,			\
 		xrow_update_map_extract_item(field, op);			\
 	if (item == NULL)							\
 		return -1;							\
-	if (! xrow_update_op_is_term(op)) {					\
+	if (!xrow_update_op_is_term(op)) {					\
 		op->is_token_consumed = true;					\
 		return xrow_update_op_do_field_##op_type(op, &item->field);	\
 	}									\
================================================================================

> 
> If I got it right, the limitation from the #2 patch:
> 
> |    This is not allowed yet:
> |    
> |        [1][2][3].a.b.c = 20
> |        [1][2][3].a.e.f = 30
> |    
> |        First difference is 'b' vs 'e' - intersection by a map,
> |        not ok.
> 
> is removed. Could you mention this in the description?
> 

Sure. New commit message (prior to doc request):

================================================================================
    tuple: JSON path update intersection at maps
    
    Previous commits introduced isolated JSON updates, and then
    allowed intersection at array. This one completes the puzzle,
    adding intersection at maps, so now both these samples work:
    
    Allowed in the previous commit:
    
        [1][2][3].a.b.c = 20
        [1][2][4].e.f.g = 30
               ^
    
        First difference is [3] vs [4] - intersection by an array.
    
    Allowed in this commit:
    
        [1][2][3].a.b.c = 20
        [1][2][3].a.e.f = 30
                    ^
    
        First difference is 'b' vs 'e' - intersection by a map.
    
    Now JSON updates are fully available.
    
    Closes #1261

================================================================================

  reply	other threads:[~2019-12-27 15:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-23 22:41 [Tarantool-patches] [PATCH 0/3] JSON update Vladislav Shpilevoy
2019-12-23 22:41 ` [Tarantool-patches] [PATCH 1/3] tuple: make update operation tokens consumable Vladislav Shpilevoy
2019-12-24 16:15   ` Vladislav Shpilevoy
2019-12-26 12:07   ` Sergey Ostanevich
2019-12-27 13:00     ` Vladislav Shpilevoy
2019-12-27 14:59       ` Sergey Ostanevich
2019-12-23 22:41 ` [Tarantool-patches] [PATCH 2/3] tuple: JSON path update intersection at arrays Vladislav Shpilevoy
2019-12-27 14:13   ` Sergey Ostanevich
2019-12-27 15:52     ` Vladislav Shpilevoy
2019-12-23 22:41 ` [Tarantool-patches] [PATCH 3/3] tuple: JSON path update intersection at maps Vladislav Shpilevoy
2019-12-27 14:57   ` Sergey Ostanevich
2019-12-27 15:52     ` Vladislav Shpilevoy [this message]
2019-12-30  5:26 ` [Tarantool-patches] [PATCH 0/3] JSON update Kirill Yukhin

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=b40e6304-300c-3e1c-967f-9065732e5ddd@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=sergos@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 3/3] tuple: JSON path update intersection at maps' \
    /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