MDEV-29314 Assertion `n_fields > n_cols' failed in dict_index_t::init_change_cols

- Newly created InnoDB fulltext index does have only one column
and doesn't associate with primary key fields during DDL.
init_change_cols() has strict assertion that number of fields
should be greater than number of collation change columns.
parent 03726a36
......@@ -95,3 +95,17 @@ ALTER TABLE t1 MODIFY msg_2 VARCHAR(100) CHARACTER SET utf8
COLLATE utf8_unicode_ci, ALGORITHM=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
DROP TABLE t1;
#
# MDEV-29314 Assertion `n_fields > n_cols' failed
# in dict_index_t::init_change_cols
#
CREATE TABLE t (a VARCHAR(16) COLLATE utf8_bin,
FULLTEXT (a)) ENGINE=InnoDB COLLATE utf8_unicode_520_ci;
ALTER TABLE t MODIFY COLUMN a VARCHAR(512);
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` varchar(512) COLLATE utf8mb3_unicode_520_ci DEFAULT NULL,
FULLTEXT KEY `a` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_520_ci
DROP TABLE t;
......@@ -122,4 +122,14 @@ ALTER TABLE t1 MODIFY msg_2 VARCHAR(100) CHARACTER SET utf8
COLLATE utf8_unicode_ci, ALGORITHM=inplace;
DROP TABLE t1;
--echo #
--echo # MDEV-29314 Assertion `n_fields > n_cols' failed
--echo # in dict_index_t::init_change_cols
--echo #
CREATE TABLE t (a VARCHAR(16) COLLATE utf8_bin,
FULLTEXT (a)) ENGINE=InnoDB COLLATE utf8_unicode_520_ci;
ALTER TABLE t MODIFY COLUMN a VARCHAR(512);
SHOW CREATE TABLE t;
DROP TABLE t;
--source include/wait_until_count_sessions.inc
......@@ -1345,7 +1345,7 @@ struct dict_index_t {
@param n_cols number of columns whose collation is changing */
void init_change_cols(unsigned n_cols)
{
ut_ad(n_fields > n_cols);
ut_ad(n_fields > n_cols || type & DICT_FTS);
change_col_info= static_cast<col_info*>
(mem_heap_zalloc(heap, sizeof(col_info)));
change_col_info->n_cols= n_cols;
......
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