From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 1D9006EC40; Thu, 12 Aug 2021 21:13:41 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1D9006EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1628792021; bh=8L+pZqikGok8tqsakSs5hyvZkHkRpRY/RGsO00tmjvI=; h=To:Cc:References:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=H6w0rZpmzsHTJbO6BMyaTNuCfCI/0s/EmuljNAFvOB1GElTg3W1xFKH+O8zRZedWY m/VqmmdNOINQ2LHKEsg5emdD6EwWhicMdgD+5TCxrB9O7TUA78GNShI4SnT42jaDjw XXmTx6xOhdpH9eJ13luJEKdM2SnIvajxiUGf62dw= Received: from smtp57.i.mail.ru (smtp57.i.mail.ru [217.69.128.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 16FCA6EC40 for ; Thu, 12 Aug 2021 21:13:40 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 16FCA6EC40 Received: by smtp57.i.mail.ru with esmtpa (envelope-from ) id 1mEFD0-0006yN-TW; Thu, 12 Aug 2021 21:13:39 +0300 To: Vladimir Davydov Cc: tarantool-patches@dev.tarantool.org References: Message-ID: Date: Thu, 12 Aug 2021 21:13:34 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD906AB4890CDABF0C5CB76CEE71D3E4007182A05F538085040F78708C8130198B08132D5DC3CBC51D3808B0C9101B961F8DEFDB3F81185BDF2 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7FEAC828D2BF6EC3CEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006373880C950E4B364568638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D89C58FF94EB0D6705D6F41536B5DEC721117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18CB629EEF1311BF91D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE7B96B19DC4093321D7C2347B1D03E769D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE3B355ED1E20F5346A9735652A29929C6CC4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637B8F435DEDE9E76EBEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458834459D11680B505BD8442085E5B59F573E077EDC13B5701 X-C1DE0DAB: 0D63561A33F958A59FC6EF4F1511D0C2C2CF144D838AE8D940D0C06346C8EBAED59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA752DA3D96DA0CEF5C48E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A783A638E01A3CDE1ACFCCBEC50BECE1760E7E556D797A1608378767478BFF6140A7BC55F33BF7141D7E09C32AA3244C5E40AEF824156949F26A1D9E6AFD6C18E646F07CC2D4F3D8729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojKW4rnL99YhI/KqHPzzWtWA== X-Mailru-Sender: DCB18673505F245B5D9D3B35E842BD3CE68CDDB50B400B59B3F91BAD62D22CC6E07714D7F3A8A37B841FB911095AA09146E8006E22572C39C920B61C43410E8717BDA556287159EE9437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH] net.box: allow to store user-defined fields in future object X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On 12.08.2021 21:02, Vladislav Shpilevoy via Tarantool-patches wrote: > Hi! Thanks for the patch! > > See 3 comments below. > >> diff --git a/src/box/lua/net_box.c b/src/box/lua/net_box.c >> index 06e574cdf746..162ff6c82fb0 100644 >> --- a/src/box/lua/net_box.c >> +++ b/src/box/lua/net_box.c > <...> > >> + >> +static int >> +luaT_netbox_request_newindex(struct lua_State *L) >> +{ >> + struct netbox_request *request = luaT_check_netbox_request(L, 1); >> + struct mh_strnptr_t *h = request->index; >> + size_t field_name_len; >> + const char *field_name = lua_tolstring(L, 2, &field_name_len); >> + if (field_name == NULL) >> + return luaL_error(L, "invalid index"); >> + int field_value_ref = luaL_ref(L, LUA_REGISTRYINDEX); >> + if (field_value_ref == LUA_REFNIL) { >> + /* The field is set to nil. Delete it from the index. */ > > 1. But it is not deleted. It is just ignored, which is fine, but > the comment is wrong then. Sorry, nevermind. I looked at h == NULL below and misinterpreted it in a hurry. >> + if (h == NULL) >> + return 0;