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 48166275F4 for ; Fri, 16 Aug 2019 08:57:17 -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 ilKFgTbTl03W for ; Fri, 16 Aug 2019 08:57:17 -0400 (EDT) Received: from smtp52.i.mail.ru (smtp52.i.mail.ru [94.100.177.112]) (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 075A3275F2 for ; Fri, 16 Aug 2019 08:57:16 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH v2 8/8] box: get rid of box.internal.sql_function_create References: <8c42515c61f85e03dcd5abe35055b9301379de0a.1565275470.git.kshcherbatov@tarantool.org> From: Kirill Shcherbatov Message-ID: <9c0dfbfc-5cf2-5d9b-a7f4-f9e4140f6294@tarantool.org> Date: Fri, 16 Aug 2019 15:57:14 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit 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, "n.pettik" >> +struct sql_context; > > Nit: forward declaration of sql_context is redundant. >> + uint32_t size; > > Nit: I’d better call it mem_count (or at least add brief explanation comment). Fixed. > + * allocated on the fiber()->gc, in which case the caller >> + * is responsible for cleaning up. >> + */ > > Consider comment fixes: Applied. >> +static struct Mem * >> +vdbemem_alloc_on_region(uint32_t count) > > Nit: we already have sql_vdbe_mem_alloc_region() > which allocates memory for string using region. > Could you rename it (the original one I mean) to avoid > any confusions? Renamed to sql_vdbe_mem_alloc_blob_region >> +static const char * >> +port_vdbemem_get_msgpack(struct port *base, uint32_t *size) > > In fact, this function is unused and is not tested at all. It is not so. Take a look to box/function1.test.lua >> + mpstream_encode_str(&stream, >> + (const char *) sql_value_text(param)); > > Nit: a bit broken indentation. You can use auxiliary tmp var. Fixed. >> + * Register P3 must not be one of the function inputs. > > Nit: you don’t check this fact. It is just recommendation for a user. Plz Forget about it. (moreover it *never* tested in other places) > Oh, could you please fix this awful error message? > At least, it lacks a verb. Personally I would prefer smth like: > “invalid number of arguments is passed to %s: expected %d, got %d" Fixed as a separate patch.