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

MEMORY engine doesn't support blobs
This commit is contained in:
Sergei Golubchik 2024-09-30 19:12:31 +02:00
parent 9f80e3fbb7
commit 824a63852b
3 changed files with 17 additions and 0 deletions

View file

@ -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'

View file

@ -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;

View file

@ -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;