[Tarantool-patches] [PATCH 2.X v2.1 1/4] module api: export box_tuple_validate

Timur Safin tsafin at tarantool.org
Sun Oct 11 18:51:01 MSK 2020


: From: Vladislav Shpilevoy <v.shpilevoy at tarantool.org>
: Subject: Re: [Tarantool-patches] [PATCH 2.X v2.1 1/4] module api: export
: box_tuple_validate
: 
: Hi! Thanks for the patch!
: 
: On 11.10.2020 16:39, Timur Safin wrote:
: > For external merger we need means to validate tuple data,
: > thus exporting `box_tuple_validate` which is wrapper around
: > `tuple_validate_raw` without revealing access to tuple
: > internals.
: >
: > Part of #5384
: > ---
: >  src/box/tuple.c |  6 ++++++
: >  src/box/tuple.h | 11 +++++++++++
: >  src/exports.h   |  1 +
: >  3 files changed, 18 insertions(+)
: >
: > diff --git a/src/box/tuple.c b/src/box/tuple.c
: > index f3965476e..ddf41567c 100644
: > --- a/src/box/tuple.c
: > +++ b/src/box/tuple.c
: > @@ -748,6 +748,12 @@ box_tuple_new(box_tuple_format_t *format, const
: char *data, const char *end)
: >  	return tuple_bless(ret);
: >  }
: >
: > +int
: > +box_tuple_validate(box_tuple_format_t *format, box_tuple_t *tuple)
: 
: If a function is a method of an object, it should have the object
: name in prefix, and have the object pointer in the first argument.
: For example, box_tuple_to_buf(), box_tuple_field(), box_tuple_update(),
: box_tuple_upsert().
: 
: So here the tuple should be the first argument.

Indeed, that makes sense. 



More information about the Tarantool-patches mailing list