Able to replicate this issue with: #0 0x00007fa17e45a0b1 in pthread_kill () from /usr/lib/libpthread.so.0 #1 0x0000000000804748 in my_write_core (sig=6) at /media/Tintin/Work/code/codership/5.5.30/mysys/stacktrace.c:433 #2 0x00000000006c69f8 in handle_fatal_signal (sig=6) at /media/Tintin/Work/code/codership/5.5.30/sql/signal_handler.cc:247 #3 #4 0x00007fa17cc083d9 in raise () from /usr/lib/libc.so.6 #5 0x00007fa17cc097d8 in abort () from /usr/lib/libc.so.6 #6 0x00007fa17cc01506 in __assert_fail_base () from /usr/lib/libc.so.6 #7 0x00007fa17cc015b2 in __assert_fail () from /usr/lib/libc.so.6 #8 0x000000000057fc8f in Diagnostics_area::set_error_status (this=0x271a650, thd=thd@entry=0x27178d0, sql_errno_arg=sql_errno_arg@entry=1213, message_arg=message_arg@entry=0x7fa16c60f6d0 "Deadlock found when trying to get lock; try restarting transaction", sqlstate=sqlstate@entry=0xa7ae27 "40001") at /media/Tintin/Work/code/codership/5.5.30/sql/sql_error.cc:422 #9 0x000000000056fc39 in THD::raise_condition (this=this@entry=0x27178d0, sql_errno=sql_errno@entry=1213, sqlstate=0xa7ae27 "40001", sqlstate@entry=0x0, level=, level@entry=MYSQL_ERROR::WARN_LEVEL_ERROR, msg=msg@entry=0x7fa16c60f6d0 "Deadlock found when trying to get lock; try restarting transaction") at /media/Tintin/Work/code/codership/5.5.30/sql/sql_class.cc:1336 #10 0x0000000000510e46 in my_message_sql (error=1213, str=, MyFlags=0) at /media/Tintin/Work/code/codership/5.5.30/sql/mysqld.cc:2937 #11 0x00000000007fb3a8 in my_error (nr=1213, MyFlags=0) at /media/Tintin/Work/code/codership/5.5.30/mysys/my_error.c:96 #12 0x00000000006ca1c3 in ha_commit_trans (thd=thd@entry=0x27178d0, all=all@entry=false) at /media/Tintin/Work/code/codership/5.5.30/sql/handler.cc:1327 #13 0x0000000000661c60 in trans_commit_stmt (thd=0x27178d0) at /media/Tintin/Work/code/codership/5.5.30/sql/transaction.cc:380 #14 0x0000000000584f46 in select_create::send_eof (this=0x7fa130005ae8) at /media/Tintin/Work/code/codership/5.5.30/sql/sql_insert.cc:4068 #15 0x00000000005d5c76 in do_select (join=join@entry=0x7fa130053f60, fields=fields@entry=0x2719be0, table=table@entry=0x0, procedure=0x0) at /media/Tintin/Work/code/codership/5.5.30/sql/sql_select.cc:11604 #16 0x00000000005e9481 in JOIN::exec (this=this@entry=0x7fa130053f60) at /media/Tintin/Work/code/codership/5.5.30/sql/sql_select.cc:2385 #17 0x00000000005e36ed in mysql_select (thd=thd@entry=0x27178d0, rref_pointer_array=rref_pointer_array@entry=0x2719cb8, tables=0x7fa1300053f0, wild_num=1, fields=..., conds=, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=select_options@entry=2416184064, result=result@entry=0x7fa130005ae8, unit=unit@entry=0x27194b0, select_lex=select_lex@entry=0x2719ad0) at /media/Tintin/Work/code/codership/5.5.30/sql/sql_select.cc:2604 #18 0x00000000005e38e4 in handle_select (thd=thd@entry=0x27178d0, lex=lex@entry=0x2719400, result=result@entry=0x7fa130005ae8, setup_tables_done_option=setup_tables_done_option@entry=0) at /media/Tintin/Work/code/codership/5.5.30/sql/sql_select.cc:297 #19 0x000000000059f451 in mysql_execute_command (thd=thd@entry=0x27178d0) at /media/Tintin/Work/code/codership/5.5.30/sql/sql_parse.cc:2860 #20 0x00000000005a6be6 in mysql_parse (thd=thd@entry=0x27178d0, rawbuf=rawbuf@entry=0x7fa130004c10 "CREATE TABLE y AS SELECT * FROM `table100_innodb_key_pk_parts_2_int`", length=length@entry=69, parser_state=parser_state@entry=0x7fa16c611620) at /media/Tintin/Work/code/codership/5.5.30/sql/sql_parse.cc:6266 #21 0x00000000005a76fb in wsrep_mysql_parse (thd=thd@entry=0x27178d0, rawbuf=0x7fa130004c10 "CREATE TABLE y AS SELECT * FROM `table100_innodb_key_pk_parts_2_int`", length=69, parser_state=parser_state@entry=0x7fa16c611620) at /media/Tintin/Work/code/codership/5.5.30/sql/sql_parse.cc:6099 #22 0x00000000005a8ca0 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x27178d0, packet=packet@entry=0x27724d1 " CREATE TABLE y AS SELECT * FROM `table100_innodb_key_pk_parts_2_int` ", packet_length=packet_length@entry=71) at /media/Tintin/Work/code/codership/5.5.30/sql/sql_parse.cc:1214 #23 0x00000000005ab083 in do_command (thd=0x27178d0) at /media/Tintin/Work/code/codership/5.5.30/sql/sql_parse.cc:869 #24 0x0000000000653150 in do_handle_one_connection (thd_arg=thd_arg@entry=0x27178d0) at /media/Tintin/Work/code/codership/5.5.30/sql/sql_connect.cc:887 #25 0x000000000065333d in handle_one_connection (arg=0x27178d0) at /media/Tintin/Work/code/codership/5.5.30/sql/sql_connect.cc:799 #26 0x00007fa17e4550a2 in start_thread () from /usr/lib/libpthread.so.0 #27 0x00007fa17ccb842d in clone () from /usr/lib/libc.so.6 The grammar used: (note the additional ctas) yy file: # Copyright (C) 2008 Sun Microsystems, Inc. All rights reserved. # Copyright (c) 2013, Monty Program Ab. # Use is subject to license terms. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 # USA # # This grammar is a slightly modified version of engine_stress.yy, # suitable for Galera testing #insert_replace | update | delete | drop_create_table | drop_create_table | replace | ischema | ischema | ischema | alter | # query: transaction | transaction | transaction | select | select | select | select | insert_replace | update | delete | insert_replace | update | delete | insert_replace | update | delete | insert_replace | update | delete | replace | ischema | ischema | ischema | drop_create_table | drop_create_table | ctas | ctas | ctas | insert_replace | update | delete ; ischema: SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX ; replace: REPLACE INTO _table ( _field_no_pk ) VALUES ( value ) ; transaction: START TRANSACTION | COMMIT ; SET TRANSACTION ISOLATION LEVEL isolation_level | ROLLBACK ; SET TRANSACTION ISOLATION LEVEL isolation_level | SAVEPOINT A | ROLLBACK TO SAVEPOINT A | SET AUTOCOMMIT=OFF | SET AUTOCOMMIT=ON ; isolation_level: READ UNCOMMITTED | READ COMMITTED | REPEATABLE READ | SERIALIZABLE ; select: SELECT select_list FROM join_list where order_by LIMIT large_digit; select_list: X . _field_key | X . _field_key | X . `pk` | X . _field | X. _field | X. _field null | X. _field op X. _field | X._field sign X._field | select_list, X._field | * ; null: IS NULL | IS NOT NULL ; op: + | / | DIV ; sign: < | > | = | >= | <= | <> | != ; # Use index for all joins join_list: _table AS X | _table AS X LEFT JOIN _table AS Y USING ( _field_key ); # Insert more than we delete insert_replace: i_r INTO _table (`pk`) VALUES (value) | i_r INTO _table ( _field_no_pk , _field_next ) VALUES ( value , value ) , ( value , value ) | i_r INTO _table ( `pk` , _field_nokey ) VALUES ( value , value ) , ( value , value ) | i_r INTO _table ( _field_no_pk ) SELECT _field_key FROM _table AS X where ORDER BY _field_list LIMIT large_digit; i_r: INSERT ignore | REPLACE; ignore: | IGNORE ; update: UPDATE ignore _table AS X SET _field_no_pk = value where ORDER BY _field_list LIMIT large_digit ; # We use a smaller limit on DELETE so that we delete less than we insert delete: DELETE ignore FROM _table where_delete ORDER BY _field_list LIMIT small_digit ; order_by: | ORDER BY X . _field_key ; # Use an index at all times where: | WHERE X . _field_key < value | # Use only < to reduce deadlocks WHERE X . _field_key IN ( value , value , value , value , value ) | WHERE X . _field_key BETWEEN small_digit AND large_digit | WHERE X . _field_key BETWEEN _tinyint_unsigned AND _int_unsigned; drop_create_table: DROP TABLE IF EXISTS _letter[invariant] ; CREATE temp TABLE _letter[invariant] LIKE _table[invariant] ; INSERT INTO _letter[invariant] SELECT * FROM _table[invariant] | DROP TABLE IF EXISTS _letter[invariant] ; CREATE temp TABLE _letter[invariant] LIKE _table[invariant] ; INSERT INTO _letter[invariant] SELECT * FROM _table[invariant] ; DROP TABLE _table[invariant] ; ALTER TABLE _letter[invariant] RENAME _table[invariant] ; ctas: DROP TABLE IF EXISTS _letter[invariant] ; CREATE temp TABLE _letter[invariant] AS SELECT * FROM _table[invariant] | DROP TABLE IF EXISTS _letter[invariant] ; CREATE temp TABLE _letter[invariant] AS SELECT * FROM _table[invariant] ; DROP TABLE _table[invariant] ; ALTER TABLE _letter[invariant] RENAME _table[invariant] ; temp: | | | | | TEMPORARY; where_delete: | WHERE _field_key = value | WHERE _field_key IN ( value , value , value , value , value ) | WHERE _field_key BETWEEN small_digit AND large_digit ; large_digit: 5 | 6 | 7 | 8 ; small_digit: 1 | 2 | 3 | 4 ; value: _digit | _tinyint_unsigned | _varchar(1) | _int_unsigned ; zero_one: 0 | 0 | 1; type: INT | DECIMAL | FLOAT | BIT | CHAR( _digit ) | VARCHAR ( _digit ); null_default_or_not: | | | | NULL DEFAULT NULL | NOT NULL DEFAULT 0 ; after_or_not: | | AFTER _field | FIRST ; alter: ALTER TABLE _table MODIFY _field_no_key type null_default_or_not after_or_not | ALTER TABLE _table MODIFY _field_key type NOT NULL DEFAULT 0 after_or_not ; ========================================================================================== zz file: # Copyright (C) 2008 Sun Microsystems, Inc. All rights reserved. # Copyright (c) 2013, Monty Program Ab. # Use is subject to license terms. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 # USA # # This data template is a slightly modified version of engine_stress.zz, # suitable for Galera testing # $tables = { partitions => [ undef , 'KEY (pk) PARTITIONS 2' ], engines => [ 'InnoDB' ], pk => [ 'int', 'int auto_increment' ], rows => [ 1, 100, 1000 ] }; $fields = { types => [ 'int', 'char(12)'], indexes => [undef, 'key' ] }; $data = { numbers => [ 'digit', 'null', undef ], strings => [ 'letter', 'english', 'char(12)' ] }