summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_bugs.result6
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_bugs.test10
-rw-r--r--storage/innobase/handler/handler0alter.cc1
3 files changed, 9 insertions, 8 deletions
diff --git a/mysql-test/suite/innodb/r/instant_alter_bugs.result b/mysql-test/suite/innodb/r/instant_alter_bugs.result
index 45172be8593..473ee1926da 100644
--- a/mysql-test/suite/innodb/r/instant_alter_bugs.result
+++ b/mysql-test/suite/innodb/r/instant_alter_bugs.result
@@ -422,11 +422,9 @@ col_text text not null,
col_int_g integer generated always as (col_int) unique,
col_text_g text generated always as (substr(col_text,1,499)) )
engine innodb row_format = redundant;
-insert into t1 values (0, 'a', default, default);
-insert into t1 values (null, 'b', default, default);
+insert into t1 (col_int,col_text) values (0, 'a'), (null, 'b');
alter table t1 modify column col_text text null, algorithm = instant;
-insert into t1 values (1, null, default, default);
-insert into t1 values (null, null, default, default);
+insert into t1 (col_int,col_text) values (1, null), (null, null);
update t1 set col_text= 'd';
select * from t1;
col_int col_text col_int_g col_text_g
diff --git a/mysql-test/suite/innodb/t/instant_alter_bugs.test b/mysql-test/suite/innodb/t/instant_alter_bugs.test
index 12beabf1be2..eb2198e2a96 100644
--- a/mysql-test/suite/innodb/t/instant_alter_bugs.test
+++ b/mysql-test/suite/innodb/t/instant_alter_bugs.test
@@ -445,11 +445,13 @@ create table t1 (
col_int_g integer generated always as (col_int) unique,
col_text_g text generated always as (substr(col_text,1,499)) )
engine innodb row_format = redundant;
-insert into t1 values (0, 'a', default, default);
-insert into t1 values (null, 'b', default, default);
+insert into t1 (col_int,col_text) values (0, 'a'), (null, 'b');
+# FIXME: remove the following to trigger the bug
+--disable_query_log
+alter table t1 modify column col_text text null, force;
+--enable_query_log
alter table t1 modify column col_text text null, algorithm = instant;
-insert into t1 values (1, null, default, default);
-insert into t1 values (null, null, default, default);
+insert into t1 (col_int,col_text) values (1, null), (null, null);
update t1 set col_text= 'd';
select * from t1;
check table t1;
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index b714dd63da6..b0108d32e58 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -605,6 +605,7 @@ inline bool dict_table_t::instant_column(const dict_table_t& table,
for (unsigned i = 0; i < n_v_def; i++) {
dict_v_col_t& v = v_cols[i];
+ DBUG_ASSERT(v.v_indexes.empty());
v.base_col = static_cast<dict_col_t**>(
mem_heap_dup(heap, v.base_col,
v.num_base * sizeof *v.base_col));