Browse Source

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

MEMORY engine doesn't support blobs
remotes/origin/11.8-MDEV-21978-p1-bnestere
Sergei Golubchik 1 year ago
parent
commit
824a63852b
  1. 5
      mysql-test/main/vector2.result
  2. 6
      mysql-test/main/vector2.test
  3. 6
      storage/heap/ha_heap.cc

5
mysql-test/main/vector2.result

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

6
mysql-test/main/vector2.test

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

6
storage/heap/ha_heap.cc

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

Loading…
Cancel
Save