[MDEV-19420] Server crashes in ha_maria::extra upon erroneous INSERT Created: 2019-05-08  Updated: 2019-05-08  Resolved: 2019-05-08

Status: Closed
Project: MariaDB Server
Component/s: Data Manipulation - Insert, Storage Engine - Aria
Affects Version/s: 10.2, 10.3, 10.4
Fix Version/s: 10.2.24

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Duplicate Votes: 0
Labels: regression

Issue Links:
Duplicate
duplicates MDEV-15572 view.test, server crash with --big-ta... Closed

 Description   

CREATE TABLE t1 (a INT, b BLOB);
CREATE TABLE t2 (c INT);
CREATE TRIGGER tr BEFORE UPDATE ON t2 FOR EACH ROW SET @a = 1;
CREATE VIEW v AS SELECT a, b FROM t1 JOIN t2;
 
--error ER_BAD_FIELD_ERROR
INSERT INTO v (x) SELECT 1;
 
# Cleanup
DROP VIEW v;
DROP TABLE t1, t2;

10.2 54d0a55a

#3  <signal handler called>
#4  0x0000561d80c3e17c in ha_maria::extra (this=0x7fa158048378, operation=HA_EXTRA_NO_IGNORE_DUP_KEY) at /data/src/10.2/storage/maria/ha_maria.cc:2577
#5  0x0000561d80400508 in select_insert::abort_result_set (this=0x7fa1580170a8) at /data/src/10.2/sql/sql_insert.cc:3960
#6  0x0000561d8045be8e in handle_select (thd=0x7fa158000b00, lex=0x7fa158004630, result=0x7fa1580170a8, setup_tables_done_option=1073741824) at /data/src/10.2/sql/sql_select.cc:382
#7  0x0000561d8042030e in mysql_execute_command (thd=0x7fa158000b00) at /data/src/10.2/sql/sql_parse.cc:4552
#8  0x0000561d8042b3ba in mysql_parse (thd=0x7fa158000b00, rawbuf=0x7fa158012458 "INSERT INTO v (x) SELECT 1", length=26, parser_state=0x7fa1743e9200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:8020
#9  0x0000561d80418c0e in dispatch_command (command=COM_QUERY, thd=0x7fa158000b00, packet=0x7fa15808db11 "INSERT INTO v (x) SELECT 1", packet_length=26, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1833
#10 0x0000561d80417562 in do_command (thd=0x7fa158000b00) at /data/src/10.2/sql/sql_parse.cc:1386
#11 0x0000561d8056a2c0 in do_handle_one_connection (connect=0x561d832879b0) at /data/src/10.2/sql/sql_connect.cc:1335
#12 0x0000561d8056a040 in handle_one_connection (arg=0x561d832879b0) at /data/src/10.2/sql/sql_connect.cc:1241
#13 0x0000561d80d956d2 in pfs_spawn_thread (arg=0x561d831d31f0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
#14 0x00007fa17b4294a4 in start_thread (arg=0x7fa1743ea700) at pthread_create.c:456
#15 0x00007fa179971d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

The crash occurs with either MyISAM, or InnoDB, or Aria as table storage engine, so I assume it's about internal temp tables.

Not reproducible on 10.1.

The problem started happening in 10.2 after this commit:

commit 4e01bc8c963d9513625dd984cd1aca24b8a7b516
Author: Oleksandr Byelkin
Date:   Thu Dec 20 09:52:34 2018 +0100
 
    MDEV-16240: Assertion `0' failed in row_sel_convert_mysql_key_to_innobase
    
    Set table in row ID position mode before using this function.

The seemingly irrelevant trigger in the test case makes a difference. Without it, I am getting MDEV-15572 crash, both before and after the above-mentioned commit. With the trigger, the test passes before the commit and fails after.


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