From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [tarantool-patches] [PATCH v2 3/3] netbox: define formats for tuple from netbox References: <97e8c658f842bd9a623b1673f6ae752082502114.1561130584.git.imeevma@gmail.com> From: Vladislav Shpilevoy Message-ID: Date: Fri, 21 Jun 2019 22:39:39 +0200 MIME-Version: 1.0 In-Reply-To: <97e8c658f842bd9a623b1673f6ae752082502114.1561130584.git.imeevma@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit To: tarantool-patches@freelists.org, imeevma@tarantool.org Cc: vdavydov.dev@gmail.com List-ID: Thanks for the patch! > diff --git a/src/box/lua/net_box.c b/src/box/lua/net_box.c > @@ -618,6 +618,13 @@ static int > netbox_decode_select(struct lua_State *L) > { > uint32_t ctypeid; > + int top = lua_gettop(L); > + assert(top == 1 || top == 2); > + struct tuple_format *format; > + if (top == 2 && lua_type(L, 2) == LUA_TCDATA) > + format = lbox_check_tuple_format(L, 2); How is it possible, that we do not have a format here? > + else > + format = tuple_format_runtime; > const char *data = *(const char **)luaL_checkcdata(L, 1, &ctypeid); > assert(mp_typeof(*data) == MP_MAP); > uint32_t map_size = mp_decode_map(&data);