[PATCH v9 2/6] box: introduce tuple_field_raw_by_path routine

Vladimir Davydov vdavydov.dev at gmail.com
Mon Feb 4 13:37:23 MSK 2019


On Sun, Feb 03, 2019 at 01:20:22PM +0300, Kirill Shcherbatov wrote:
> Introduced a new function tuple_field_raw_by_path is used to get
> tuple fields by field index and relative JSON path. This routine
> uses tuple_format's field_map if possible. It will be further
> extended to use JSON indexes.
> The old tuple_field_raw_by_path routine used to work with full
> JSON paths, renamed tuple_field_raw_by_full_path. It's return
> value type is changed to const char * because the other similar
> functions tuple_field_raw and tuple_field_by_part_raw use this
> convention.
> Got rid of reporting error position for 'invalid JSON path' error
> in lbox_tuple_field_by_path because we can't extend other
> routines to behave such way that makes an API inconsistent,
> moreover such error are useless and confusing.
> 
> Needed for #1012
> ---
>  src/box/lua/tuple.c      |   9 +--
>  src/box/tuple.h          |  60 +++++++++---------
>  src/box/tuple_format.c   |  63 ++++++-------------
>  src/box/tuple_format.h   | 127 +++++++++++++++++++++------------------
>  test/engine/tuple.result |  16 ++---
>  5 files changed, 129 insertions(+), 146 deletions(-)

Pushed to 2.1.



More information about the Tarantool-patches mailing list