diff --git a/mysql-test/suite/innodb/r/innodb-blob.result b/mysql-test/suite/innodb/r/innodb-blob.result index c2b46661e31..8a6327216d0 100644 --- a/mysql-test/suite/innodb/r/innodb-blob.result +++ b/mysql-test/suite/innodb/r/innodb-blob.result @@ -153,3 +153,9 @@ a SELECT * FROM t2; a DROP TABLE t1,t2,t3; +CREATE TABLE t1(f1 INT PRIMARY KEY, f2 TEXT)ENGINE=InnoDB +ROW_FORMAT=REDUNDANT; +SET @fill_amount = (@@innodb_page_size / 2 ) + 1 ; +INSERT INTO t1 VALUES(1, REPEAT(2, @fill_amount)); +UPDATE t1 SET f1 = 2; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb-blob.test b/mysql-test/suite/innodb/t/innodb-blob.test index fbf0641880b..301966fb41d 100644 --- a/mysql-test/suite/innodb/t/innodb-blob.test +++ b/mysql-test/suite/innodb/t/innodb-blob.test @@ -206,3 +206,10 @@ SELECT a FROM t3; SELECT * FROM t2; DROP TABLE t1,t2,t3; + +CREATE TABLE t1(f1 INT PRIMARY KEY, f2 TEXT)ENGINE=InnoDB + ROW_FORMAT=REDUNDANT; +SET @fill_amount = (@@innodb_page_size / 2 ) + 1 ; +INSERT INTO t1 VALUES(1, REPEAT(2, @fill_amount)); +UPDATE t1 SET f1 = 2; +DROP TABLE t1; diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic index 7a9b31648da..eae1c52a2a5 100644 --- a/storage/innobase/include/rem0rec.ic +++ b/storage/innobase/include/rem0rec.ic @@ -1626,7 +1626,11 @@ rec_get_converted_size( data_size = dtuple_get_data_size(dtuple, 0); - ut_ad(n_ext == dtuple_get_n_ext(dtuple)); + /* If primary key is being updated then the new record inherits + externally stored fields from the delete-marked old record. + In that case, n_ext may be less value than + dtuple_get_n_ext(tuple). */ + ut_ad(n_ext <= dtuple_get_n_ext(dtuple)); extra_size = rec_get_converted_extra_size( data_size, dtuple_get_n_fields(dtuple), n_ext);