MDEV-35042 Vector indexes are allowed for MERGE tables, but do not

disallow hlindexes in MERGE - because we cannot create the secondary
table *in the same engine*
This commit is contained in:
Sergei Golubchik 2024-09-30 22:17:47 +02:00
parent 0932c3a27e
commit b3afd9f640
3 changed files with 20 additions and 0 deletions

View file

@ -44,3 +44,10 @@ drop table t, t2;
#
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'
#
# MDEV-35042 Vector indexes are allowed for MERGE tables, but do not
#
create table t (a int, v blob not null, vector index(v)) engine=myisam;
create table tm (a int, v blob not null, vector index(v)) engine=merge union=(t);
ERROR HY000: Table storage engine 'MERGE' does not support the create option 'VECTOR'
drop table t;

View file

@ -47,3 +47,11 @@ drop table t, t2;
--echo #
--error ER_ILLEGAL_HA_CREATE_OPTION
create table t (v binary(255) not null, vector index(v)) engine=memory;
--echo #
--echo # MDEV-35042 Vector indexes are allowed for MERGE tables, but do not
--echo #
create table t (a int, v blob not null, vector index(v)) engine=myisam;
--error ER_ILLEGAL_HA_CREATE_OPTION
create table tm (a int, v blob not null, vector index(v)) engine=merge union=(t);
drop table t;

View file

@ -1555,6 +1555,11 @@ int ha_myisammrg::create(const char *name, TABLE *form,
{
char buff[FN_REFLEN];
DBUG_ENTER("ha_myisammrg::create");
if (form->s->total_keys > form->s->keys)
{
my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0), "MERGE", "VECTOR");
DBUG_RETURN(HA_ERR_UNSUPPORTED);
}
fn_format(buff, name, "", MYRG_NAME_EXT, MY_UNPACK_FILENAME | MY_APPEND_EXT);
int res= create_mrg(buff, create_info);
DBUG_RETURN(res);