Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: tarantool-patches@freelists.org, AlexeyIvushkin <ivushkinalex@gmail.com>
Subject: [tarantool-patches] Re: [PATCH 2/2] sql: remove unused SQLITE_CONSTRAINT_ error codes
Date: Wed, 3 Oct 2018 23:07:56 +0300	[thread overview]
Message-ID: <058b7126-eae2-bd15-792c-ad56a02e5b85@tarantool.org> (raw)
In-Reply-To: <160387838b78fe8387a9896f34140a66b887a4f4.1538511704.git.ivushkinalex@gmail.com>

Thanks for the patch!

On 02/10/2018 23:50, AlexeyIvushkin wrote:
> From: Morgan-iv <ivushkinalex@gmail.com>
> 
> 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,
> 

  reply	other threads:[~2018-10-03 20:08 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   ` [tarantool-patches] " Vladislav Shpilevoy
2018-10-02 20:50 ` [tarantool-patches] [PATCH 2/2] sql: remove unused SQLITE_CONSTRAINT_ " AlexeyIvushkin
2018-10-03 20:07   ` Vladislav Shpilevoy [this message]
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=058b7126-eae2-bd15-792c-ad56a02e5b85@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=ivushkinalex@gmail.com \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH 2/2] sql: remove unused SQLITE_CONSTRAINT_ 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