[tarantool-patches] Re: [PATCH v3 2/7] lib: introduce a new json_path_multikey_offset helper

Vladimir Davydov vdavydov.dev at gmail.com
Wed Apr 3 21:02:08 MSK 2019


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.



More information about the Tarantool-patches mailing list