Bug #87588 Assertion `thd->lex->sql_com mand == SQLCOM_XA_COMMIT' failed
Submitted: 29 Aug 2017 17:17 Modified: 29 Aug 2017 17:57
Reporter: Ramesh Sivaraman Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.7/8.0 OS:Ubuntu
Assigned to: CPU Architecture:Any
Tags: debug

[29 Aug 2017 17:17] Ramesh Sivaraman
Description:
GDB info

#0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
#1  0x000000000196f4be in my_write_core (sig=6) at /qa/mytest/mysql-server_dbg/mysys/stacktrace.c:249
#2  0x0000000000f09901 in handle_fatal_signal (sig=6) at /qa/mytest/mysql-server_dbg/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007f3366618428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#5  0x00007f336661a02a in __GI_abort () at abort.c:89
#6  0x00007f3366610bd7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x1f29f30 "thd->lex->sql_command == SQLCOM_XA_COMMIT", file=file@entry=0x1f295c8 "/qa/mytest/mysql-server_dbg/sql/handler.cc", line=line@entry=1889, function=function@entry=0x1f2c240 <ha_commit_low(THD*, bool, bool)::__PRETTY_FUNCTION__> "int ha_commit_low(THD*, bool, bool)") at assert.c:92
#7  0x00007f3366610c82 in __GI___assert_fail (assertion=0x1f29f30 "thd->lex->sql_command == SQLCOM_XA_COMMIT", file=0x1f295c8 "/qa/mytest/mysql-server_dbg/sql/handler.cc", line=1889, function=0x1f2c240 <ha_commit_low(THD*, bool, bool)::__PRETTY_FUNCTION__> "int ha_commit_low(THD*, bool, bool)") at assert.c:101
#8  0x0000000000f8c1b0 in ha_commit_low (thd=0x7f332ac19000, all=true, run_after_commit=false) at /qa/mytest/mysql-server_dbg/sql/handler.cc:1889
#9  0x00000000018d71ed in MYSQL_BIN_LOG::process_commit_stage_queue (this=0x2d1acc0 <mysql_bin_log>, thd=0x7f332ac19000, first=0x7f332ac19000) at /qa/mytest/mysql-server_dbg/sql/binlog.cc:8699
#10 0x00000000018d8ade in MYSQL_BIN_LOG::ordered_commit (this=0x2d1acc0 <mysql_bin_log>, thd=0x7f332ac19000, all=true, skip_commit=false) at /qa/mytest/mysql-server_dbg/sql/binlog.cc:9377
#11 0x00000000018d6a8b in MYSQL_BIN_LOG::commit (this=0x2d1acc0 <mysql_bin_log>, thd=0x7f332ac19000, all=true) at /qa/mytest/mysql-server_dbg/sql/binlog.cc:8491
#12 0x0000000001578023 in close_temporary_tables (thd=0x7f332ac19000) at /qa/mytest/mysql-server_dbg/sql/sql_base.cc:1992
#13 0x000000000189493f in Start_log_event_v3::do_apply_event (this=0x7f332ac22660, rli=0x7f332ac98000) at /qa/mytest/mysql-server_dbg/sql/log_event.cc:5288
#14 0x000000000189567f in Format_description_log_event::do_apply_event (this=0x7f332ac22620, rli=0x7f332ac98000) at /qa/mytest/mysql-server_dbg/sql/log_event.cc:5529
#15 0x000000000188eaa0 in Log_event::apply_event (this=0x7f332ac22660, rli=0x7f332ac98000) at /qa/mytest/mysql-server_dbg/sql/log_event.cc:3434
#16 0x00000000018e58d8 in mysql_client_binlog_statement (thd=0x7f332ac19000) at /qa/mytest/mysql-server_dbg/sql/sql_binlog.cc:275
#17 0x000000000160ad6a in mysql_execute_command (thd=0x7f332ac19000, first_level=true) at /qa/mytest/mysql-server_dbg/sql/sql_parse.cc:4815
#18 0x000000000160ce4b in mysql_parse (thd=0x7f332ac19000, parser_state=0x7f3368b5a510) at /qa/mytest/mysql-server_dbg/sql/sql_parse.cc:5574
#19 0x0000000001601c13 in dispatch_command (thd=0x7f332ac19000, com_data=0x7f3368b5adc0, command=COM_QUERY) at /qa/mytest/mysql-server_dbg/sql/sql_parse.cc:1461
#20 0x0000000001600a60 in do_command (thd=0x7f332ac19000) at /qa/mytest/mysql-server_dbg/sql/sql_parse.cc:999
#21 0x00000000017437d3 in handle_connection (arg=0x7f333dbff5c0) at /qa/mytest/mysql-server_dbg/sql/conn_handler/connection_handler_per_thread.cc:300
#22 0x0000000001e2e9c1 in pfs_spawn_thread (arg=0x7f334efe1f20) at /qa/mytest/mysql-server_dbg/storage/perfschema/pfs.cc:2188
#23 0x00007f33672556ba in start_thread (arg=0x7f3368b5b700) at pthread_create.c:333
#24 0x00007f33666ea3dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

How to repeat:
Testcase

# mysqld options required for replay:  --log-bin
BINLOG '0';
SET SESSION binlog_format='STATEMENT';
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
xa start 'tx1';
CREATE TEMPORARY TABLE tmp_myisam_305(a CHAR (1))ENGINE=InnoDB;
BINLOG ' SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8='/*!*/;
[29 Aug 2017 17:57] MySQL Verification Team
Thank you for the bug report. Verified as described.