Bug #88780 Assertion `is_started()' failed.
Submitted: 6 Dec 2017 10:20 Modified: 6 Dec 2017 11:40
Reporter: Roel Van de Paar (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S6 (Debug Builds)
Version:5.5.58 OS:Any
Assigned to: CPU Architecture:Any

[6 Dec 2017 10:20] Roel Van de Paar
Description:
171206 20:46:39 [Note] /sda/MS091117-mysql-5.5.58-linux-x86_64-debug/bin/mysqld: ready for connections.
Version: '5.5.58-debug-log'  socket: '/sda/MS091117-mysql-5.5.58-linux-x86_64-debug/socket.sock'  port: 18611  MySQL Community Server (GPL)
mysqld: /git/mysql-server_dbg/sql/handler.h:968: bool Ha_trx_info::is_trx_read_write() const: Assertion `is_started()' failed.
09:46:40 UTC - mysqld got signal 6 ;

Core was generated by `/sda/MS091117-mysql-5.5.58-linux-x86_64-debug/bin/mysqld --no-defaults --log-bi'.
Program terminated with signal 6, Aborted.
#0  0x00007fc64c4529b1 in __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
61	  val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
(gdb) bt
#0  0x00007fc64c4529b1 in __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x00000000007dffb8 in my_write_core (sig=6) at /git/mysql-server_dbg/mysys/stacktrace.c:433
#2  0x00000000006a2f16 in handle_fatal_signal (sig=6) at /git/mysql-server_dbg/sql/signal_handler.cc:247
#3  <signal handler called>
#4  0x00007fc64ab881f7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007fc64ab898e8 in __GI_abort () at abort.c:90
#6  0x00007fc64ab81266 in __assert_fail_base (fmt=0x7fc64acd3e68 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0xac42a2 "is_started()", file=file@entry=0xa43bc8 "/git/mysql-server_dbg/sql/handler.h", 
    line=line@entry=968, 
    function=function@entry=0xad6b60 <_ZZNK11Ha_trx_info17is_trx_read_writeEvE19__PRETTY_FUNCTION__> "bool Ha_trx_info::is_trx_read_write() const") at assert.c:92
#7  0x00007fc64ab81312 in __GI___assert_fail (assertion=0xac42a2 "is_started()", 
    file=0xa43bc8 "/git/mysql-server_dbg/sql/handler.h", line=968, 
    function=0xad6b60 <_ZZNK11Ha_trx_info17is_trx_read_writeEvE19__PRETTY_FUNCTION__> "bool Ha_trx_info::is_trx_read_write() const")
    at assert.c:101
#8  0x0000000000733189 in is_trx_read_write (this=<optimized out>) at /git/mysql-server_dbg/sql/handler.h:968
#9  stmt_has_updated_trans_table (ha_list=<optimized out>) at /git/mysql-server_dbg/sql/log.cc:4595
#10 0x000000000074a404 in Query_log_event::Query_log_event (this=0x7fc64ca45600, thd_arg=0x7fc63d38d000, 
    query_arg=0xa3bb45 "COMMIT", query_length=6, using_trans=<optimized out>, direct=<optimized out>, suppress_use=true, errcode=0)
    at /git/mysql-server_dbg/sql/log_event.cc:2641
#11 0x000000000073d590 in binlog_commit_flush_stmt_cache (cache_mngr=0x7fc629875600, thd=0x7fc63d38d000)
    at /git/mysql-server_dbg/sql/log.cc:1652
#12 binlog_rollback (hton=<optimized out>, thd=0x7fc63d38d000, all=<optimized out>) at /git/mysql-server_dbg/sql/log.cc:1867
#13 0x00000000006a5df3 in ha_rollback_trans (thd=thd@entry=0x7fc63d38d000, all=all@entry=false)
    at /git/mysql-server_dbg/sql/handler.cc:1472
#14 0x000000000064e0e4 in trans_rollback_stmt (thd=thd@entry=0x7fc63d38d000) at /git/mysql-server_dbg/sql/transaction.cc:387
#15 0x000000000059309e in mysql_execute_command (thd=thd@entry=0x7fc63d38d000) at /git/mysql-server_dbg/sql/sql_parse.cc:4556
#16 0x00000000005940f6 in mysql_parse (thd=thd@entry=0x7fc63d38d000, rawbuf=<optimized out>, length=32, 
    parser_state=parser_state@entry=0x7fc64ca46580) at /git/mysql-server_dbg/sql/sql_parse.cc:5831
#17 0x00000000005959f5 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7fc63d38d000, 
    packet=packet@entry=0x7fc63d382001 "insert INTO t1 values(1,1),(0,0)", packet_length=packet_length@entry=32)
    at /git/mysql-server_dbg/sql/sql_parse.cc:1075
#18 0x0000000000597836 in do_command (thd=0x7fc63d38d000) at /git/mysql-server_dbg/sql/sql_parse.cc:776
#19 0x000000000063fd82 in do_handle_one_connection (thd_arg=thd_arg@entry=0x7fc63d38d000)
    at /git/mysql-server_dbg/sql/sql_connect.cc:870
#20 0x000000000063fe3f in handle_one_connection (arg=0x7fc63d38d000) at /git/mysql-server_dbg/sql/sql_connect.cc:789
#21 0x00007fc64c44de25 in start_thread (arg=0x7fc64ca47700) at pthread_create.c:308
#22 0x00007fc64ac4b34d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

How to repeat:
# mysqld options required for replay:  --log-bin
USE test;
CREATE TABLE t1(a int(1),b int(1),KEY (a)) ENGINE=MEMORY DEFAULT CHARSET=latin1;
create temporary table t1(a int)SELECT 1 a;
SET SESSION BINLOG_FORMAT=ROW;
DROP TABLE IF EXISTS t0,t1,t2,t3,t4,t5;
CREATE TRIGGER bug50192 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t2(b)VALUES (1);
CREATE TABLE t2(ingredient CHAR (1)default'',unit varchar(1) default'',KEY (ingredient,unit)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
lock TABLE t1 write;
insert INTO t1 values(1,1),(0,0);
[6 Dec 2017 10:22] Roel Van de Paar
5.6.38 output;

mysql>insert INTO t1 values(1,1),(0,0);
ERROR 1054 (42S22): Unknown column 'b' in 'field list'

5.7.20 output;

mysql>insert INTO t1 values(1,1),(0,0);
ERROR 1054 (42S22): Unknown column 'b' in 'field list'
[6 Dec 2017 10:22] Roel Van de Paar
Likely not related, but same assertion https://bugs.mysql.com/bug.php?id=76425
[6 Dec 2017 11:40] Umesh Shastry
Hello Roel,

Thank you for the report and test case.
Observed that 5.5.58 debug build is affected.

Thanks,
Umesh