From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp60.i.mail.ru (smtp60.i.mail.ru [217.69.128.40]) (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 A974246970E for ; Fri, 27 Dec 2019 18:52:04 +0300 (MSK) References: <248f865c70c413e5a239a2e7bae6240e1e9b93d0.1577140688.git.v.shpilevoy@tarantool.org> <20191227145704.GB1222@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Fri, 27 Dec 2019 18:52:03 +0300 MIME-Version: 1.0 In-Reply-To: <20191227145704.GB1222@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 3/3] tuple: JSON path update intersection at maps List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sergey Ostanevich Cc: tarantool-patches@dev.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 ================================================================================