Commit 39414dbc authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-35043 Unsuitable error upon an attempt to create MEMORY table with vector key

MEMORY engine doesn't support blobs
parent a39970cf
......@@ -39,3 +39,8 @@ set session mhnsw_max_edges_per_node = @@mhnsw_max_edges_per_node + 1;
create table t2 like t;
alter table t force;
drop table t, t2;
#
# MDEV-35043 Unsuitable error upon an attempt to create MEMORY table with vector key
#
create table t (v binary(255) not null, vector index(v)) engine=memory;
ERROR HY000: Table storage engine 'MEMORY' does not support the create option 'VECTOR'
......@@ -41,3 +41,9 @@ set session mhnsw_max_edges_per_node = @@mhnsw_max_edges_per_node + 1;
create table t2 like t;
alter table t force;
drop table t, t2;
--echo #
--echo # MDEV-35043 Unsuitable error upon an attempt to create MEMORY table with vector key
--echo #
--error ER_ILLEGAL_HA_CREATE_OPTION
create table t (v binary(255) not null, vector index(v)) engine=memory;
......@@ -651,6 +651,12 @@ static int heap_prepare_hp_create_info(TABLE *table_arg, bool internal_table,
bzero(hp_create_info, sizeof(*hp_create_info));
if (share->total_keys > keys)
{
my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0), "MEMORY", "VECTOR");
return HA_ERR_UNSUPPORTED;
}
for (key= parts= 0; key < keys; key++)
parts+= table_arg->key_info[key].user_defined_key_parts;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment