[MDEV-19596] Assertion `inited==NONE' failed in handler::ha_index_read_idx_map upon REPLACE DELAYED Created: 2019-05-25  Updated: 2023-04-27

Status: Confirmed
Project: MariaDB Server
Component/s: Data Manipulation - Insert, Storage Engine - Memory
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6
Fix Version/s: 10.4, 10.5

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: None


 Description   

CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=MEMORY;
INSERT INTO t1 VALUES (1),(2);
 
flush status; # not needed for the test case, only for cleanup
REPLACE DELAYED INTO t1 VALUES (1);
 
# Cleanup
let $show_statement= SHOW STATUS LIKE 'Delayed_writes';
let $field= Value;
let $condition= = 1;
--source include/wait_show_condition.inc
DROP TABLE t1;

10.2 b90918da

mysqld: /data/src/10.2/sql/handler.cc:2701: int handler::ha_index_read_idx_map(uchar*, uint, const uchar*, key_part_map, ha_rkey_function): Assertion `inited==NONE' failed.
190525 21:09:05 [ERROR] mysqld got signal 6 ;
 
#6  0x00007f6accc86e67 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x55f22c481e65 "inited==NONE", file=file@entry=0x55f22c4822d1 "/data/src/10.2/sql/handler.cc", line=line@entry=2701, function=function@entry=0x55f22c4849e0 <handler::ha_index_read_idx_map(unsigned char*, unsigned int, unsigned char const*, unsigned long, ha_rkey_function)::__PRETTY_FUNCTION__> "int handler::ha_index_read_idx_map(uchar*, uint, const uchar*, key_part_map, ha_rkey_function)") at assert.c:92
#7  0x00007f6accc86f12 in __GI___assert_fail (assertion=0x55f22c481e65 "inited==NONE", file=0x55f22c4822d1 "/data/src/10.2/sql/handler.cc", line=2701, function=0x55f22c4849e0 <handler::ha_index_read_idx_map(unsigned char*, unsigned int, unsigned char const*, unsigned long, ha_rkey_function)::__PRETTY_FUNCTION__> "int handler::ha_index_read_idx_map(uchar*, uint, const uchar*, key_part_map, ha_rkey_function)") at assert.c:101
#8  0x000055f22bbae18e in handler::ha_index_read_idx_map (this=0x7f6aac00bea8, buf=0x7f6aac0310a8 "\245\245\245\245\245\245\245\245\300\020\003\254j\177", index=0, key=0x7f6ac2f41cf0 "\001", keypart_map=1, find_flag=HA_READ_KEY_EXACT) at /data/src/10.2/sql/handler.cc:2701
#9  0x000055f22b909978 in write_record (thd=0x7f6aac07be50, table=0x7f6aac0695d0, info=0x7f6aac081710) at /data/src/10.2/sql/sql_insert.cc:1742
#10 0x000055f22b90d6d7 in Delayed_insert::handle_inserts (this=0x7f6aac07be30) at /data/src/10.2/sql/sql_insert.cc:3296
#11 0x000055f22b90cb67 in handle_delayed_insert (arg=0x7f6aac07be30) at /data/src/10.2/sql/sql_insert.cc:3041
#12 0x000055f22c2a6008 in pfs_spawn_thread (arg=0x7f6aac054d80) at /data/src/10.2/storage/perfschema/pfs.cc:1862
#13 0x00007f6ace7fb4a4 in start_thread (arg=0x7f6ac2f42700) at pthread_create.c:456
#14 0x00007f6accd43d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

Not reproducible with 10.1.



 Comments   
Comment by Roel Van de Paar [ 2020-08-18 ]

USE test;
SET SQL_MODE='';
CREATE TABLE t (c DOUBLE PRECISION PRIMARY KEY) ENGINE=Memory;
INSERT INTO t VALUES (1);
REPLACE DELAYED INTO t (c) VALUES (1);
ALTER TABLE t MODIFY c FLOAT NOT NULL;

Leads to:

10.4.15 eae968f62d285de97ed607c87bc131cd863d5d03 (Debug)

mysqld: /test/10.4_dbg/sql/handler.cc:2943: int handler::ha_index_read_idx_map(uchar*, uint, const uchar*, key_part_map, ha_rkey_function): Assertion `inited==NONE' failed.

10.4.15 eae968f62d285de97ed607c87bc131cd863d5d03 (Debug)

Core was generated by `/test/MD110820-mariadb-10.4.15-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
    at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
