summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-03-05 13:35:29 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-03-09 19:37:27 +0530
commit8f4a3bf07cc9d3f42899314411da344dabd66c5e (patch)
treefe096954fc4e4897a49334d16c15ae945740b994
parent1dff411e84d5c2ef672619a5b211210454798449 (diff)
downloadmariadb-git-8f4a3bf07cc9d3f42899314411da344dabd66c5e.tar.gz
MDEV-25057 Assertion `n_fields < dtuple_get_n_fields(entry)'
failed in dtuple_convert_big_rec In dtuple_convert_big_rec(), InnoDB fails to consider the instant metadata blob while choosing the variable length field.
-rw-r--r--mysql-test/suite/innodb/r/instant_alter.result13
-rw-r--r--mysql-test/suite/innodb/t/instant_alter.test14
-rw-r--r--storage/innobase/data/data0data.cc2
3 files changed, 28 insertions, 1 deletions
diff --git a/mysql-test/suite/innodb/r/instant_alter.result b/mysql-test/suite/innodb/r/instant_alter.result
index e0661557159..b803d968836 100644
--- a/mysql-test/suite/innodb/r/instant_alter.result
+++ b/mysql-test/suite/innodb/r/instant_alter.result
@@ -2841,3 +2841,16 @@ t1 CREATE TABLE `t1` (
KEY `i1` (`a`) COMMENT 'comment2'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
+#
+# MDEV-25057 Assertion `n_fields < dtuple_get_n_fields(entry)'
+# failed in dtuple_convert_big_rec
+#
+CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT,
+a CHAR(255) NOT NULL,
+b CHAR(255) NOT NULL, c INT) ENGINE=InnoDB CHARSET utf32;
+ALTER TABLE t1 DROP c;
+INSERT INTO t1(a, b) SELECT '', '' FROM seq_1_to_16;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+16
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/instant_alter.test b/mysql-test/suite/innodb/t/instant_alter.test
index 83dca4cb5a6..3d567cb0704 100644
--- a/mysql-test/suite/innodb/t/instant_alter.test
+++ b/mysql-test/suite/innodb/t/instant_alter.test
@@ -1,4 +1,5 @@
--source include/innodb_page_size.inc
+--source include/have_sequence.inc
--echo #
--echo # MDEV-11369: Instant ADD COLUMN for InnoDB
@@ -903,3 +904,16 @@ CREATE INDEX i1 ON t1(a) COMMENT 'comment1';
ALTER TABLE t1 DROP INDEX i1, ADD INDEX i1(a) COMMENT 'comment2', ALGORITHM=INSTANT;
SHOW CREATE TABLE t1;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-25057 Assertion `n_fields < dtuple_get_n_fields(entry)'
+--echo # failed in dtuple_convert_big_rec
+--echo #
+CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT,
+ a CHAR(255) NOT NULL,
+ b CHAR(255) NOT NULL, c INT) ENGINE=InnoDB CHARSET utf32;
+ALTER TABLE t1 DROP c;
+INSERT INTO t1(a, b) SELECT '', '' FROM seq_1_to_16;
+SELECT COUNT(*) FROM t1;
+# Cleanup
+DROP TABLE t1;
diff --git a/storage/innobase/data/data0data.cc b/storage/innobase/data/data0data.cc
index 36fc484b82f..fe849d8ae29 100644
--- a/storage/innobase/data/data0data.cc
+++ b/storage/innobase/data/data0data.cc
@@ -686,7 +686,7 @@ dtuple_convert_big_rec(
goto skip_field;
}
- longest_i = i;
+ longest_i = i + mblob;
longest = savings;
skip_field: