Skip to content
Snippets Groups Projects
Commit b9afef16 authored by Nikita Pettik's avatar Nikita Pettik Committed by Kirill Yukhin
Browse files

Remove affinity from field definition

Closes #3698
parent 037e2e44
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
......@@ -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 */
enum {
......@@ -139,11 +127,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. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment