Commit e1af4601 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-18579 Assertion !ctx->online || num_fts_index == 0

instant_alter_column_possible(): Add the other MDEV-17459 work-around
condition. The existence of fulltext indexes only prevents instant
DROP COLUMN or changing the order of columns. Other forms of instant
ALTER TABLE are no problem.

Before commit 4e7ee166 that merged
the MDEV-18295 fix from 10.3, the work-around of MDEV-17459 in
instant_alter_column_possible() was categorically refusing any
ALGORITHM=INSTANT if any FULLTEXT INDEX was present. After that commit,
a related condition was only present in prepare_inplace_alter_table_dict()
but not in the other callers of instant_alter_column_possible().
parent 2b921845
......@@ -734,6 +734,9 @@ INSERT INTO t1 VALUES (1,1);
ALTER TABLE t1 ADD COLUMN f INT AFTER a;
ALTER TABLE t1 DROP b, DROP f;
DROP TABLE t1;
CREATE TABLE t1(t TEXT NOT NULL, FULLTEXT(t)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
ALTER TABLE t1 MODIFY COLUMN t TEXT;
DROP TABLE t1;
CREATE TABLE t1
(id INT PRIMARY KEY, c2 INT UNIQUE,
c3 POINT NOT NULL DEFAULT ST_GeomFromText('POINT(3 4)'),
......@@ -1414,6 +1417,9 @@ INSERT INTO t1 VALUES (1,1);
ALTER TABLE t1 ADD COLUMN f INT AFTER a;
ALTER TABLE t1 DROP b, DROP f;
DROP TABLE t1;
CREATE TABLE t1(t TEXT NOT NULL, FULLTEXT(t)) ENGINE=InnoDB ROW_FORMAT=COMPACT;
ALTER TABLE t1 MODIFY COLUMN t TEXT;
DROP TABLE t1;
CREATE TABLE t1
(id INT PRIMARY KEY, c2 INT UNIQUE,
c3 POINT NOT NULL DEFAULT ST_GeomFromText('POINT(3 4)'),
......@@ -2094,10 +2100,13 @@ INSERT INTO t1 VALUES (1,1);
ALTER TABLE t1 ADD COLUMN f INT AFTER a;
ALTER TABLE t1 DROP b, DROP f;
DROP TABLE t1;
CREATE TABLE t1(t TEXT NOT NULL, FULLTEXT(t)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
ALTER TABLE t1 MODIFY COLUMN t TEXT;
DROP TABLE t1;
disconnect analyze;
SELECT variable_value-@old_instant instants
FROM information_schema.global_status
WHERE variable_name = 'innodb_instant_alter_column';
instants
170
171
SET GLOBAL innodb_purge_rseg_truncate_frequency= @saved_frequency;
......@@ -633,6 +633,11 @@ ALTER TABLE t1 ADD COLUMN f INT AFTER a;
ALTER TABLE t1 DROP b, DROP f;
DROP TABLE t1;
# MDEV-18579 Assertion !ctx->online || num_fts_index == 0
eval CREATE TABLE t1(t TEXT NOT NULL, FULLTEXT(t)) $engine;
ALTER TABLE t1 MODIFY COLUMN t TEXT;
DROP TABLE t1;
dec $format;
}
disconnect analyze;
......
......@@ -1472,7 +1472,8 @@ instant_alter_column_possible(
& (ALTER_STORED_COLUMN_ORDER | ALTER_DROP_STORED_COLUMN
| ALTER_ADD_STORED_BASE_COLUMN)) {
#if 1 // MDEV-17459: adjust fts_fetch_doc_from_rec() and friends; remove this
if (ib_table.fts) return false;
if (ib_table.fts || innobase_fulltext_exist(altered_table))
return false;
#endif
#if 1 // MDEV-17468: fix bugs with indexed virtual columns & remove this
for (const dict_index_t* index = ib_table.indexes.start;
......@@ -6408,11 +6409,7 @@ prepare_inplace_alter_table_dict(
|| !ctx->new_table->persistent_autoinc);
if (ctx->need_rebuild() && instant_alter_column_possible(
*user_table, ha_alter_info, old_table, altered_table)
#if 1 // MDEV-17459: adjust fts_fetch_doc_from_rec() and friends; remove this
&& !innobase_fulltext_exist(altered_table)
#endif
) {
*user_table, ha_alter_info, old_table, altered_table)) {
for (uint a = 0; a < ctx->num_to_add_index; a++) {
ctx->add_index[a]->table = ctx->new_table;
ctx->add_index[a] = dict_index_add_to_cache(
......
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