|
Ran into this one also from a different angle:
SET @@GLOBAL.innodb_trx_rseg_n_slots_debug=1,@@SESSION.pseudo_slave_mode=ON;
|
CREATE TABLE t1 (a INT KEY) ENGINE=InnoDB;
|
CREATE TABLE t2 (a INT KEY) ENGINE=InnoDB;
|
XA START 'a';
|
INSERT INTO t2 VALUES (0);
|
XA END 'a';
|
XA PREPARE 'a';
|
DROP TABLE t1; # ERROR 1637 (HY000): Too many active concurrent transactions
|
SELECT * FROM t1; # ERROR 1030 (HY000): Got error 1877 "Unknown error 1877" from storage engine InnoDB
|
SELECT a FROM t1 WHERE a=(SELECT MAX(a) FROM t1); # Crash
|
Leads to:
|
10.6.0 a3e3225cd3b816d47621e749e21a71b6a864a96a (Debug)
|
mysqld: /test/10.6_dbg/sql/handler.h:3410: int handler::ha_index_end(): Assertion `inited==INDEX' failed.
|
|
10.6.0 a3e3225cd3b816d47621e749e21a71b6a864a96a (Debug)
|
Core was generated by `/test/MD150421-mariadb-10.6.0-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 0x151bf00e9700 (LWP 4110476))]
|
(gdb) bt
|
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
|
#1 0x0000151bf2ca7859 in __GI_abort () at abort.c:79
|
#2 0x0000151bf2ca7729 in __assert_fail_base (fmt=0x151bf2e3d588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5612acd7d995 "inited==INDEX", file=0x5612acb607ec "/test/10.6_dbg/sql/handler.h", line=3410, function=<optimized out>) at assert.c:92
|
#3 0x0000151bf2cb8f36 in __GI___assert_fail (assertion=assertion@entry=0x5612acd7d995 "inited==INDEX", file=file@entry=0x5612acb607ec "/test/10.6_dbg/sql/handler.h", line=line@entry=3410, function=function@entry=0x5612acb60904 "int handler::ha_index_end()") at assert.c:101
|
#4 0x00005612ac37ca28 in handler::ha_index_end (this=0x151ba4089280) at /test/10.6_dbg/sql/handler.h:3410
|
#5 opt_sum_query (thd=0x151ba4000db8, tables=@0x151ba4014d00: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x151ba4017ab8, last = 0x151ba4017ab8, elements = 1}, <No data fields>}, all_fields=@0x151ba4017868: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x151ba40151f8, last = 0x151ba40151f8, elements = 1}, <No data fields>}, conds=0x0) at /test/10.6_dbg/sql/opt_sum.cc:422
|
#6 0x00005612abf604c2 in JOIN::optimize_inner (this=this@entry=0x151ba4017540) at /test/10.6_dbg/sql/sql_select.cc:2169
|
#7 0x00005612abf60b40 in JOIN::optimize (this=this@entry=0x151ba4017540) at /test/10.6_dbg/sql/sql_select.cc:1630
|
#8 0x00005612abea9fdb in st_select_lex::optimize_unflattened_subqueries (this=0x151ba4013c70, const_only=const_only@entry=true) at /test/10.6_dbg/sql/sql_lex.cc:4886
|
#9 0x00005612ac097ff3 in JOIN::optimize_constant_subqueries (this=this@entry=0x151ba4016e90) at /test/10.6_dbg/sql/opt_subselect.cc:5589
|
#10 0x00005612abf5f7b1 in JOIN::optimize_inner (this=this@entry=0x151ba4016e90) at /test/10.6_dbg/sql/sql_select.cc:1937
|
#11 0x00005612abf60b40 in JOIN::optimize (this=this@entry=0x151ba4016e90) at /test/10.6_dbg/sql/sql_select.cc:1630
|
#12 0x00005612abf614a4 in mysql_select (thd=thd@entry=0x151ba4000db8, tables=0x151ba4014290, fields=@0x151ba4013dc0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x151ba4014248, last = 0x151ba4014248, elements = 1}, <No data fields>}, conds=0x151ba4016328, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x151ba4016e68, unit=0x151ba4004f90, select_lex=0x151ba4013c70) at /test/10.6_dbg/sql/sql_select.cc:4735
|
#13 0x00005612abf617b9 in handle_select (thd=thd@entry=0x151ba4000db8, lex=lex@entry=0x151ba4004ec8, result=result@entry=0x151ba4016e68, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.6_dbg/sql/sql_select.cc:419
|
#14 0x00005612abed48b5 in execute_sqlcom_select (thd=thd@entry=0x151ba4000db8, all_tables=0x151ba4014290) at /test/10.6_dbg/sql/sql_parse.cc:6244
|
#15 0x00005612abee177d in mysql_execute_command (thd=thd@entry=0x151ba4000db8) at /test/10.6_dbg/sql/sql_parse.cc:3940
|
#16 0x00005612abecda06 in mysql_parse (thd=thd@entry=0x151ba4000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x151bf00e8410) at /test/10.6_dbg/sql/sql_parse.cc:8017
|
#17 0x00005612abedc7df in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x151ba4000db8, packet=packet@entry=0x151ba400b369 "SELECT a FROM t1 WHERE a=(SELECT MAX(a) FROM t1)", packet_length=packet_length@entry=48, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_class.h:1331
|
#18 0x00005612abedfbd5 in do_command (thd=0x151ba4000db8, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_parse.cc:1406
|
#19 0x00005612ac03977c in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5612af7e9818, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
|
#20 0x00005612ac039d81 in handle_one_connection (arg=arg@entry=0x5612af7e9818) at /test/10.6_dbg/sql/sql_connect.cc:1312
|
#21 0x00005612ac4e7a03 in pfs_spawn_thread (arg=0x5612af6ffbd8) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
|
#22 0x0000151bf31b5609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#23 0x0000151bf2da4293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
Bug confirmed present in:
MariaDB: 10.5.10 (dbg), 10.6.0 (dbg)
Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.2.38 (dbg), 10.2.38 (opt), 10.3.29 (dbg), 10.3.29 (opt), 10.4.19 (dbg), 10.4.19 (opt), 10.5.10 (opt), 10.6.0 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.33 (dbg), 5.7.33 (opt), 8.0.23 (dbg), 8.0.23 (opt)
Optimized build gives:
|
10.6.0 a3e3225cd3b816d47621e749e21a71b6a864a96a (Optimized)
|
ERROR 1399 (XAE07): XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state
|
And this is also the result on 10.4, thus for this testcase there is a new regression in 10.5/10.6
As per Marko, "I guess the XA transaction is in a limbo state. Normally, DDL statements silently commit any open transaction. IMO, if XA has been requested, the DROP TABLE should return an error. Likewise, executing anything else than XA ROLLBACK or XA COMMIT after XA PREPARE is wrong and should return an error. So, this should actually belong to the runtime team."
Testcase seems non-sporadic.
|