[MDEV-17196] Crash during instant ADD COLUMN with long DEFAULT value Created: 2018-09-14  Updated: 2018-09-14  Resolved: 2018-09-14

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.3.2
Fix Version/s: 10.3.10

Type: Bug Priority: Critical
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: assertion, instant

Issue Links:
Problem/Incident
is caused by MDEV-11369 Instant add column for InnoDB Closed
Relates
relates to MDEV-17197 "1713: Undo log record is too big" fo... Confirmed

 Description   

thiru reported a crash with the following instant ADD COLUMN operation that involves splitting the leftmost leaf page and storing a default value off-page:

create table t1(f1 int, f2 int not null)engine=innodb;
insert into t1 values(1, 2);
alter table t1 add column f3 int not null default 4, algorithm=instant;
alter table t1 add column f4 blob not null default repeat('a', 9999), algorithm=instant;
check table t1;
drop table t1;

For the second alter table, an assertion would fail in a debug build:

10.3 ed49f9aae2ad4f8d89294e91fba6a9ec704ded49

btr/btr0cur.cc:4679: dberr_t btr_cur_pessimistic_update(ulint, btr_cur_t*, ulint**, mem_heap_t**, mem_heap_t*, big_rec_t**, upd_t*, ulint, que_thr_t*, trx_id_t, mtr_t*): Assertion `flags & BTR_KEEP_POS_FLAG' failed.

In a non-debug build, no assertion fails for this test, and the test passes. Theoretically, it might be possible that the default values stored off-page could be attached to a wrong record.


Generated at Thu Feb 08 08:34:38 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.