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 DAB362BC2F for ; Wed, 3 Oct 2018 16:07: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 gHcCl9fIgmpg for ; Wed, 3 Oct 2018 16:07:00 -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 99D942BC15 for ; Wed, 3 Oct 2018 16:07:00 -0400 (EDT) From: Vladislav Shpilevoy Subject: [tarantool-patches] Re: [PATCH 1/2] sql: refactor SQLITE_IOERR_ error codes References: <2a53a857d5fee3775ca34d162248c8326c39f8d6.1538511704.git.ivushkinalex@gmail.com> Message-ID: <9bb48200-f01a-0f01-86d6-6fe808e24eff@tarantool.org> Date: Wed, 3 Oct 2018 23:06:57 +0300 MIME-Version: 1.0 In-Reply-To: <2a53a857d5fee3775ca34d162248c8326c39f8d6.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! See 2 comments below. On 02/10/2018 23:50, AlexeyIvushkin wrote: > From: Morgan-iv > > Remove error codes with prefix SQLITE_IOERR_ that only defined, > but don't used anywhere. > Replace '#define' macro with enum statement in implementation of > SQLITE_IOERR_ error codes > Remove unused function xDelete from sqlite3_vfs interface and its > implementation, unixDelete. Also remove function openDirectory, used > only in unixDelete > > Part of #3315 > --- > src/box/sql/main.c | 42 ----------------------- > src/box/sql/os_unix.c | 88 ------------------------------------------------- > src/box/sql/sqliteInt.h | 43 +++++++++--------------- > 3 files changed, 15 insertions(+), 158 deletions(-) > > diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h > index 53188e7..00c0309 100644 > --- a/src/box/sql/sqliteInt.h > +++ b/src/box/sql/sqliteInt.h > @@ -605,33 +604,21 @@ sqlite3_exec(sqlite3 *, /* An open database */ > void *, /* 1st argument to callback */ > char **errmsg /* Error msg written here */ > ); > -#define SQLITE_IOERR_READ (SQLITE_IOERR | (1<<8)) > -#define SQLITE_IOERR_SHORT_READ (SQLITE_IOERR | (2<<8)) > -#define SQLITE_IOERR_WRITE (SQLITE_IOERR | (3<<8)) > -#define SQLITE_IOERR_FSYNC (SQLITE_IOERR | (4<<8)) > -#define SQLITE_IOERR_DIR_FSYNC (SQLITE_IOERR | (5<<8)) > -#define SQLITE_IOERR_TRUNCATE (SQLITE_IOERR | (6<<8)) > -#define SQLITE_IOERR_FSTAT (SQLITE_IOERR | (7<<8)) > -#define SQLITE_IOERR_UNLOCK (SQLITE_IOERR | (8<<8)) > -#define SQLITE_IOERR_RDLOCK (SQLITE_IOERR | (9<<8)) > -#define SQLITE_IOERR_DELETE (SQLITE_IOERR | (10<<8)) > -#define SQLITE_IOERR_BLOCKED (SQLITE_IOERR | (11<<8)) > -#define SQLITE_IOERR_NOMEM (SQLITE_IOERR | (12<<8)) > -#define SQLITE_IOERR_ACCESS (SQLITE_IOERR | (13<<8)) > -#define SQLITE_IOERR_CHECKRESERVEDLOCK (SQLITE_IOERR | (14<<8)) > -#define SQLITE_IOERR_LOCK (SQLITE_IOERR | (15<<8)) > -#define SQLITE_IOERR_CLOSE (SQLITE_IOERR | (16<<8)) > -#define SQLITE_IOERR_DIR_CLOSE (SQLITE_IOERR | (17<<8)) > -#define SQLITE_IOERR_SHMOPEN (SQLITE_IOERR | (18<<8)) > -#define SQLITE_IOERR_SHMSIZE (SQLITE_IOERR | (19<<8)) > -#define SQLITE_IOERR_SHMLOCK (SQLITE_IOERR | (20<<8)) > -#define SQLITE_IOERR_SHMMAP (SQLITE_IOERR | (21<<8)) > -#define SQLITE_IOERR_SEEK (SQLITE_IOERR | (22<<8)) > -#define SQLITE_IOERR_DELETE_NOENT (SQLITE_IOERR | (23<<8)) > -#define SQLITE_IOERR_MMAP (SQLITE_IOERR | (24<<8)) > -#define SQLITE_IOERR_GETTEMPPATH (SQLITE_IOERR | (25<<8)) > -#define SQLITE_IOERR_CONVPATH (SQLITE_IOERR | (26<<8)) > -#define SQLITE_IOERR_VNODE (SQLITE_IOERR | (27<<8)) > + > +enum sql_ioerr_code {> + SQLITE_IOERR_READ = (SQLITE_IOERR | (1<<8)), 1. Please, read the issue title more attentive: "sql: remove SQLITE_ prefix from error codes". But after your patch they still are SQLITE_. > + SQLITE_IOERR_SHORT_READ = (SQLITE_IOERR | (2<<8)), > + SQLITE_IOERR_WRITE = (SQLITE_IOERR | (3<<8)), > + SQLITE_IOERR_TRUNCATE = (SQLITE_IOERR | (4<<8)), > + SQLITE_IOERR_FSTAT = (SQLITE_IOERR | (5<<8)), > + SQLITE_IOERR_UNLOCK = (SQLITE_IOERR | (6<<8)), > + SQLITE_IOERR_RDLOCK = (SQLITE_IOERR | (7<<8)), > + SQLITE_IOERR_NOMEM = (SQLITE_IOERR | (8<<8)), > + SQLITE_IOERR_ACCESS = (SQLITE_IOERR | (9<<8)), > + SQLITE_IOERR_CLOSE = (SQLITE_IOERR | (10<<8)), > + SQLITE_IOERR_GETTEMPPATH = (SQLITE_IOERR | (11<<8)) > +}; 2. You removed not all unused error codes. I found unused SQLITE_IOERR_CLOSE. Please, find others if they exist. > + > #define SQLITE_CONSTRAINT_CHECK (SQLITE_CONSTRAINT | (1<<8)) > #define SQLITE_CONSTRAINT_FOREIGNKEY (SQLITE_CONSTRAINT | (3<<8)) > #define SQLITE_CONSTRAINT_FUNCTION (SQLITE_CONSTRAINT | (4<<8)) >