From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> To: tarantool-patches@dev.tarantool.org, Konstantin Osipov <kostja.osipov@gmail.com> Subject: Re: [Tarantool-patches] [PATCH 1/3] tuple: make update operation tokens consumable Date: Tue, 24 Dec 2019 17:15:50 +0100 [thread overview] Message-ID: <322d01a3-3bdd-3d11-d1c7-d7d6fb75ccd3@tarantool.org> (raw) In-Reply-To: <679a1d9daedb82276388320f4078be590c1979df.1577140688.git.v.shpilevoy@tarantool.org> Hi! Thanks for the comment! Please, keep the mailing list in the CC/To next time. > -------- Forwarded Message -------- > Subject: Re: [PATCH 1/3] tuple: make update operation tokens consumable > Date: Tue, 24 Dec 2019 08:39:25 +0300 > From: Konstantin Osipov <kostja.osipov@gmail.com> > To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> > > * Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/12/24 08:34]: >> +/** >> + * Make sure @a op contains a valid field number to where the >> + * operation should be applied next. Field number may be not >> + * known, if the array's parent didn't propagate operation's >> + * lexer. In fact, the parent fills fieldno only in some rare >> + * cases like branching. Generally, an array should care about >> + * fieldno by itself. >> + */ >> +static inline int >> +xrow_update_op_prepare_num_token(struct xrow_update_op *op) >> +{ >> + /* >> + * Token type END is a special value meaning that the >> + * current token needs to be parsed. >> + */ >> + if (op->token_type == JSON_TOKEN_END && >> + xrow_update_op_consume_token(op) != 0) >> + return -1; >> + if (op->token_type != JSON_TOKEN_NUM) { >> + return xrow_update_err(op, "can't update an array by not a "\ >> + "number index"); > > non-numeric index > > > -- > Konstantin Osipov, Moscow, Russia Ok, fixed: diff --git a/src/box/xrow_update_array.c b/src/box/xrow_update_array.c index 6a7ce09ff..2eb98e8e9 100644 --- a/src/box/xrow_update_array.c +++ b/src/box/xrow_update_array.c @@ -51,8 +51,8 @@ xrow_update_op_prepare_num_token(struct xrow_update_op *op) xrow_update_op_consume_token(op) != 0) return -1; if (op->token_type != JSON_TOKEN_NUM) { - return xrow_update_err(op, "can't update an array by not a "\ - "number index"); + return xrow_update_err(op, "can't update an array by a "\ + "non-numeric index"); } return 0; }
next prev parent reply other threads:[~2019-12-24 16:15 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 [this message] 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 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=322d01a3-3bdd-3d11-d1c7-d7d6fb75ccd3@tarantool.org \ --to=v.shpilevoy@tarantool.org \ --cc=kostja.osipov@gmail.com \ --cc=tarantool-patches@dev.tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH 1/3] tuple: make update operation tokens consumable' \ /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