MDEV-35152 DATA/INDEX DIRECTORY options are ignored for vector index
Let high-level indexes honor INDEX DIRECTORY table option
This commit is contained in:
parent
1a85ae444a
commit
29823f3b96
60
mysql-test/main/vector_symlink.result
Normal file
60
mysql-test/main/vector_symlink.result
Normal file
@ -0,0 +1,60 @@
|
||||
#
|
||||
# MDEV-35152 - DATA/INDEX DIRECTORY options are ignored for vector index
|
||||
#
|
||||
create table t1id (a vector(1) not null, vector(a)) engine=InnoDB data directory '$MYSQL_TMP_DIR';
|
||||
create table t1ii (a vector(1) not null, vector(a)) engine=InnoDB index directory '$MYSQL_TMP_DIR';
|
||||
create table t1md (a vector(1) not null, vector(a)) engine=MyISAM data directory '$MYSQL_TMP_DIR';
|
||||
create table t1mi (a vector(1) not null, vector(a)) engine=MyISAM index directory '$MYSQL_TMP_DIR';
|
||||
show create table t1id;
|
||||
Table Create Table
|
||||
t1id CREATE TABLE `t1id` (
|
||||
`a` vector(1) NOT NULL,
|
||||
VECTOR KEY `a` (`a`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci DATA DIRECTORY='MYSQL_TMP_DIR/'
|
||||
show create table t1ii;
|
||||
Table Create Table
|
||||
t1ii CREATE TABLE `t1ii` (
|
||||
`a` vector(1) NOT NULL,
|
||||
VECTOR KEY `a` (`a`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
|
||||
show create table t1md;
|
||||
Table Create Table
|
||||
t1md CREATE TABLE `t1md` (
|
||||
`a` vector(1) NOT NULL,
|
||||
VECTOR KEY `a` (`a`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci DATA DIRECTORY='MYSQL_TMP_DIR/'
|
||||
show create table t1mi;
|
||||
Table Create Table
|
||||
t1mi CREATE TABLE `t1mi` (
|
||||
`a` vector(1) NOT NULL,
|
||||
VECTOR KEY `a` (`a`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci INDEX DIRECTORY='MYSQL_TMP_DIR/'
|
||||
######### MYSQL_TMP_DIR:
|
||||
t1md.MYD
|
||||
t1mi#i#00.MYD
|
||||
t1mi#i#00.MYI
|
||||
t1mi.MYI
|
||||
######### MYSQL_TMP_DIR/test:
|
||||
t1id.ibd
|
||||
t1ii#i#00.ibd
|
||||
######### datadir/test:
|
||||
t1id#i#00.ibd
|
||||
t1id.frm
|
||||
t1id.isl
|
||||
t1ii#i#00.isl
|
||||
t1ii.frm
|
||||
t1ii.ibd
|
||||
t1md#i#00.MYD
|
||||
t1md#i#00.MYI
|
||||
t1md.MYD
|
||||
t1md.MYI
|
||||
t1md.frm
|
||||
t1mi#i#00.MYD
|
||||
t1mi#i#00.MYI
|
||||
t1mi.MYD
|
||||
t1mi.MYI
|
||||
t1mi.frm
|
||||
drop table t1id, t1ii, t1md, t1mi;
|
||||
######### MYSQL_TMP_DIR:
|
||||
######### MYSQL_TMP_DIR/test:
|
||||
######### datadir/test:
|
38
mysql-test/main/vector_symlink.test
Normal file
38
mysql-test/main/vector_symlink.test
Normal file
@ -0,0 +1,38 @@
|
||||
--source include/have_symlink.inc
|
||||
--source include/not_windows.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-35152 - DATA/INDEX DIRECTORY options are ignored for vector index
|
||||
--echo #
|
||||
--let $datadir= `select @@datadir`
|
||||
evalp create table t1id (a vector(1) not null, vector(a)) engine=InnoDB data directory '$MYSQL_TMP_DIR';
|
||||
evalp create table t1ii (a vector(1) not null, vector(a)) engine=InnoDB index directory '$MYSQL_TMP_DIR';
|
||||
evalp create table t1md (a vector(1) not null, vector(a)) engine=MyISAM data directory '$MYSQL_TMP_DIR';
|
||||
evalp create table t1mi (a vector(1) not null, vector(a)) engine=MyISAM index directory '$MYSQL_TMP_DIR';
|
||||
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
show create table t1id;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
show create table t1ii;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
show create table t1md;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
show create table t1mi;
|
||||
|
||||
--echo ######### MYSQL_TMP_DIR:
|
||||
--list_files $MYSQL_TMP_DIR/ t1*
|
||||
--echo ######### MYSQL_TMP_DIR/test:
|
||||
--list_files $MYSQL_TMP_DIR/test/ t1*
|
||||
--echo ######### datadir/test:
|
||||
--list_files $datadir/test/ t1*
|
||||
|
||||
drop table t1id, t1ii, t1md, t1mi;
|
||||
|
||||
--echo ######### MYSQL_TMP_DIR:
|
||||
--list_files $MYSQL_TMP_DIR/ t1*
|
||||
--echo ######### MYSQL_TMP_DIR/test:
|
||||
--list_files $MYSQL_TMP_DIR/test/ t1*
|
||||
--echo ######### datadir/test:
|
||||
--list_files $datadir/test/ t1*
|
@ -6465,12 +6465,19 @@ int ha_create_table(THD *thd, const char *path, const char *db,
|
||||
DBUG_ASSERT(share.key_info[share.keys].algorithm == HA_KEY_ALG_VECTOR);
|
||||
TABLE_SHARE index_share;
|
||||
char file_name[FN_REFLEN+1];
|
||||
char index_file_name[FN_REFLEN+1], *index_file_name_end;
|
||||
Alter_info index_ainfo;
|
||||
HA_CREATE_INFO index_cinfo;
|
||||
char *path_end= strmov(file_name, path);
|
||||
|
||||
bzero((char*) &index_cinfo, sizeof(index_cinfo));
|
||||
index_cinfo.alter_info= &index_ainfo;
|
||||
if (create_info->index_file_name)
|
||||
{
|
||||
index_file_name_end= strmov(index_file_name, create_info->index_file_name);
|
||||
index_cinfo.index_file_name= index_file_name;
|
||||
index_cinfo.data_file_name= index_file_name;
|
||||
}
|
||||
|
||||
if ((error= share.path.length > sizeof(file_name) - HLINDEX_BUF_LEN))
|
||||
goto err;
|
||||
@ -6478,6 +6485,8 @@ int ha_create_table(THD *thd, const char *path, const char *db,
|
||||
for (uint i= share.keys; i < share.total_keys; i++)
|
||||
{
|
||||
my_snprintf(path_end, HLINDEX_BUF_LEN, HLINDEX_TEMPLATE, i);
|
||||
if (create_info->index_file_name)
|
||||
my_snprintf(index_file_name_end, HLINDEX_BUF_LEN, HLINDEX_TEMPLATE, i);
|
||||
init_tmp_table_share(thd, &index_share, db, 0, table_name, file_name, 1);
|
||||
index_share.db_plugin= share.db_plugin;
|
||||
LEX_CSTRING sql= mhnsw_hlindex_table_def(thd, ref_length);
|
||||
|
Loading…
x
Reference in New Issue
Block a user