mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 02:51:44 +01:00
MDEV-20479 assertion failure in dict_table_get_nth_col() after INSTANT DROP COLUMN
get_col_list_to_be_dropped() incorrectly returned uninteresting instantly dropped column which was missing in a new dict_index_t get_col_list_to_be_dropped(): rename to collect_columns_from_dropped_indexes and stop return dropped columns
This commit is contained in:
parent
4f10d0918d
commit
7bccd2910f
3 changed files with 28 additions and 4 deletions
|
@ -261,3 +261,11 @@ a
|
|||
1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-20479: assertion failure in dict_table_get_nth_col() after INSTANT DROP COLUMN
|
||||
#
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
ALTER TABLE t1 ADD COLUMN (b INT, c INT, d INT, e INT NOT NULL DEFAULT 0);
|
||||
ALTER TABLE t1 ADD UNIQUE INDEX(e);
|
||||
ALTER TABLE t1 DROP b, DROP c, DROP d, DROP e;
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -266,3 +266,14 @@ ROLLBACK;
|
|||
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-20479: assertion failure in dict_table_get_nth_col() after INSTANT DROP COLUMN
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
ALTER TABLE t1 ADD COLUMN (b INT, c INT, d INT, e INT NOT NULL DEFAULT 0);
|
||||
ALTER TABLE t1 ADD UNIQUE INDEX(e);
|
||||
ALTER TABLE t1 DROP b, DROP c, DROP d, DROP e;
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -9935,8 +9935,7 @@ commit_cache_rebuild(
|
|||
/** Set of column numbers */
|
||||
typedef std::set<ulint, std::less<ulint>, ut_allocator<ulint> > col_set;
|
||||
|
||||
/** Store the column number of the columns in a list belonging
|
||||
to indexes which are not being dropped.
|
||||
/** Collect (not instantly dropped) columns from dropped indexes
|
||||
@param[in] ctx In-place ALTER TABLE context
|
||||
@param[in, out] drop_col_list list which will be set, containing columns
|
||||
which is part of index being dropped
|
||||
|
@ -9945,7 +9944,7 @@ to indexes which are not being dropped.
|
|||
being dropped */
|
||||
static
|
||||
void
|
||||
get_col_list_to_be_dropped(
|
||||
collect_columns_from_dropped_indexes(
|
||||
const ha_innobase_inplace_ctx* ctx,
|
||||
col_set& drop_col_list,
|
||||
col_set& drop_v_col_list)
|
||||
|
@ -9966,6 +9965,12 @@ get_col_list_to_be_dropped(
|
|||
|
||||
} else {
|
||||
ulint col_no = dict_col_get_no(idx_col);
|
||||
if (ctx->col_map
|
||||
&& ctx->col_map[col_no]
|
||||
== ULINT_UNDEFINED) {
|
||||
// this column was instantly dropped
|
||||
continue;
|
||||
}
|
||||
drop_col_list.insert(col_no);
|
||||
}
|
||||
}
|
||||
|
@ -10287,7 +10292,7 @@ commit_cache_norebuild(
|
|||
/* Check if the column, part of an index to be dropped is part of any
|
||||
other index which is not being dropped. If it so, then set the ord_part
|
||||
of the column to 0. */
|
||||
get_col_list_to_be_dropped(ctx, drop_list, v_drop_list);
|
||||
collect_columns_from_dropped_indexes(ctx, drop_list, v_drop_list);
|
||||
|
||||
for (col_it = drop_list.begin(); col_it != drop_list.end(); ++col_it) {
|
||||
if (!check_col_exists_in_indexes(ctx->new_table,
|
||||
|
|
Loading…
Add table
Reference in a new issue