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 DCDAC27BB3 for ; Mon, 18 Mar 2019 15:34:01 -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 uq1oXWrNM2Os for ; Mon, 18 Mar 2019 15:34:01 -0400 (EDT) Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 90BE629730 for ; Mon, 18 Mar 2019 15:34:01 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH v2 3/7] sql: refactor sql_src_list_append to set diag References: <390fc2f46ba80994aa4ebf97d3aeb8ea8c26c71c.1551265819.git.kshcherbatov@tarantool.org> <4dcd389e-2388-d145-a82c-2cabc2b9ed15@tarantool.org> <8743fe4b-6485-9b72-dd40-e4d2ecab5801@tarantool.org> From: Vladislav Shpilevoy Message-ID: <2c6214c0-dc40-bb33-283b-781234ad3360@tarantool.org> Date: Mon, 18 Mar 2019 22:33:59 +0300 MIME-Version: 1.0 In-Reply-To: <8743fe4b-6485-9b72-dd40-e4d2ecab5801@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 Hi! Thanks for the fixes! See 2 comments below. > diff --git a/src/box/sql/build.c b/src/box/sql/build.c > index f53b2561c..04f65f165 100644 > --- a/src/box/sql/build.c > +++ b/src/box/sql/build.c > @@ -2821,6 +2785,7 @@ sqlSrcListAppendFromTerm(Parse * pParse, /* Parsing context */ > sqlIdListDelete(db, pUsing); > sql_select_delete(db, pSubquery); > return 0; > + > } 1. Stray empty line. Please, do self-review before sending a patch. Such a stray change says that you did not scan the patch before a send. > diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h > index 0895f7de1..2df1830d6 100644 > --- a/src/box/sql/sqlInt.h > +++ b/src/box/sql/sqlInt.h > @@ -3428,7 +3428,27 @@ sql_src_list_enlarge(struct sql *db, struct SrcList *src_list, int new_slots, > struct SrcList * > sql_src_list_new(struct sql *db); > > -SrcList *sqlSrcListAppend(sql *, SrcList *, Token *); > +/** > + * Append a new table name to the given list. Create a new > + * SrcList if need be. A new entry is created in the list even > + * if name_token is NULL. > + * > + * A SrcList is returned, or NULL if there is an OOM error. 2. This should be said in @retval sections. > + * The returned SrcList might be the same as the list that was > + * input or it might be a new one. If an OOM error does occurs, > + * then the prior value of list that is input to this routine is > + * automatically freed. > + * > + * @param db The database connection. > + * @param list Append to this SrcList. NULL creates a new SrcList. > + * @param name_token Token representing table name. > + * @retval Not NULL SrcList pointer on success. > + * @retval NULL Otherwise. The diag message is set. > + */ > +struct SrcList * > +sql_src_list_append(struct sql *db, struct SrcList *list, > + struct Token *name_token); > + > SrcList *sqlSrcListAppendFromTerm(Parse *, SrcList *, Token *, > Token *, Select *, Expr *, IdList *); > void sqlSrcListIndexedBy(Parse *, SrcList *, Token *);