summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2021-11-08 19:39:13 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2021-11-08 19:39:13 +0100
commitde2fa9eced796a38bf2a194f35589f6eef814483 (patch)
tree531402e9099d1a2c7c2b29db93303e2347498134 /sql
parenta19ab67318760f8f155ef7f4f821dfc738542c67 (diff)
parent227b782ad6a6b199caa5dc1c034f6dbe4e44fca8 (diff)
downloadmariadb-git-de2fa9eced796a38bf2a194f35589f6eef814483.tar.gz
Merge branch '10.4' into bb-10.4-release
Diffstat (limited to 'sql')
-rw-r--r--sql/field.h3
-rw-r--r--sql/table.cc5
2 files changed, 8 insertions, 0 deletions
diff --git a/sql/field.h b/sql/field.h
index a51f279e59b..c19a501f1f9 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -475,6 +475,7 @@ enum enum_vcol_info_type
{
VCOL_GENERATED_VIRTUAL, VCOL_GENERATED_STORED,
VCOL_DEFAULT, VCOL_CHECK_FIELD, VCOL_CHECK_TABLE,
+ VCOL_USING_HASH,
/* Additional types should be added here */
/* Following is the highest value last */
VCOL_TYPE_NONE = 127 // Since the 0 value is already in use
@@ -492,6 +493,8 @@ static inline const char *vcol_type_name(enum_vcol_info_type type)
case VCOL_CHECK_FIELD:
case VCOL_CHECK_TABLE:
return "CHECK";
+ case VCOL_USING_HASH:
+ return "USING HASH";
case VCOL_TYPE_NONE:
return "UNTYPED";
}
diff --git a/sql/table.cc b/sql/table.cc
index 9a2b2819455..4df5af7a6c3 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1065,6 +1065,8 @@ static void mysql57_calculate_null_position(TABLE_SHARE *share,
}
}
+static bool fix_and_check_vcol_expr(THD *thd, TABLE *table,
+ Virtual_column_info *vcol);
/** Parse TABLE_SHARE::vcol_defs
@@ -1256,6 +1258,9 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table,
Virtual_column_info *v= new (mem_root) Virtual_column_info();
field->vcol_info= v;
field->vcol_info->expr= hash_item;
+ field->vcol_info->set_vcol_type(VCOL_USING_HASH);
+ if (fix_and_check_vcol_expr(thd, table, v))
+ goto end;
key->user_defined_key_parts= key->ext_key_parts= key->usable_key_parts= 1;
key->key_part+= parts;