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 7D3722536C for ; Fri, 11 May 2018 16:59:49 -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 BU9moE_7DCJ1 for ; Fri, 11 May 2018 16:59:49 -0400 (EDT) Received: from smtp42.i.mail.ru (smtp42.i.mail.ru [94.100.177.102]) (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 123662532C for ; Fri, 11 May 2018 16:59:48 -0400 (EDT) Received: by smtp42.i.mail.ru with esmtpa (envelope-from ) id 1fHF8k-0003aM-K7 for tarantool-patches@freelists.org; Fri, 11 May 2018 23:59:46 +0300 Subject: [tarantool-patches] Re: [PATCH v5 1/3] sql: fix code style in sqlite3Pragma References: From: Vladislav Shpilevoy Message-ID: Date: Fri, 11 May 2018 23:59:42 +0300 MIME-Version: 1.0 In-Reply-To: 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 Hello. Thanks for the patch. I have pushed my review fixes on the branch. Look at them, digest, and squash. On 11/05/2018 11:49, Kirill Shcherbatov wrote: > --- > src/box/sql/pragma.c | 56 +++++++++++++++++++++++++--------------------------- > 1 file changed, 27 insertions(+), 29 deletions(-) > > diff --git a/src/box/sql/pragma.c b/src/box/sql/pragma.c > index e41f69b..b9038b7 100644 > --- a/src/box/sql/pragma.c > +++ b/src/box/sql/pragma.c > @@ -544,37 +544,35 @@ sqlite3Pragma(Parse * pParse, Token * pId, /* First part of [schema.]id field */ > > #ifndef SQLITE_OMIT_FOREIGN_KEY > case PragTyp_FOREIGN_KEY_LIST:{ > - if (zRight) { > - FKey *pFK; > - Table *pTab; > - pTab = sqlite3HashFind(&db->pSchema->tblHash, > - zRight); > - if (pTab != NULL) { > - pFK = pTab->pFKey; > - if (pFK) { > - int i = 0; > - pParse->nMem = 8; > - while (pFK) { > - int j; > - for (j = 0; > - j < pFK->nCol; > - j++) { > - sqlite3VdbeMultiLoad(v, 1, "iissssss", i, j, pFK->zTo, pTab->aCol[pFK->aCol[j].iFrom].zName, pFK->aCol[j].zCol, actionName(pFK->aAction[1]), /* ON UPDATE */ > - actionName(pFK->aAction[0]), /* ON DELETE */ > - "NONE"); > - sqlite3VdbeAddOp2 > - (v, > - OP_ResultRow, > - 1, 8); > - } > - ++i; > - pFK = pFK->pNextFrom; > - } > - } > - } > - } > + if (zRight == NULL) > + break; > + FKey *pFK; > + Table *pTab; > + pTab = sqlite3HashFind(&db->pSchema->tblHash, zRight); > + if (pTab == NULL) > break; > + pFK = pTab->pFKey; > + if (pFK == NULL) > + break; > + int i = 0; > + pParse->nMem = 8; > + while (pFK != NULL) { > + for (int j = 0; j < pFK->nCol; j++) { > + const char *name = > + pTab->aCol[pFK->aCol[j].iFrom].zName; > + sqlite3VdbeMultiLoad(v, 1, "iissssss", i, j, > + pFK->zTo, name, > + pFK->aCol[j].zCol, > + actionName(pFK->aAction[1]), > + actionName(pFK->aAction[0]), > + "NONE"); > + sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 8); > + } > + ++i; > + pFK = pFK->pNextFrom; > } > + break; > + } > #endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */ > > #ifndef SQLITE_OMIT_FOREIGN_KEY >