diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2021-06-15 13:14:39 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2021-06-15 13:15:32 +0530 |
commit | 7d591cf85090db52478facca4a0c03a2a56aa585 (patch) | |
tree | 66fc606e08f358ae34c53e83aa1806a02ee84ff4 | |
parent | 7229107e3e2c59febd10b40b243011e8bba94f99 (diff) | |
download | mariadb-git-7d591cf85090db52478facca4a0c03a2a56aa585.tar.gz |
MDEV-24713 Assertion `dict_table_is_comp(index->table)' failed in row_merge_buf_add()
- During online alter conversion from compact to redundant,
virtual column field length already set during
innobase_get_computed_value(). Skip the char(n) check for
virtual column in row_merge_buf_add()
-rw-r--r-- | mysql-test/suite/gcol/r/innodb_virtual_index.result | 14 | ||||
-rw-r--r-- | mysql-test/suite/gcol/t/innodb_virtual_index.test | 12 | ||||
-rw-r--r-- | storage/innobase/row/row0merge.cc | 5 |
3 files changed, 30 insertions, 1 deletions
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_index.result b/mysql-test/suite/gcol/r/innodb_virtual_index.result index ff339280e8a..b8dd161c30e 100644 --- a/mysql-test/suite/gcol/r/innodb_virtual_index.result +++ b/mysql-test/suite/gcol/r/innodb_virtual_index.result @@ -286,3 +286,17 @@ Warning 1264 Out of range value for column 'va' at row 1 ALTER TABLE t1 FORCE; ERROR 22003: Out of range value for column 'va' at row 1 DROP TABLE t1; +# +# MDEV-24713 Assertion `dict_table_is_comp(index->table)' failed +# in row_merge_buf_add() +# +CREATE TABLE t1 (id INT PRIMARY KEY, a CHAR(3), +b CHAR(8) AS (a) VIRTUAL, KEY(b)) +ROW_FORMAT=REDUNDANT ENGINE=InnoDB +CHARACTER SET utf8; +INSERT INTO t1 (id,a) VALUES (1,'foo'); +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +DROP TABLE t1; diff --git a/mysql-test/suite/gcol/t/innodb_virtual_index.test b/mysql-test/suite/gcol/t/innodb_virtual_index.test index 9e765ca104c..94c3b7f9204 100644 --- a/mysql-test/suite/gcol/t/innodb_virtual_index.test +++ b/mysql-test/suite/gcol/t/innodb_virtual_index.test @@ -302,3 +302,15 @@ INSERT IGNORE INTO t1 (id, a) VALUES (NULL, -1); --error ER_WARN_DATA_OUT_OF_RANGE ALTER TABLE t1 FORCE; DROP TABLE t1; + +--echo # +--echo # MDEV-24713 Assertion `dict_table_is_comp(index->table)' failed +--echo # in row_merge_buf_add() +--echo # +CREATE TABLE t1 (id INT PRIMARY KEY, a CHAR(3), + b CHAR(8) AS (a) VIRTUAL, KEY(b)) + ROW_FORMAT=REDUNDANT ENGINE=InnoDB + CHARACTER SET utf8; +INSERT INTO t1 (id,a) VALUES (1,'foo'); +OPTIMIZE TABLE t1; +DROP TABLE t1; diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 93ea4d2d743..9e6179585b1 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -691,7 +691,10 @@ error: continue; } - if (field->len != UNIV_SQL_NULL + /* innobase_get_computed_value() sets the + length of the virtual column field. */ + if (v_col == NULL + && field->len != UNIV_SQL_NULL && col->mtype == DATA_MYSQL && col->len != field->len) { if (conv_heap != NULL) { |