diff --git a/mysql-test/main/vector.result b/mysql-test/main/vector.result index 351ee953ad4..f80f56e523a 100644 --- a/mysql-test/main/vector.result +++ b/mysql-test/main/vector.result @@ -302,3 +302,19 @@ id hex(v) 20 6CA1D43E9DF91B3FE580DA3E1C247D3F147CF33E drop table t1, t2; db.opt +create table t1 (id int auto_increment primary key, v blob not null, vector index (v)); +truncate table t1; +insert t1 (v) values (x'e360d63ebe554f3fcdbc523f4522193f5236083d'); +truncate table t1; +select * from t1; +id v +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `v` blob NOT NULL, + PRIMARY KEY (`id`), + VECTOR KEY `v` (`v`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci +drop table t1; +db.opt diff --git a/mysql-test/main/vector.test b/mysql-test/main/vector.test index c74f9717db2..f3d4c7ccfa8 100644 --- a/mysql-test/main/vector.test +++ b/mysql-test/main/vector.test @@ -101,3 +101,13 @@ insert into t1 select * from t2; select id, hex(v) from t1; drop table t1, t2; list_files $datadir/test; + +create table t1 (id int auto_increment primary key, v blob not null, vector index (v)); +truncate table t1; +insert t1 (v) values (x'e360d63ebe554f3fcdbc523f4522193f5236083d'); +truncate table t1; +select * from t1; +replace_result InnoDB MyISAM; +show create table t1; +drop table t1; +list_files $datadir/test; diff --git a/sql/handler.cc b/sql/handler.cc index b90472ad2bb..3c385e620a4 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -6424,6 +6424,7 @@ int ha_create_table(THD *thd, const char *path, const char *db, 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 ((error= share.path.length > sizeof(file_name) - HLINDEX_BUF_LEN))