From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 3 Apr 2019 21:02:08 +0300 From: Vladimir Davydov Subject: Re: [tarantool-patches] Re: [PATCH v3 2/7] lib: introduce a new json_path_multikey_offset helper Message-ID: <20190403180208.wevtpatl5a77jfmc@esperanza> References: <20190403125601.unoe7qjdl6clqd55@esperanza> <6becaa9e-9d2f-1fbe-7748-9c04b016b45f@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6becaa9e-9d2f-1fbe-7748-9c04b016b45f@tarantool.org> To: Kirill Shcherbatov Cc: tarantool-patches@freelists.org List-ID: On Wed, Apr 03, 2019 at 07:22:57PM +0300, Kirill Shcherbatov wrote: > > IMO returning path_len if no multikey token is found would be more > > common (think of STL methods, which return end() iterator if not found). > > Doesn't really matter though. > > > > Other than that looks good to me. > > I don't mind. Updated version is on the branch. > > ================================================== > > Introduced a new procedure json_path_multikey_offset. This helper > scans the JSON path string and returns the offset of the first character > [*] (the array index placeholder). > > We need this function in the scope of the multikey index patchset to > extract the number of keys to be inserted into the index > using JSON subpath that has json_path_multikey_offset() length. > > Needed for #1257 > --- > src/lib/json/json.c | 18 ++++++++++++++++++ > src/lib/json/json.h | 10 ++++++++++ > test/unit/json.c | 32 +++++++++++++++++++++++++++++++- > test/unit/json.result | 12 +++++++++++- > 4 files changed, 70 insertions(+), 2 deletions(-) Pushed to master.