[Current thread is 1 (Thread 0x14d6f01e7700 (LWP 2916570))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
#1  0x000055c75b5f58a6 in my_write_core (sig=sig@entry=6) at /test/10.4_dbg/mysys/stacktrace.c:482
#2  0x000055c75ad71cdc in handle_fatal_signal (sig=6) at /test/10.4_dbg/sql/signal_handler.cc:343
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#5  0x000014d6ee4c98b1 in __GI_abort () at abort.c:79
#6  0x000014d6ee4b942a in __assert_fail_base (fmt=0x14d6ee640a38 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55c75b6d4bad "inited==NONE", file=file@entry=0x55c75b869d2b "/test/10.4_dbg/sql/handler.cc", line=line@entry=2943, function=function@entry=0x55c75b86de60 <handler::ha_index_read_idx_map(unsigned char*, unsigned int, unsigned char const*, unsigned long, ha_rkey_function)::__PRETTY_FUNCTION__> "int handler::ha_index_read_idx_map(uchar*, uint, const uchar*, key_part_map, ha_rkey_function)") at assert.c:92
#7  0x000014d6ee4b94a2 in __GI___assert_fail (assertion=assertion@entry=0x55c75b6d4bad "inited==NONE", file=file@entry=0x55c75b869d2b "/test/10.4_dbg/sql/handler.cc", line=line@entry=2943, function=function@entry=0x55c75b86de60 <handler::ha_index_read_idx_map(unsigned char*, unsigned int, unsigned char const*, unsigned long, ha_rkey_function)::__PRETTY_FUNCTION__> "int handler::ha_index_read_idx_map(uchar*, uint, const uchar*, key_part_map, ha_rkey_function)") at assert.c:101
#8  0x000055c75ad7aa9b in handler::ha_index_read_idx_map (this=0x14d6c8c7a088, buf=0x14d6c8c411a0 '\245' <repeats 16 times>, "\300\021\304\310\326\024", index=index@entry=0, key=key@entry=0x14d6f01e6a20 "", keypart_map=1, find_flag=find_flag@entry=HA_READ_KEY_EXACT) at /test/10.4_dbg/sql/handler.cc:2943
#9  0x000055c75aa7f4b8 in write_record (thd=thd@entry=0x14d6c8d9f090, table=0x14d6c8cbb070, info=info@entry=0x14d6c8da5768) at /test/10.4_dbg/sql/sql_insert.cc:1813
#10 0x000055c75aa829a6 in Delayed_insert::handle_inserts (this=this@entry=0x14d6c8d9f070) at /test/10.4_dbg/sql/sql_insert.cc:3482
#11 0x000055c75aa841d0 in handle_delayed_insert (arg=0x14d6c8d9f070) at /test/10.4_dbg/sql/sql_insert.cc:3228
#12 0x000014d6ef4306db in start_thread (arg=0x14d6f01e7700) at pthread_create.c:463
#13 0x000014d6ee5aaa3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.2.34 (dbg), 10.3.25 (dbg), 10.4.15 (dbg), 10.5.6 (dbg)

Bug confirmed not present in:
MariaDB: 10.1.47 (dbg), 10.1.47 (opt), 10.2.34 (opt), 10.3.25 (opt), 10.4.15 (opt), 10.5.6 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)

Comment by Roel Van de Paar [ 2021-04-29 ]

10.6.1 9db14e93acc4ec9023d50686c66dbef7d4d8c15c (Debug)

mysqld: /test/10.6_dbg/sql/handler.cc:3149: int handler::ha_index_read_idx_map(uchar*, uint, const uchar*, key_part_map, ha_rkey_function): Assertion `inited==NONE' failed.

10.6.1 9db14e93acc4ec9023d50686c66dbef7d4d8c15c (Debug)

Core was generated by `/test/MD270421-mariadb-10.6.1-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
[Current thread is 1 (Thread 0x153630081700 (LWP 3146247))]
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x0000153639732859 in __GI_abort () at abort.c:79
#2  0x0000153639732729 in __assert_fail_base (fmt=0x1536398c8588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55984e7ef96e "inited==NONE", file=0x55984e99548b "/test/10.6_dbg/sql/handler.cc", line=3149, function=<optimized out>) at assert.c:92
#3  0x0000153639743f36 in __GI___assert_fail (assertion=assertion@entry=0x55984e7ef96e "inited==NONE", file=file@entry=0x55984e99548b "/test/10.6_dbg/sql/handler.cc", line=line@entry=3149, function=function@entry=0x55984e9974a0 "int handler::ha_index_read_idx_map(uchar*, uint, const uchar*, key_part_map, ha_rkey_function)") at assert.c:101
#4  0x000055984de3842c in handler::ha_index_read_idx_map (this=0x1535d4024220, buf=0x1535d4023dc8 '\245' <repeats 16 times>, "\020>\002\324\065\025", index=index@entry=0, key=key@entry=0x153630080b40 "", keypart_map=1, find_flag=find_flag@entry=HA_READ_KEY_EXACT) at /test/10.6_dbg/sql/handler.cc:3149
#5  0x000055984db166bb in write_record (thd=thd@entry=0x1535d40a9cd8, table=0x1535d4020838, info=info@entry=0x1535d40b09a8, sink=sink@entry=0x0) at /test/10.6_dbg/sql/sql_insert.cc:1858
#6  0x000055984db19a94 in Delayed_insert::handle_inserts (this=this@entry=0x1535d40a9cb8) at /test/10.6_dbg/sql/sql_insert.cc:3545
#7  0x000055984db1b50d in handle_delayed_insert (arg=arg@entry=0x1535d40a9cb8) at /test/10.6_dbg/sql/sql_insert.cc:3285
#8  0x000055984e1732ca in pfs_spawn_thread (arg=0x559851f0d768) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
#9  0x0000153639c40609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#10 0x000015363982f293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

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