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 0290923C35 for ; Fri, 28 Dec 2018 04:35:04 -0500 (EST) 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 u8MqUp2JQuYA for ; Fri, 28 Dec 2018 04:35:03 -0500 (EST) Received: from smtp40.i.mail.ru (smtp40.i.mail.ru [94.100.177.100]) (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 A7C2722A30 for ; Fri, 28 Dec 2018 04:35:03 -0500 (EST) From: Nikita Pettik Subject: [tarantool-patches] [PATCH 8/8] Remove affinity from field definition Date: Fri, 28 Dec 2018 11:34:52 +0200 Message-Id: <6ef30fbe8c4919daf71c7b42be21a6fb6e3cb55d.1545987214.git.korablev@tarantool.org> In-Reply-To: References: In-Reply-To: References: 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 Cc: v.shpilevoy@tarantool.org, Nikita Pettik Closes #3698 --- src/box/field_def.c | 20 -------------------- src/box/field_def.h | 17 ----------------- 2 files changed, 37 deletions(-) diff --git a/src/box/field_def.c b/src/box/field_def.c index b34d2ccd9..0ba3d3294 100644 --- a/src/box/field_def.c +++ b/src/box/field_def.c @@ -47,15 +47,6 @@ const char *mp_type_strs[] = { /* .MP_EXT = */ "extension", }; -static const char *affinity_type_strs[] = { - /* [UNDEFINED] */ "undefined", - /* [BLOB - 'A'] */ "blob", - /* [TEXT - 'A'] */ "text", - /* [NUMERIC - 'A'] */ "numeric", - /* [INTEGER - 'A'] */ "integer", - /* [REAL - 'A'] */ "real", -}; - const uint32_t field_mp_type[] = { /* [FIELD_TYPE_ANY] = */ UINT32_MAX, /* [FIELD_TYPE_UNSIGNED] = */ 1U << MP_UINT, @@ -71,15 +62,6 @@ const uint32_t field_mp_type[] = { /* [FIELD_TYPE_MAP] = */ (1U << MP_MAP), }; -const char * -affinity_type_str(enum affinity_type type) -{ - if (type < 'A') - return affinity_type_strs[type]; - else - return affinity_type_strs[type - 'A' + 1]; -} - const char *field_type_strs[] = { /* [FIELD_TYPE_ANY] = */ "any", /* [FIELD_TYPE_UNSIGNED] = */ "unsigned", @@ -142,13 +124,11 @@ const struct opt_def field_def_reg[] = { nullable_action, NULL), OPT_DEF("collation", OPT_UINT32, struct field_def, coll_id), OPT_DEF("default", OPT_STRPTR, struct field_def, default_value), - OPT_DEF("affinity", OPT_UINT32, struct field_def, affinity), OPT_END, }; const struct field_def field_def_default = { .type = FIELD_TYPE_ANY, - .affinity = AFFINITY_UNDEFINED, .name = NULL, .is_nullable = false, .nullable_action = ON_CONFLICT_ACTION_DEFAULT, diff --git a/src/box/field_def.h b/src/box/field_def.h index 93e38ea55..9a3d0b1ac 100644 --- a/src/box/field_def.h +++ b/src/box/field_def.h @@ -73,18 +73,6 @@ enum on_conflict_action { on_conflict_action_MAX }; -enum affinity_type { - AFFINITY_UNDEFINED = 0, - AFFINITY_BLOB = 'A', - AFFINITY_TEXT = 'B', - AFFINITY_INTEGER = 'D', - AFFINITY_REAL = 'E', -}; - -/** String name of @a type. */ -const char * -affinity_type_str(enum affinity_type type); - /** \endcond public */ extern const char *field_type_strs[]; @@ -123,11 +111,6 @@ struct field_def { * then UNKNOWN is stored for it. */ enum field_type type; - /** - * Affinity type for comparations in SQL. - * FIXME: Remove affinity after types redesign in SQL. - */ - enum affinity_type affinity; /** 0-terminated field name. */ char *name; /** True, if a field can store NULL. */ -- 2.15.1