Commit e5b48fae authored by Sergei Golubchik's avatar Sergei Golubchik

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*
parent 6e56a2ce
......@@ -51,3 +51,10 @@ create table t (a int primary key, v blob not null, vector index(v));
alter table t modify a int auto_increment, lock=none;
ERROR 0A000: LOCK=NONE is not supported. Reason: CHANGE COLUMN ... AUTO_INCREMENT. Try LOCK=SHARED
drop table t;
#
# 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;
......@@ -56,3 +56,10 @@ create table t (a int primary key, v blob not null, vector index(v));
alter table t modify a int auto_increment, lock=none;
drop table t;
--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;
......@@ -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);
......
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