Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.3.2
Description
This issue was first found during the development of MDEV-12894. As mentioned in MDEV-13900, a part of innodb.instant_alter test would crash when the test is run with special parameters. With these parameters, MDEV-12894 is adding a hidden column to the PRIMARY KEY and converting certain UPDATE to UPDATE and INSERT.
The test below reproduces the problem in plain MariaDB 10.3 when system versioning is not used.
--source include/have_innodb.inc
|
|
CREATE TABLE t2 |
(id INT, foo INT DEFAULT 0, c1 VARCHAR(4000), |
p GEOMETRY NOT NULL DEFAULT ST_GeomFromText('LINESTRING(0 0,0 1,1 1)'), |
PRIMARY KEY(id,foo)) |
ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
|
|
INSERT INTO t2 (id,c1) VALUES (1, REPEAT('a', 4000)), (2, REPEAT('a', 4000)); |
ALTER TABLE t2 ADD COLUMN d1 INT; |
|
BEGIN; |
UPDATE t2 SET c1 = repeat('1', 4000), foo=1 WHERE id=1; |
INSERT INTO t2 (id,c1) VALUES (1, REPEAT('a', 4000)); |
UPDATE t2 SET c1 = repeat('2', 4000), foo=1 WHERE id=2; |
ROLLBACK; |
|
BEGIN; |
UPDATE t2 SET d1 = 1,foo=2 WHERE id=1; |
INSERT INTO t2 (id,foo,c1) VALUES (1, 1, REPEAT('1', 4000)); |
COMMIT; |
|
DROP TABLE t2; |
The last INSERT that crashes must for some reason be in the same transaction as the UPDATE. I have optimized away an INSERT from the first (rolled-back) transaction, because the crash reproduces also without it:
stack trace |
lock/lock0lock.cc:3836(lock_move_rec_list_start(buf_block_t const*, buf_block_t const*, unsigned char const*, unsigned char const*))[0x1c98ce3]
|
page/page0page.cc:940(page_copy_rec_list_start(buf_block_t*, buf_block_t*, unsigned char*, dict_index_t*, mtr_t*))[0x1d99991]
|
page/page0page.cc:1402(page_move_rec_list_start(buf_block_t*, buf_block_t*, unsigned char*, dict_index_t*, mtr_t*))[0x1d9c9f5]
|
btr/btr0btr.cc:3165(btr_page_split_and_insert(unsigned long, btr_cur_t*, unsigned long**, mem_block_info_t**, dtuple_t const*, unsigned long, mtr_t*))[0x21a523d]
|
btr/btr0cur.cc:3463(btr_cur_pessimistic_insert(unsigned long, btr_cur_t*, unsigned long**, mem_block_info_t**, dtuple_t*, unsigned char**, big_rec_t**, unsigned long, que_thr_t*, mtr_t*))[0x21fec97]
|
Attachments
Issue Links
- is caused by
-
MDEV-11369 Instant add column for InnoDB
-
- Closed
-
- relates to
-
MDEV-12894 System-versioned tables
-
- Closed
-
-
MDEV-13900 Testing for MDEV-11369 (instant ADD COLUMN)
-
- Closed
-
For further JIRA searches:
10.3 159a6c2e608d047
mysqld: /data/src/10.3/storage/innobase/lock/lock0lock.cc:3836: void lock_move_rec_list_start(const buf_block_t*, const buf_block_t*, const rec_t*, const rec_t*): Assertion `!page_rec_is_default_row(rec1)' failed.
171215 13:05:01 [ERROR] mysqld got signal 6 ;
#7 0x00007fafd4a95ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#8 0x000055fcce12d30b in lock_move_rec_list_start (new_block=0x7fafca16cfc0, block=0x7fafca16cca0, rec=0x7fafca64c0b5 "\200", old_end=0x7fafca650065 "infimum") at /data/src/10.3/storage/innobase/lock/lock0lock.cc:3836
#9 0x000055fcce188b56 in page_copy_rec_list_start (new_block=0x7fafca16cfc0, block=0x7fafca16cca0, rec=0x7fafca64c0b5 "\200", index=0x7faf740db1f8, mtr=0x7fafc80965b0) at /data/src/10.3/storage/innobase/page/page0page.cc:937
#10 0x000055fcce189e18 in page_move_rec_list_start (new_block=0x7fafca16cfc0, block=0x7fafca16cca0, split_rec=0x7fafca64c0b5 "\200", index=0x7faf740db1f8, mtr=0x7fafc80965b0) at /data/src/10.3/storage/innobase/page/page0page.cc:1402
#11 0x000055fcce2f6c2d in btr_page_split_and_insert (flags=0, cursor=0x7fafc8096190, offsets=0x7fafc8096128, heap=0x7fafc8096120, tuple=0x7faf740da1c8, n_ext=0, mtr=0x7fafc80965b0) at /data/src/10.3/storage/innobase/btr/btr0btr.cc:3166
#12 0x000055fcce31a693 in btr_cur_pessimistic_insert (flags=0, cursor=0x7fafc8096190, offsets=0x7fafc8096128, heap=0x7fafc8096120, entry=0x7faf740da1c8, rec=0x7fafc8096130, big_rec=0x7fafc8096118, n_ext=0, thr=0x7faf740cd748, mtr=0x7fafc80965b0) at /data/src/10.3/storage/innobase/btr/btr0cur.cc:3464
#13 0x000055fcce1df65a in row_ins_clust_index_entry_low (flags=0, mode=33, index=0x7faf740db1f8, n_uniq=2, entry=0x7faf740da1c8, n_ext=0, thr=0x7faf740cd748, dup_chk_only=false) at /data/src/10.3/storage/innobase/row/row0ins.cc:2766
#14 0x000055fcce1e0e58 in row_ins_clust_index_entry (index=0x7faf740db1f8, entry=0x7faf740da1c8, thr=0x7faf740cd748, n_ext=0, dup_chk_only=false) at /data/src/10.3/storage/innobase/row/row0ins.cc:3260
#15 0x000055fcce1e11a6 in row_ins_index_entry (index=0x7faf740db1f8, entry=0x7faf740da1c8, thr=0x7faf740cd748) at /data/src/10.3/storage/innobase/row/row0ins.cc:3358
#16 0x000055fcce1e1754 in row_ins_index_entry_step (node=0x7faf7416a1d0, thr=0x7faf740cd748) at /data/src/10.3/storage/innobase/row/row0ins.cc:3508
#17 0x000055fcce1e1b2f in row_ins (node=0x7faf7416a1d0, thr=0x7faf740cd748) at /data/src/10.3/storage/innobase/row/row0ins.cc:3650
#18 0x000055fcce1e23d2 in row_ins_step (thr=0x7faf740cd748) at /data/src/10.3/storage/innobase/row/row0ins.cc:3907
#19 0x000055fcce2018b0 in row_insert_for_mysql (mysql_rec=0x7faf7400c168 "\376\001", prebuilt=0x7faf741694b8) at /data/src/10.3/storage/innobase/row/row0mysql.cc:1493
#20 0x000055fcce0a5fdc in ha_innobase::write_row (this=0x7faf740cad68, record=0x7faf7400c168 "\376\001") at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:8368
#21 0x000055fccdd80cf3 in handler::ha_write_row (this=0x7faf740cad68, buf=0x7faf7400c168 "\376\001") at /data/src/10.3/sql/handler.cc:6066
#22 0x000055fccda79f3d in write_record (thd=0x7faf74000b00, table=0x7faf740dbc30, info=0x7fafc80973b0) at /data/src/10.3/sql/sql_insert.cc:1931
#23 0x000055fccda778c6 in mysql_insert (thd=0x7faf74000b00, table_list=0x7faf74014c70, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false) at /data/src/10.3/sql/sql_insert.cc:1059
#24 0x000055fccdaac6cc in mysql_execute_command (thd=0x7faf74000b00) at /data/src/10.3/sql/sql_parse.cc:4696
#25 0x000055fccdab6cd8 in mysql_parse (thd=0x7faf74000b00, rawbuf=0x7faf74014b48 "INSERT INTO t2 (id,foo,c1) VALUES (1, 1, REPEAT('1', 4000))", length=59, parser_state=0x7fafc8098610, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7963
#26 0x000055fccdaa466b in dispatch_command (command=COM_QUERY, thd=0x7faf74000b00, packet=0x7faf74160cf1 "INSERT INTO t2 (id,foo,c1) VALUES (1, 1, REPEAT('1', 4000))", packet_length=59, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1825
#27 0x000055fccdaa309f in do_command (thd=0x7faf74000b00) at /data/src/10.3/sql/sql_parse.cc:1370
#28 0x000055fccdbfbc0e in do_handle_one_connection (connect=0x55fcd20ef020) at /data/src/10.3/sql/sql_connect.cc:1420
#29 0x000055fccdbfb99b in handle_one_connection (arg=0x55fcd20ef020) at /data/src/10.3/sql/sql_connect.cc:1326
#30 0x000055fcce0840e4 in pfs_spawn_thread (arg=0x55fcd210bc30) at /data/src/10.3/storage/perfschema/pfs.cc:1863
#31 0x00007fafd676c494 in start_thread (arg=0x7fafc8099700) at pthread_create.c:333
#32 0x00007fafd4b5293f in clone () from /lib/x86_64-linux-gnu/libc.so.6