From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> To: tarantool-patches@freelists.org, AlexeyIvushkin <ivushkinalex@gmail.com> Subject: [tarantool-patches] Re: [PATCH 1/2] sql: refactor SQLITE_IOERR_ error codes Date: Wed, 3 Oct 2018 23:06:57 +0300 [thread overview] Message-ID: <9bb48200-f01a-0f01-86d6-6fe808e24eff@tarantool.org> (raw) In-Reply-To: <2a53a857d5fee3775ca34d162248c8326c39f8d6.1538511704.git.ivushkinalex@gmail.com> Thanks for the patch! See 2 comments below. On 02/10/2018 23:50, AlexeyIvushkin wrote: > From: Morgan-iv <ivushkinalex@gmail.com> > > 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)) >
next prev parent reply other threads:[~2018-10-03 20:07 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-10-02 20:50 [tarantool-patches] [PATCH 0/2] First part of SQLite error codes refactoring AlexeyIvushkin 2018-10-02 20:50 ` [tarantool-patches] [PATCH] box: add tuple:size function AlexeyIvushkin 2018-10-02 20:50 ` [tarantool-patches] [PATCH 1/2] sql: refactor SQLITE_IOERR_ error codes AlexeyIvushkin 2018-10-03 20:06 ` Vladislav Shpilevoy [this message] 2018-10-02 20:50 ` [tarantool-patches] [PATCH 2/2] sql: remove unused SQLITE_CONSTRAINT_ " AlexeyIvushkin 2018-10-03 20:07 ` [tarantool-patches] " Vladislav Shpilevoy 2018-10-03 20:04 ` [tarantool-patches] Re: [PATCH 0/2] First part of SQLite error codes refactoring Vladislav Shpilevoy
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=9bb48200-f01a-0f01-86d6-6fe808e24eff@tarantool.org \ --to=v.shpilevoy@tarantool.org \ --cc=ivushkinalex@gmail.com \ --cc=tarantool-patches@freelists.org \ --subject='[tarantool-patches] Re: [PATCH 1/2] sql: refactor SQLITE_IOERR_ error codes' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox