[MDEV-14068] Assertion `0' failed in row_sel_get_clust_rec_for_mysql(row_prebuilt_t*, dict_index_t*, const rec_t*, que_thr_t*, const rec_t**, ulint**, mem_heap_t**, const dtuple_t**, mtr_t*) Created: 2017-10-14  Updated: 2018-10-21  Resolved: 2018-01-10

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

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-14837 Duplicate primary keys are allowed af... Closed

 Description   

Some 10.3 of Oct 12-13, 2017

2017-10-13  2:08:17 19 [ERROR] mysqld: Can't find record in 't1'
2017-10-13  2:08:17 19 [ERROR] mysqld: Can't find record in 't1'
2017-10-13  2:08:17 16 [ERROR] InnoDB: Clustered record for sec rec not found index `idx` of table `test`.`t1`
InnoDB: sec index record PHYSICAL RECORD: n_fields 2; compact format; info bits 0
 0: len 4; hex 80000001; asc     ;;
 1: len 10; hex 31313131313131313131; asc 1111111111;;
 
InnoDB: clust index record PHYSICAL RECORD: n_fields 8; compact format; info bits 0
 0: len 10; hex 33333333333333333333; asc 3333333333;;
 1: len 4; hex 80000002; asc     ;;
 2: len 6; hex 000000003f44; asc     ?D;;
 3: len 7; hex 72000001b00d13; asc r      ;;
 4: len 20; hex 000008950000000a000000260000000000002001; asc            &        ;;
 5: len 4; hex 80000003; asc     ;;
 6: len 4; hex 80000003; asc     ;;
 7: len 4; hex 80000002; asc     ;;
 
TRANSACTION 421279838067880, ACTIVE 0 sec starting index read
mysql tables in use 1, locked 1
0 lock struct(s), heap size 1160, 0 row lock(s)
MySQL thread id 16, OS thread handle 139804826883840, query id 11043 127.0.0.1 root executing
CHECK TABLE t1 /* QNO 1832 CON_ID 16 */
 
InnoDB: Submit a detailed bug report to http://bugs.mysql.com
mysqld: /data/src/10.3/storage/innobase/row/row0sel.cc:3461: dberr_t row_sel_get_clust_rec_for_mysql(row_prebuilt_t*, dict_index_t*, const rec_t*, que_thr_t*, const rec_t**, ulint**, mem_heap_t**, const dtuple_t**, mtr_t*): Assertion `0' failed.
171013  2:08:17 [ERROR] mysqld got signal 6 ;
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x7f26840137a8): CHECK TABLE t1 /* QNO 1832 CON_ID 16 */
Connection ID (thread ID): 16
Status: NOT_KILLED

