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 1E2EF2BEDC for ; Wed, 3 Oct 2018 16:08: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 ifBW-rUccU3o for ; Wed, 3 Oct 2018 16:08:00 -0400 (EDT) Received: from smtp35.i.mail.ru (smtp35.i.mail.ru [94.100.177.95]) (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 D46CB2B93A for ; Wed, 3 Oct 2018 16:07:59 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH 2/2] sql: remove unused SQLITE_CONSTRAINT_ error codes References: <160387838b78fe8387a9896f34140a66b887a4f4.1538511704.git.ivushkinalex@gmail.com> From: Vladislav Shpilevoy Message-ID: <058b7126-eae2-bd15-792c-ad56a02e5b85@tarantool.org> Date: Wed, 3 Oct 2018 23:07:56 +0300 MIME-Version: 1.0 In-Reply-To: <160387838b78fe8387a9896f34140a66b887a4f4.1538511704.git.ivushkinalex@gmail.com> 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, AlexeyIvushkin Thanks for the patch! On 02/10/2018 23:50, AlexeyIvushkin wrote: > From: Morgan-iv > > Remove SQLITE_CONSTRAINT_ error codes that only defined, but don't used > anywhere. Change its implementation from define macro to enum statement. > > Part of #3315 > --- > src/box/sql/main.c | 9 --------- > src/box/sql/sqliteInt.h | 13 ++++++------- > 2 files changed, 6 insertions(+), 16 deletions(-) > > diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h > index 00c0309..5c031e1 100644 > --- a/src/box/sql/sqliteInt.h > +++ b/src/box/sql/sqliteInt.h > @@ -619,13 +619,12 @@ enum sql_ioerr_code { > SQLITE_IOERR_GETTEMPPATH = (SQLITE_IOERR | (11<<8)) > }; > > -#define SQLITE_CONSTRAINT_CHECK (SQLITE_CONSTRAINT | (1<<8)) > -#define SQLITE_CONSTRAINT_FOREIGNKEY (SQLITE_CONSTRAINT | (3<<8)) > -#define SQLITE_CONSTRAINT_FUNCTION (SQLITE_CONSTRAINT | (4<<8)) > -#define SQLITE_CONSTRAINT_NOTNULL (SQLITE_CONSTRAINT | (5<<8)) > -#define SQLITE_CONSTRAINT_PRIMARYKEY (SQLITE_CONSTRAINT | (6<<8)) 1. Still visible here: tarantool/test/sql-tap/unique.test.lua: 75 }) 76 77: -- verify_ex_errcode unique-1.3b SQLITE_CONSTRAINT_PRIMARYKEY 78 test:do_execsql_test( 79 "unique-1.4", > -#define SQLITE_CONSTRAINT_TRIGGER (SQLITE_CONSTRAINT | (7<<8)) > -#define SQLITE_CONSTRAINT_UNIQUE (SQLITE_CONSTRAINT | (8<<8)) 2. The same. > +enum sql_constrant_code { > + SQLITE_CONSTRAINT_CHECK = (SQLITE_CONSTRAINT | (1<<8)), > + SQLITE_CONSTRAINT_FOREIGNKEY = (SQLITE_CONSTRAINT | (2<<8)), > + SQLITE_CONSTRAINT_NOTNULL = (SQLITE_CONSTRAINT | (3<<8)), > + SQLITE_CONSTRAINT_TRIGGER = (SQLITE_CONSTRAINT | (4<<8)) > +}; > > enum sql_type { > SQLITE_INTEGER = 1, >