From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Roman Khabibov <roman.habibov@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2 3/3] box: let only box handle constraint dup errors
Date: Wed, 4 Dec 2019 19:32:58 +0300 [thread overview]
Message-ID: <20191204163258.GR10140@uranus> (raw)
In-Reply-To: <0218889f41f954a10bbe36c6d0c43f32fa7dd4b4.1575468493.git.roman.habibov@tarantool.org>
On Wed, Dec 04, 2019 at 07:23:11PM +0300, Roman Khabibov wrote:
>
> +/**
> + * Just return string with constraint type to print it in error
> + * message.
> + */
> +static inline const char *
> +cosntraint_type_str(struct constraint_def *def) {
> + switch (def->type) {
> + case CONSTRAINT_TYPE_PK:
> + return "PRIMARY KEY";
> + case CONSTRAINT_TYPE_UNIQUE:
> + return "UNIQUE";
> + case CONSTRAINT_TYPE_FK:
> + return "FOREIGN KEY";
> + case CONSTRAINT_TYPE_CK:
> + return "CHECK";
> + }
> +}
Should not here be either default case or assert()? What would
be returned if someone add a new def->type and forget about
this place?
next prev parent reply other threads:[~2019-12-04 16:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1575468493.git.roman.habibov@tarantool.org>
2019-12-04 16:23 ` Roman Khabibov
2019-12-04 16:32 ` Cyrill Gorcunov [this message]
2019-12-04 17:54 ` Konstantin Osipov
2019-12-05 18:59 ` Roman Khabibov
2019-12-05 19:13 ` Cyrill Gorcunov
2019-12-07 16:35 ` Vladislav Shpilevoy
2019-12-10 12:49 ` Roman Khabibov
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=20191204163258.GR10140@uranus \
--to=gorcunov@gmail.com \
--cc=roman.habibov@tarantool.org \
--cc=tarantool-patches@dev.tarantool.org \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH v2 3/3] box: let only box handle constraint dup errors' \
/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