mirror of
https://github.com/MariaDB/server.git
synced 2025-08-05 13:16:09 +03:00
MDEV-35039 Number of indexes inside InnoDB differs from that defined in MariaDB after altering table with vector key
don't show table->s->total_keys to engine in inplace alter
This commit is contained in:
@@ -103,3 +103,17 @@ select pk,hex(v) from t;
|
||||
pk hex(v)
|
||||
1 B047263C9F87233FCFD27E3EAE493E3F0329F43E
|
||||
drop table t;
|
||||
#
|
||||
# MDEV-35039 Number of indexes inside InnoDB differs from that defined in MariaDB after altering table with vector key
|
||||
#
|
||||
create table t (v blob not null, vector index (v)) row_format=compressed engine=innodb;
|
||||
alter table t add f int;
|
||||
insert into t values (x'00000000',1);
|
||||
show create table t;
|
||||
Table Create Table
|
||||
t CREATE TABLE `t` (
|
||||
`v` blob NOT NULL,
|
||||
`f` int(11) DEFAULT NULL,
|
||||
VECTOR KEY `v` (`v`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ROW_FORMAT=COMPRESSED
|
||||
drop table t;
|
||||
|
@@ -87,3 +87,12 @@ create table t (pk int primary key, v varbinary(1024) not null, vector key(v)) e
|
||||
insert into t values (1, x'B047263C9F87233fcfd27e3eae493e3f0329f43e');
|
||||
select pk,hex(v) from t;
|
||||
drop table t;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-35039 Number of indexes inside InnoDB differs from that defined in MariaDB after altering table with vector key
|
||||
--echo #
|
||||
create table t (v blob not null, vector index (v)) row_format=compressed engine=innodb;
|
||||
alter table t add f int;
|
||||
insert into t values (x'00000000',1);
|
||||
show create table t;
|
||||
drop table t;
|
||||
|
@@ -7319,10 +7319,17 @@ static bool fill_alter_inplace_info(THD *thd, TABLE *table,
|
||||
Adding/dropping any indexes in a table that already has high-level indexes
|
||||
may shift high-level indexes numbers. And thus require high-level indexes
|
||||
rename, which algorithm=inplace (storage engines) shouldn't do.
|
||||
|
||||
If we aren't adding/dropping indexes, ha_alter_info->key_count is
|
||||
table->s->total_keys, but must be table->s->keys to not confuse the engine.
|
||||
*/
|
||||
if (table->s->hlindexes() &&
|
||||
(ha_alter_info->index_drop_count || ha_alter_info->index_add_count))
|
||||
ha_alter_info->inplace_supported= HA_ALTER_INPLACE_NOT_SUPPORTED;
|
||||
if (table->s->hlindexes())
|
||||
{
|
||||
if (ha_alter_info->index_drop_count || ha_alter_info->index_add_count)
|
||||
ha_alter_info->inplace_supported= HA_ALTER_INPLACE_NOT_SUPPORTED;
|
||||
else
|
||||
ha_alter_info->key_count= table->s->keys;
|
||||
}
|
||||
|
||||
DBUG_PRINT("exit", ("handler_flags: %llu", ha_alter_info->handler_flags));
|
||||
DBUG_RETURN(false);
|
||||
|
Reference in New Issue
Block a user