From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id BD2282B8BA for ; Tue, 3 Apr 2018 05:47:48 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bLGxOQfYRRRu for ; Tue, 3 Apr 2018 05:47:48 -0400 (EDT) Received: from smtp37.i.mail.ru (smtp37.i.mail.ru [94.100.177.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 08FE022F7F for ; Tue, 3 Apr 2018 05:47:47 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH v2 1/1] schema:frommap() to create table or tuple References: <90ece9a705197ded006ef50155f3b1bfca4c8d8f.1522261662.git.kshcherbatov@tarantool.org> <7a5c0afb-c030-fcd2-7d86-5c92cd7fa850@tarantool.org> <01c64ee0-2344-41ac-1ff3-b39172d99fd4@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Tue, 3 Apr 2018 12:47:39 +0300 MIME-Version: 1.0 In-Reply-To: <01c64ee0-2344-41ac-1ff3-b39172d99fd4@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org, Kirill Shcherbatov Hello. Please, consider 4 comments below. > diff --git a/src/box/lua/space.cc b/src/box/lua/space.cc > index 29a9aca..2ff9a11 100644 > --- a/src/box/lua/space.cc > +++ b/src/box/lua/space.cc > @@ -32,11 +32,13 @@ > #include "box/lua/tuple.h" > #include "lua/utils.h" > #include "lua/trigger.h" > +#include "box/schema.h" > > extern "C" { > #include > #include > #include > + #include > } /* extern "C" */ 1. Schema.h is included below. Trivia/util.h is not needed here. > + space = space_by_id(id); > + if (!space) > + luaL_error(L, "Specified space is not exists"); > + 2. Please, for pointers use explicit != NULL. 3. As I noted earlier, a function must not raise an error. It must return nil + error message/object. And please, check your comments grammar: you can not say "is not exists". Perhaps, you meant "does not exist". 4. I do not see my crash test in your space_frommap.test.lua. When I provide you a test, or you found an own, you must add it to the patch.