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 DFB7A25000 for ; Thu, 31 May 2018 13:37:00 -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 dLUyHBTCJPXu for ; Thu, 31 May 2018 13:37:00 -0400 (EDT) Received: from smtp54.i.mail.ru (smtp54.i.mail.ru [217.69.128.34]) (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 076A024FB0 for ; Thu, 31 May 2018 13:36:52 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH v1 1/4] box: move db->pShchema init to sql_init References: <80e32b9cb08cd33972e4e223197ef1944e319ce5.1527765756.git.kshcherbatov@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Thu, 31 May 2018 20:36:50 +0300 MIME-Version: 1.0 In-Reply-To: <80e32b9cb08cd33972e4e223197ef1944e319ce5.1527765756.git.kshcherbatov@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: Kirill Shcherbatov , tarantool-patches@freelists.org Thanks for the patch! On 31/05/2018 14:22, Kirill Shcherbatov wrote: > As we are going to call parser on box.cfg() to recreate triggers > from SQL, we should initialize Schema as it used in sqlite3BeginTrigger. > > Part of #3273. > --- > src/box/sql.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/src/box/sql.c b/src/box/sql.c > index 7379cb4..47d1739 100644 > --- a/src/box/sql.c > +++ b/src/box/sql.c > @@ -77,11 +77,18 @@ sql_init() > panic("failed to initialize SQL subsystem"); > > assert(db != NULL); > + /* Initialize pSchema to use SQL parser. */ To use for what? Before what? I see it in the commit message, but lets explain this in the comment as well. > + db->pSchema = sqlite3SchemaCreate(db); > + if (db->pSchema == NULL) { > + sqlite3_close(db); > + panic("failed to initialize SQL Schema subsystem"); > + } > } >