mirror of
https://github.com/MariaDB/server.git
synced 2025-01-28 17:54:16 +01:00
Fixed TRUNCATE TABLE against VECTOR indexes
This patch fixes only TRUNCATE by recreate variant, there seem to be no reasonable engine that uses TRUNCATE by handler method for testing. Reset index_cinfo so that mi_create is not confused by garbage passed via index_file_name and sets MY_DELETE_OLD flag. Review question: can we add a test case to make sure VECTOR index is empty indeed?
This commit is contained in:
parent
91a24ddc5d
commit
70575defb7
3 changed files with 27 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue