[tarantool-patches] [PATCH 8/8] Remove affinity from field definition

Nikita Pettik korablev at tarantool.org
Fri Dec 28 12:34:52 MSK 2018


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





More information about the Tarantool-patches mailing list