[MDEV-14473] Assertion `rec_get_trx_id(rec, clust_index) < trx->id' failed in row_merge_read_clustered_index on ADD FULLTEXT KEY Created: 2017-11-22  Updated: 2018-01-15  Resolved: 2018-01-15

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table, Full-text Search, Storage Engine - InnoDB
Affects Version/s: 10.3
Fix Version/s: 10.3.4

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Marko Mäkelä
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-14837 Duplicate primary keys are allowed af... Closed

 Description   

--source include/have_innodb.inc
 
CREATE TABLE t1 (c TEXT, PRIMARY KEY (c(10))) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('foo');
ALTER TABLE t1 ADD COLUMN i INT;
UPDATE t1 SET i = 1;
ALTER TABLE t1 ADD FULLTEXT KEY (c);
 
# Cleanup
DROP TABLE t1;

10.3 debug e44107c4d9315

mysqld: /data/src/10.3/storage/innobase/row/row0merge.cc:2175: dberr_t row_merge_read_clustered_index(trx_t*, TABLE*, const dict_table_t*, const dict_table_t*, bool, dict_index_t**, dict_index_t*, fts_psort_t
*, merge_file_t*, const ulint*, ulint, const dtuple_t*, const dict_add_v_col_t*, const ulint*, ulint, ib_sequence_t&, row_merge_block_t*, bool, int*, ut_stage_alter_t*, double, row_merge_block_t*, TABLE*): As
sertion `rec_get_trx_id(rec, clust_index) < trx->id' failed.
171122 19:50:24 [ERROR] mysqld got signal 6 ;
 
#7  0x00007f54c68a4ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#8  0x0000565387d9d6c7 in row_merge_read_clustered_index (trx=0x7f54c07a8878, table=0x7f547407ea50, old_table=0x7f5474033908, new_table=0x7f54740384e8, online=false, index=0x7f5474037898, fts_sort_idx=0x7f5474051428, psort_info=0x7f547403d280, files=0x7f547404fb60, key_numbers=0x7f54740378b0, n_index=3, add_cols=0x0, add_v=0x0, col_map=0x7f5474037948, add_autoinc=18446744073709551615, sequence=..., block=0x7f54c01c5000 <error: Cannot access memory at address 0x7f54c01c5000>, skip_pk_sort=true, tmpfd=0x7f54c0509d28, stage=0x7f547404fb00, pct_cost=25, crypt_block=0x0, eval_table=0x7f547407ea50) at /data/src/10.3/storage/innobase/row/row0merge.cc:2175
#9  0x0000565387da4ca0 in row_merge_build_indexes (trx=0x7f54c07a8878, old_table=0x7f5474033908, new_table=0x7f54740384e8, online=false, indexes=0x7f5474037898, key_numbers=0x7f54740378b0, n_indexes=3, table=0x7f547407ea50, add_cols=0x0, col_map=0x7f5474037948, add_autoinc=18446744073709551615, sequence=..., skip_pk_sort=true, stage=0x7f547404fb00, add_v=0x0, eval_table=0x7f547407ea50) at /data/src/10.3/storage/innobase/row/row0merge.cc:4727
#10 0x0000565387c9233a in ha_innobase::inplace_alter_table (this=0x7f547407a468, altered_table=0x7f547407ea50, ha_alter_info=0x7f54c050a520) at /data/src/10.3/storage/innobase/handler/handler0alter.cc:7073
#11 0x000056538773ac89 in handler::ha_inplace_alter_table (this=0x7f547407a468, altered_table=0x7f547407ea50, ha_alter_info=0x7f54c050a520) at /data/src/10.3/sql/handler.h:3826
#12 0x0000565387731d42 in mysql_inplace_alter_table (thd=0x7f5474000b00, table_list=0x7f5474014b90, table=0x7f547407c0d0, altered_table=0x7f547407ea50, ha_alter_info=0x7f54c050a520, inplace_supported=HA_ALTER_INPLACE_SHARED_LOCK_AFTER_PREPARE, target_mdl_request=0x7f54c050a590, alter_ctx=0x7f54c050b150) at /data/src/10.3/sql/sql_table.cc:7235
#13 0x000056538773714e in mysql_alter_table (thd=0x7f5474000b00, new_db=0x7f54740151a0 "test", new_name=0x0, create_info=0x7f54c050bd60, table_list=0x7f5474014b90, alter_info=0x7f54c050bcb0, order_num=0, order=0x0, ignore=false) at /data/src/10.3/sql/sql_table.cc:9237
#14 0x00005653877b63ed in Sql_cmd_alter_table::execute (this=0x7f5474015268, thd=0x7f5474000b00) at /data/src/10.3/sql/sql_alter.cc:331
#15 0x00005653876683e8 in mysql_execute_command (thd=0x7f5474000b00) at /data/src/10.3/sql/sql_parse.cc:6237
#16 0x000056538766cd7e in mysql_parse (thd=0x7f5474000b00, rawbuf=0x7f5474014a98 "ALTER TABLE t1 ADD FULLTEXT KEY (c)", length=35, parser_state=0x7f54c050d610, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7933
#17 0x000056538765a75e in dispatch_command (command=COM_QUERY, thd=0x7f5474000b00, packet=0x7f5474093d81 "ALTER TABLE t1 ADD FULLTEXT KEY (c)", packet_length=35, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1828
#18 0x000056538765917f in do_command (thd=0x7f5474000b00) at /data/src/10.3/sql/sql_parse.cc:1370
#19 0x00005653877b0f66 in do_handle_one_connection (connect=0x56538a2a7340) at /data/src/10.3/sql/sql_connect.cc:1420
#20 0x00005653877b0cf3 in handle_one_connection (arg=0x56538a2a7340) at /data/src/10.3/sql/sql_connect.cc:1326
#21 0x0000565387c32422 in pfs_spawn_thread (arg=0x56538a2afa00) at /data/src/10.3/storage/perfschema/pfs.cc:1863
#22 0x00007f54c857b494 in start_thread (arg=0x7f54c050e700) at pthread_create.c:333
#23 0x00007f54c696193f in clone () from /lib/x86_64-linux-gnu/libc.so.6

Couldn't reproduce with 10.2 or MySQL 5.7. No visible problem on non-debug 10.3 build. All of the produce

ALTER TABLE t1 ADD FULLTEXT KEY (c);
Warnings:
Warning	124	InnoDB rebuilding table to add column FTS_DOC_ID

which, I assume, is expected.



 Comments   
Comment by Marko Mäkelä [ 2018-01-15 ]

This shares the root cause with MDEV-14837, because I can reproduce this failure only after reverting that fix.

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