# 2017-10-13T02:08:28 [22535] #7  0x00007f26e89a9ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
# 2017-10-13T02:08:28 [22535] #8  0x000055f03420677c in row_sel_get_clust_rec_for_mysql (prebuilt=0x7f26700a0728, sec_index=0x7f26780ad798, rec=0x7f26d04d807e "\200", thr=0x7f26700a0ef0, out_rec=0x7f26d90b1638, offsets=0x7f26d90b1658, offset_heap=0x7f26d90b1650, vrow=0x0, mtr=0x7f26d90b2150) at /data/src/10.3/storage/innobase/row/row0sel.cc:3461
# 2017-10-13T02:08:28 [22535] #9  0x000055f03420b1a2 in row_search_mvcc (buf=0x7f2684566ef0 "\222h\245 ", mode=PAGE_CUR_G, prebuilt=0x7f26700a0728, match_mode=0, direction=0) at /data/src/10.3/storage/innobase/row/row0sel.cc:5304
# 2017-10-13T02:08:28 [22535] #10 0x000055f0341c650b in row_search_for_mysql (buf=0x7f2684566ef0 "\222h\245 ", mode=PAGE_CUR_G, prebuilt=0x7f26700a0728, match_mode=0, direction=0) at /data/src/10.3/storage/innobase/include/row0sel.ic:137
# 2017-10-13T02:08:28 [22535] #11 0x000055f0341d2321 in row_scan_index_for_mysql (prebuilt=0x7f26700a0728, index=0x7f26780ad798, n_rows=0x7f26d90b2c60) at /data/src/10.3/storage/innobase/row/row0mysql.cc:5020
# 2017-10-13T02:08:28 [22535] #12 0x000055f03407ce47 in ha_innobase::check (this=0x7f2670082a38, thd=0x7f2684000b00, check_opt=0x7f2684005698) at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:15009
# 2017-10-13T02:08:28 [22535] #13 0x000055f033d4c24f in handler::ha_check (this=0x7f2670082a38, thd=0x7f2684000b00, check_opt=0x7f2684005698) at /data/src/10.3/sql/handler.cc:3994
# 2017-10-13T02:08:28 [22535] #14 0x000055f033be4e38 in mysql_admin_table(THD *, TABLE_LIST *, HA_CHECK_OPT *, const char *, thr_lock_type, bool, bool, uint, int (*)(THD *, TABLE_LIST *, HA_CHECK_OPT *), struct {...}, int (*)(THD *, TABLE_LIST *, HA_CHECK_OPT *)) (thd=0x7f2684000b00, tables=0x7f26840138d0, check_opt=0x7f2684005698, operator_name=0x55f0345dde6c "check", lock_type=TL_READ_NO_INSERT, open_for_modify=false, repair_table_use_frm=false, extra_open_options=32, prepare_func=0x0, operator_func=(int (handler::*)(handler * const, THD *, HA_CHECK_OPT *)) 0x55f033d4c104 <handler::ha_check(THD*, st_ha_check_opt*)>, view_operator_func=0x55f033b7e07c <view_check(THD*, TABLE_LIST*, st_ha_check_opt*)>) at /data/src/10.3/sql/sql_admin.cc:803
# 2017-10-13T02:08:28 [22535] #15 0x000055f033be6fa2 in Sql_cmd_check_table::execute (this=0x7f2684013ee8, thd=0x7f2684000b00) at /data/src/10.3/sql/sql_admin.cc:1341
# 2017-10-13T02:08:28 [22535] #16 0x000055f033a8b172 in mysql_execute_command (thd=0x7f2684000b00) at /data/src/10.3/sql/sql_parse.cc:6236
# 2017-10-13T02:08:28 [22535] #17 0x000055f033a8fa1c in mysql_parse (thd=0x7f2684000b00, rawbuf=0x7f26840137a8 "CHECK TABLE t1 /* QNO 1832 CON_ID 16 */", length=39, parser_state=0x7f26d90b4660, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7921
# 2017-10-13T02:08:28 [22535] #18 0x000055f033a7d1bd in dispatch_command (command=COM_QUERY, thd=0x7f2684000b00, packet=0x7f268400ae01 "", packet_length=40, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1819
# 2017-10-13T02:08:28 [22535] #19 0x000055f033a7bc1b in do_command (thd=0x7f2684000b00) at /data/src/10.3/sql/sql_parse.cc:1370
# 2017-10-13T02:08:28 [22535] #20 0x000055f033bd29f4 in do_handle_one_connection (connect=0x55f03854f3e0) at /data/src/10.3/sql/sql_connect.cc:1418
# 2017-10-13T02:08:28 [22535] #21 0x000055f033bd2781 in handle_one_connection (arg=0x55f03854f3e0) at /data/src/10.3/sql/sql_connect.cc:1324
# 2017-10-13T02:08:28 [22535] #22 0x00007f26ea8ee494 in start_thread (arg=0x7f26d90b5700) at pthread_create.c:333
# 2017-10-13T02:08:28 [22535] #23 0x00007f26e8a6693f in clone () from /lib/x86_64-linux-gnu/libc.so.6

perl ./runall.pl --no-mask --seed=1507821092 --threads=5 --duration=21600 --queries=100M --reporters=QueryTimeout,Backtrace,ErrorLog,Deadlock,Shutdown --redefine=conf/mariadb/redefine_random_keys.yy --redefine=conf/mariadb/redefine_set_session_vars.yy --validators=TransformerNoComparator --transformers=ConvertSubqueriesToViews,DisableOptimizations,EnableOptimizations,ExecuteAsCTE,ExecuteAsInsertSelect,ExecuteAsPreparedOnce,ExecuteAsSelectItem,ExecuteAsUnion,ExecuteAsUpdateDelete,ExecuteAsView,NullIf,OrderBy,StraightJoin,ExecuteAsExecuteImmediate --grammar=conf/runtime/alter_online.yy --gendata=conf/runtime/alter_online.zz --mtr-build-thread=150 --basedir1=/data/bld/10.3 --vardir1=/data/logs/analyze6



 Comments   
Comment by Elena Stepanova [ 2018-01-10 ]

Got a test case

CREATE OR REPLACE TABLE t1 (col1 INT, col2 INT, col3 INT, col4 TEXT, PRIMARY KEY (col4(10))) ENGINE = InnoDB;
INSERT INTO t1 (col1,col2,col3,col4) VALUES ( 2, 1, 2, REPEAT('0',8193));
ALTER TABLE t1 ADD UNIQUE KEY uidx (col4(10));
--connect (con16_0,localhost,root,,test)
SET AUTOCOMMIT = 0 /* QNO 13 CON_ID 16 */;
ALTER TABLE t1 ADD COLUMN extra INT /* QNO 43 CON_ID 15 */;
UPDATE t1 SET extra = col2  /* QNO 44 CON_ID 15 */;
INSERT INTO t1 (col1,col2,col3,col4) VALUES ( 4, 4, 4, REPEAT(CAST(4 - 1 AS CHAR(1)),8193)) /* QNO 37 CON_ID 16 */;
--connection default
CHECK TABLE t1 /* QNO 53 CON_ID 15 */;

Apparently it was another consequence of MDEV-14837 and friends, as it stopped being reproducible after the fix, e.g. on 0b597d3ab2494bc1db97cc4a30d697a5fdf48c21.

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