|
I was able to reduce one testcase down to 61 lines. It is still very convoluted with the original query outcomes (";# ....") that may no longer be correct (testcase reduction regularly changes query outcomes when lines are removed), extraneous idioms and statements etc.
However, what is sure is that this testcase can produce the given crash (it is not clear yet if a C-based client is required (i.e. rather than CLI), it looks like it is). Also ref note below re: innodb_max_dirty_pages_pct.
The bug requires only a single SQL input thread. Note that this testcase is highly sporadic (perhaps 1 in 10000, if that).
Options used during the run (most of these would not be required to reproduce the issue. Note smaller buffer pool.
--max_allowed_packet=33554432 --maximum-bulk_insert_buffer_size=1M --maximum-join_buffer_size=1M --maximum-max_heap_table_size=1M --maximum-max_join_size=1M --maximum-myisam_max_sort_file_size=1M --maximum-myisam_mmap_size=1M --maximum-myisam_sort_buffer_size=1M --maximum-optimizer_trace_max_mem_size=1M --maximum-preload_buffer_size=1M --maximum-query_alloc_block_size=1M --maximum-query_prealloc_size=1M --maximum-range_alloc_block_size=1M --maximum-read_buffer_size=1M --maximum-read_rnd_buffer_size=1M --maximum-sort_buffer_size=1M --maximum-tmp_table_size=1M --maximum-transaction_alloc_block_size=1M --maximum-transaction_prealloc_size=1M --log-output=none --sql_mode= --sql_mode= --deadlock-timeout-short=10 --deadlock-timeout-long=10 --deadlock-search-depth-short=10 --deadlock-search-depth-long=33 --innodb_change_buffering=inserts --innodb_fast_shutdown=1 --innodb_file_per_table=1 --log-bin --binlog_format=ROW --log_bin_trust_function_creators=1 --innodb-buffer-pool-size=300M --loose-debug_assert_on_not_freed_memory=1 --innodb_use_native_aio=1
|
Note the innodb_max_dirty_pages_pct setting towards the end is almost definitely related to the assert. Testcase:
create TABLE t1 ( id int unsigned auto_increment, primary key(id) ) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"' COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"';#ERROR: 2014 - Commands out of sync; you can't run this command now
|
CREATE TABLE IF NOT EXISTS help_category ( help_category_id smallint unsigned not null, name char(64) not null, parent_category_id smallint unsigned null, url char(128) not null, primary key (help_category_id), unique index (name) ) engine=InnoDB CHARACTER SET utf8 comment='help categories';#ERROR: 2014 - Commands out of sync; you can't run this command now
|
INSERT INTO t1 VALUES (8484+0.75);#NOERROR
|
DROP TABLE IF EXISTS t1;#ERROR: 1399 - XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
|
CREATE TABLE t2 (a int);#ERROR: 1399 - XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
|
INSERT INTO t2 VALUES ('m7l,Fe]LbxoGHr~miZgfL"Q;y&R=RXH![6TY^UG!FX8o[gRVe%,?:a0~7azQ:C=nHGnIi<#h{SCyIl*zPF]Oo+lGI,CI$4=$~Li:JG7*/u;z>n>[x&:1*2R1:J!Pmg`tuDXqY*>:ds:9<0zI]jI2Ve@V+^`Z:BQ=l"Dht0:%Jv8Q&S>-i`P_7CK9QmGWC<K<dSeap;>Ow[}(n"):mz,"fA?C;VEIW=dMgT>i7R`[T>%uQNERuHlW1Xl&S"H>ACUQ~Ssyi~4M>^Z)[U9?)CBY+BrR4Qr~3>0haKv8,(,J(D;e:WM)41jZ}g],q/','hE_1z9A:>jfBaR@K5:D{SqY@t*5!JM`n)a59OS=8aZbVr;J$q0D;^jKpFvjFa>3l5U:WiB%]TmK.#;#3&Sf?"g5lQw#v+}%#X<BF}Y/L^@~o]=5KBEgPOkdrsk?*u!@w"]UVXBM^p9bbT~`&nZzT6}QPm-H(rSeuT-D+QOQBKT9(es;xT1;Pk:L)`0pr71!TX%`u"f`,/v[jQrWK?3xsQ{]b;ssx3GQq6V:Y_ZiJ@ioE[u9Mmrl>q)D6*aqveYAL~04F%lIv+tzdIC,=vJFJY@U=Q3*(Cmhud{#ewm8@lk=y3L30[_UMJ)7AEn~vMm~~omoJ;LR/.pO8XbPq6r1uxGIC2&m>nv*jX/>yN+$".gse9<)KDnq1CPh*aYM~Pki;+[{^ooSD4Wgq,9,*zs)d$0@xy;.W;bCgulpNfc_HO4#;PbV}I-','UIJ/,1"VZ;[SOnDi>n3O]#mb9q^*kd"U%a/=x6WEd6!3r^6NI&>4-e)Kylj$5L4!^.SAEmfU+OuM>}^N*pN:uFjnim*rB?g1F(mF1/,obz&b_"-+D2');#ERROR: 1399 - XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
|
CREATE TABLE t1 (s1 VARCHAR (60) CHARACTER SET UTF8 COLLATE UTF8_UNICODE_520_CI) ENGINE=FEDERATED COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"';#ERROR: 1399 - XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
|
CREATE TEMPORARY TABLE t1 (c1 INT) ENGINE=RocksDB;#ERROR: 2014 - Commands out of sync; you can't run this command now
|
CREATE TABLE bug11754376 (c INT) ENGINE=FEDERATED COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"'#ERROR: 2014 - Commands out of sync; you can't run this command now
|
CREATE TABLE m3(c1 BIT NULL, c2 BINARY(25) NOT NULL, c3 MEDIUMINT(4) NULL, c4 BINARY(15) NOT NULL PRIMARY KEY, c5 BIT NOT NULL UNIQUE KEY,c6 DEC(10,8) NOT NULL DEFAULT 3.141592);#ERROR: 2014 - Commands out of sync; you can't run this command now
|
DROP TABLE t1;#ERROR: 1399 - XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
|
CREATE TABLE IF NOT EXISTS t3 (c1 INT(254) UNSIGNED ZEROFILL,c2 BIGINT,c3 SET('a','b','c') CHARACTER SET 'latin1' COLLATE 'latin1_bin', PRIMARY KEY(c1)) ENGINE=InnoDB;#ERROR: 1399 - XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
|
insert INTO t1 values (0xF2808080);#ERROR: 1399 - XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
|
create table test_user select * from mysql.user;#ERROR: 1163 - Storage engine MEMORY doesn't support BLOB/TEXT columns
|
OPTIMIZE NO_WRITE_TO_BINLOG TABLE t3;#NOERROR
|
INSERT INTO t1 SELECT * FROM t1 ;#NOERROR#NOERROR
|
TRUNCATE t2;#NOERROR
|
drop table t1,t2;#NOERROR
|
CREATE TABLE t1 (c INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=Spider ROW_FORMAT=COMPRESSED;#ERROR: 2014 - Commands out of sync; you can't run this command now
|
CREATE TABLE t5 (c1 MEDIUMINT NOT NULL);#ERROR: 1050 - Table 't5' already exists
|
SELECT * FROM t3 INTO OUTFILE 'out5';#NOERROR
|
ALTER TABLE t3 CHANGE c1 c1 NUMERIC NOT NULL;#ERROR: 1399 - XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state#NOERROR
|
ALTER TABLE t3 ENGINE=RocksDB;#NOERROR
|
CREATE TABLE ti (a BIGINT UNSIGNED, b MEDIUMINT UNSIGNED, c CHAR(35) NOT NULL, d VARCHAR(97) NOT NULL, e VARCHAR(65), f VARBINARY(46), g BLOB NOT NULL, h MEDIUMBLOB, id BIGINT NOT NULL, KEY(b), KEY(e), PRIMARY KEY(id)) engine=innodb;#NOERROR
|
CREATE TABLE merge_table_2 (message CHAR(20)) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"'#NOERROR
|
CREATE TABLE pct_cached_evict (a TEXT) ENGINE=RocksDB;#NOERROR
|
INSERT INTO t1 VALUES (8030,repeat('a', 2000)),(8030,repeat('b', 2000)),(8030,repeat('c', 2000)),(8030,repeat('d', 2000)),(8030,repeat('e', 2000)),(8030,repeat('f', 2000)),(8030,repeat('g', 2000)),(8030,repeat('h', 2000)),(8030,repeat('i', 2000)),(8030,repeat('j', 2000));#ERROR: 2014 - Commands out of sync; you can't run this command now
|
ALTER TABLE t3 MODIFY c3 TIMESTAMP(3);#ERROR: 2014 - Commands out of sync; you can't run this command now
|
CREATE TABLE IF NOT EXISTS v1 SELECT 2 as a;#NOERROR
|
CREATE TABLE st1 like t1;#NOERROR
|
DROP DATABASE test;#ERROR: 1010 - Error dropping database (can't rmdir './test', errno: 39 "Directory not empty")
|
create table t1 (a varchar(1) character set latin1 collate latin1_general_ci);#NOERROR
|
INSERT INTO t1 VALUES (2);#NOERROR
|
DROP TABLE t1;#ERROR: 1051 - Unknown table 'test.t1'#NOERROR
|
CREATE TABLE ti (a INT, b BIGINT NOT NULL, c CHAR(15), d VARBINARY(94), e VARCHAR(14) NOT NULL, f VARCHAR(19) NOT NULL, g BLOB NOT NULL, h MEDIUMBLOB, id BIGINT NOT NULL, KEY(b), KEY(e), PRIMARY KEY(id)) ENGINE=RocksDB;#ERROR: 2014 - Commands out of sync; you can't run this command now
|
CREATE TABLE t ( i INT AUTO_INCREMENT, KEY(i) ) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"';#NOERROR
|
CREATE TABLE t1 (a INT) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"' COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"' CHECKSUM=1 ROW_FORMAT=DYNAMIC;#ERROR: 2014 - Commands out of sync; you can't run this command now
|
CREATE TABLE `table_in_connected_db`(i INT);#NOERROR
|
DROP TABLE t1;#NOERROR
|
CREATE TABLE t1 (c1 SMALLINT NOT NULL);#ERROR: 1050 - Table 't1' already exists
|
CREATE TABLE t5(c1 INT, c2 char(20)) ENGINE=FEDERATED COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"';#NOERROR
|
CREATE TABLE t3 (c1 INT NOT NULL);#NOERROR
|
INSERT INTO t1 VALUES(111111111111111111111111111111111111);#NOERROR
|
ALTER TABLE t1 MODIFY COLUMN c1 VARCHAR(255) NOT NULL DEFAULT '';#ERROR: 1054 - Unknown column 'c1' in 't1'
|
CREATE TABLE t606 (c1 INTEGER);#NOERROR
|
CREATE TABLE x (a INT) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"';#ERROR: 2014 - Commands out of sync; you can't run this command now
|
INSERT INTO t1 VALUES (16148);#ERROR: 2014 - Commands out of sync; you can't run this command now
|
ALTER TABLE ti ENGINE=Aria;#ERROR: 2014 - Commands out of sync; you can't run this command now
|
drop table if exists t1,t2;#NOERROR
|
CREATE TABLE t1 (c int) ENGINE=InnoDB;#NOERROR
|
CREATE TABLE t170 (c1 INTEGER);#NOERROR
|
create table test.RocksDBt3s2 (a int primary key, b int) engine=RocksDB;#ERROR: 2014 - Commands out of sync; you can't run this command now
|
ANALYZE TABLE t1,t2,t3,t4;#NOERROR
|
DROP TABLE t1,t2,t3,t4;#ERROR: 1051 - Unknown table 'test.t2,test.t4'
|
CREATE TABLE t1 (id INT NOT NULL, ref INT NOT NULL, INDEX (id)) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"' COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"';#ERROR: 1286 - Unknown storage engine 'Spider'
|
SET @@global.innodb_max_dirty_pages_pct = FALSE;#NOERROR#NOERROR
|
DROP TABLE t, ti; ;
|
The testcase is continuing to reduce on a dedicated server runnning 100 mariadbd's simultaneously, each trying to reduce the testcase further. We are at 61 58 56 lines now.
Update (6 May): the best reduced testcase was still 56 lines, but was able to remove most comments etc. Testcase:
--no-defaults --max_allowed_packet=33554432 --maximum-bulk_insert_buffer_size=1M --maximum-join_buffer_size=1M --maximum-max_heap_table_size=1M --maximum-max_join_size=1M --maximum-myisam_max_sort_file_size=1M --maximum-myisam_mmap_size=1M --maximum-myisam_sort_buffer_size=1M --maximum-optimizer_trace_max_mem_size=1M --maximum-preload_buffer_size=1M --maximum-query_alloc_block_size=1M --maximum-query_prealloc_size=1M --maximum-range_alloc_block_size=1M --maximum-read_buffer_size=1M --maximum-read_rnd_buffer_size=1M --maximum-sort_buffer_size=1M --maximum-tmp_table_size=1M --maximum-transaction_alloc_block_size=1M --maximum-transaction_prealloc_size=1M --log-output=none --sql_mode= --sql_mode= --deadlock-timeout-short=10 --deadlock-timeout-long=10 --deadlock-search-depth-short=10 --deadlock-search-depth-long=33 --innodb_change_buffering=inserts --innodb_fast_shutdown=1 --innodb_file_per_table=1 --log-bin --binlog_format=ROW --log_bin_trust_function_creators=1 --innodb-buffer-pool-size=300M --loose-debug_assert_on_not_freed_memory=1 --innodb_use_native_aio=1
|
create TABLE t1 ( id int unsigned auto_increment, primary key(id) ) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"' COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"';
|
CREATE TABLE IF NOT EXISTS help_category ( help_category_id smallint unsigned not null, name char(64) not null, parent_category_id smallint unsigned null, url char(128) not null, primary key (help_category_id), unique index (name) ) engine=InnoDB CHARACTER SET utf8 comment='help categories';
|
INSERT INTO t1 VALUES (8484+0.75);
|
DROP TABLE IF EXISTS t1;
|
CREATE TABLE t2 (a int);
|
CREATE TABLE t1 (s1 VARCHAR (60) CHARACTER SET UTF8 COLLATE UTF8_UNICODE_520_CI) ENGINE=FEDERATED COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"';
|
CREATE TEMPORARY TABLE t1 (c1 INT) ENGINE=RocksDB;
|
CREATE TABLE bug11754376 (c INT) ENGINE=FEDERATED COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"';#ERROR: 2014 - Commands out of sync; you can't run this command now
|
CREATE TABLE m3(c1 BIT NULL, c2 BINARY(25) NOT NULL, c3 MEDIUMINT(4) NULL, c4 BINARY(15) NOT NULL PRIMARY KEY, c5 BIT NOT NULL UNIQUE KEY,c6 DEC(10,8) NOT NULL DEFAULT 3.141592);
|
DROP TABLE t1;
|
CREATE TABLE IF NOT EXISTS t3 (c1 INT(254) UNSIGNED ZEROFILL,c2 BIGINT,c3 SET('a','b','c') CHARACTER SET 'latin1' COLLATE 'latin1_bin', PRIMARY KEY(c1)) ENGINE=InnoDB;
|
insert INTO t1 values (0xF2808080);
|
create table test_user select * from mysql.user;
|
OPTIMIZE NO_WRITE_TO_BINLOG TABLE t3;
|
INSERT INTO t1 SELECT * FROM t1 ;
|
TRUNCATE t2;
|
drop table t1,t2;
|
CREATE TABLE t1 (c INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=Spider ROW_FORMAT=COMPRESSED;
|
CREATE TABLE t5 (c1 MEDIUMINT NOT NULL);
|
SELECT * FROM t3 INTO OUTFILE 'out5';
|
ALTER TABLE t3 CHANGE c1 c1 NUMERIC NOT NULL;
|
ALTER TABLE t3 ENGINE=RocksDB;
|
CREATE TABLE ti (a BIGINT UNSIGNED, b MEDIUMINT UNSIGNED, c CHAR(35) NOT NULL, d VARCHAR(97) NOT NULL, e VARCHAR(65), f VARBINARY(46), g BLOB NOT NULL, h MEDIUMBLOB, id BIGINT NOT NULL, KEY(b), KEY(e), PRIMARY KEY(id)) engine=innodb;
|
CREATE TABLE merge_table_2 (message CHAR(20)) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"';#NOERROR
|
CREATE TABLE pct_cached_evict (a TEXT) ENGINE=RocksDB;
|
INSERT INTO t1 VALUES (8030,repeat('a', 2000)),(8030,repeat('b', 2000)),(8030,repeat('c', 2000)),(8030,repeat('d', 2000)),(8030,repeat('e', 2000)),(8030,repeat('f', 2000)),(8030,repeat('g', 2000)),(8030,repeat('h', 2000)),(8030,repeat('i', 2000)),(8030,repeat('j', 2000));
|
ALTER TABLE t3 MODIFY c3 TIMESTAMP(3);
|
CREATE TABLE IF NOT EXISTS v1 SELECT 2 as a;
|
CREATE TABLE st1 like t1;
|
DROP DATABASE test;
|
create table t1 (a varchar(1) character set latin1 collate latin1_general_ci);
|
DROP TABLE t1;
|
CREATE TABLE ti (a INT, b BIGINT NOT NULL, c CHAR(15), d VARBINARY(94), e VARCHAR(14) NOT NULL, f VARCHAR(19) NOT NULL, g BLOB NOT NULL, h MEDIUMBLOB, id BIGINT NOT NULL, KEY(b), KEY(e), PRIMARY KEY(id)) ENGINE=RocksDB;
|
CREATE TABLE t ( i INT AUTO_INCREMENT, KEY(i) ) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"';
|
CREATE TABLE t1 (a INT) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"' COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"' CHECKSUM=1 ROW_FORMAT=DYNAMIC;
|
CREATE TABLE `table_in_connected_db`(i INT);
|
DROP TABLE t1;
|
CREATE TABLE t1 (c1 SMALLINT NOT NULL);
|
CREATE TABLE t5(c1 INT, c2 char(20)) ENGINE=FEDERATED COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"';
|
CREATE TABLE t3 (c1 INT NOT NULL);
|
INSERT INTO t1 VALUES(111111111111111111111111111111111111);
|
ALTER TABLE t1 MODIFY COLUMN c1 VARCHAR(255) NOT NULL DEFAULT '';
|
CREATE TABLE t606 (c1 INTEGER);
|
CREATE TABLE x (a INT) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"';
|
INSERT INTO t1 VALUES (16148);
|
ALTER TABLE ti ENGINE=Aria;
|
drop table if exists t1,t2;
|
CREATE TABLE t1 (c int) ENGINE=InnoDB;
|
CREATE TABLE t170 (c1 INTEGER);
|
create table test.RocksDBt3s2 (a int primary key, b int) engine=RocksDB;
|
ANALYZE TABLE t1,t2,t3,t4;
|
DROP TABLE t1,t2,t3,t4;
|
CREATE TABLE t1 (id INT NOT NULL, ref INT NOT NULL, INDEX (id)) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"' COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"';
|
SET @@global.innodb_max_dirty_pages_pct = FALSE;
|
DROP TABLE t, ti; ;
|
SELECT SLEEP(2);
|
|