Commit 05d62518 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-22651: Bogus assertion in dict_table_t::init_instant()

In commit 0e5a4ac2 (MDEV-15562)
we introduced a bogus debug assertion, demanding that dict_col_t::len
never exceed some maximum value. The intention was to match what
dict_index_add_col() is doing. But, the assignment field->fixed_len = 0
applies to dict_field_t::fixed_len, not dict_col_t::len!
parent 3d76af08
......@@ -399,4 +399,12 @@ INSERT INTO t1 SET a=1, b=NULL;
ALTER TABLE t1 MODIFY COLUMN b INT FIRST;
ALTER TABLE t1 ADD UNIQUE INDEX (va);
DROP TABLE t1;
#
# MDEV-22651 Assertion dict_col_get_fixed_size...
# in dict_table_t::init_instant()
#
CREATE TABLE t (i INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t SET i=1;
ALTER TABLE t ADD e CHAR(255) CHARACTER SET UTF32 FIRST, ALGORITHM=INSTANT;
DROP TABLE t;
SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
......@@ -419,4 +419,14 @@ ALTER TABLE t1 MODIFY COLUMN b INT FIRST;
ALTER TABLE t1 ADD UNIQUE INDEX (va);
DROP TABLE t1;
--echo #
--echo # MDEV-22651 Assertion dict_col_get_fixed_size...
--echo # in dict_table_t::init_instant()
--echo #
--source include/have_innodb.inc
CREATE TABLE t (i INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t SET i=1;
ALTER TABLE t ADD e CHAR(255) CHARACTER SET UTF32 FIRST, ALGORITHM=INSTANT;
DROP TABLE t;
SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
......@@ -194,8 +194,6 @@ inline void dict_table_t::init_instant(const dict_table_t& table)
ut_d(unsigned n_nullable = 0);
for (unsigned i = u; i < index.n_fields; i++) {
auto& f = index.fields[i];
DBUG_ASSERT(dict_col_get_fixed_size(f.col, not_redundant())
<= DICT_MAX_FIXED_COL_LEN);
ut_d(n_nullable += f.col->is_nullable());
if (!f.col->is_dropped()) {
......
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