[MDEV-15580] Assertion `!lex->explain' failed in lex_start(THD*): Created: 2018-03-15  Updated: 2018-04-13  Resolved: 2018-04-13

Status: Closed
Project: MariaDB Server
Component/s: Galera
Affects Version/s: 10.1, 10.2, 10.3
Fix Version/s: 10.1.33, 10.2.15, 10.3.6

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Jan Lindström (Inactive)
Resolution: Fixed Votes: 0
Labels: None


 Description   

Note: I didn't try 5.5-galera or 10.0-galera, maybe they are also affected.
Note: The test case is non-deterministic, don't put it into the regression suite, create a synchronized one instead.

# Run with
# --mysqld=--wsrep-provider=<path to the galera library> --mysqld=--wsrep-on --mysqld=--wsrep_cluster_address=gcomm://  --mysqld=--innodb_autoinc_lock_mode=2 --mysqld=--innodb_flush_log_at_trx_commit=0 --mysqld=--innodb_locks_unsafe_for_binlog=1 --mem
 
--source include/have_innodb.inc
--source include/have_binlog_format_row.inc
 
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES  (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
 
--connect (con1,localhost,root,,test)
 
--let $run= 1000
while ($run)
{
  --send
  ALTER TABLE t1 FORCE;
  --connection default
  --error 0,ER_LOCK_DEADLOCK
  CREATE OR REPLACE TABLE t2 ENGINE=InnoDB SELECT SUM(id) FROM t1;
  --connection con1
  --reap
  --dec $run
}
 
# Cleanup
DROP TABLE IF EXISTS t1, t2;
--disconnect con1

10.1 1bec0c459546

Version: '10.1.32-MariaDB-debug'  socket: '/data/bld/10.1/mysql-test/var/tmp/mysqld.1.sock'  port: 16000  Source distribution
mysqld: /data/src/10.1/sql/sql_lex.cc:664: void lex_start(THD*): Assertion `!lex->explain' failed.
180316  0:28:00 [ERROR] mysqld got signal 6 ;
 
#7  0x00007f2dcfcb0ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#8  0x00005592d3359e49 in LEX::start (this=0x7f2d50004870, thd_arg=0x7f2d50000b00) at /data/src/10.3/sql/sql_lex.cc:683
#9  0x00005592d3359d36 in lex_start (thd=0x7f2d50000b00) at /data/src/10.3/sql/sql_lex.cc:664
#10 0x00005592d338add5 in mysql_parse (thd=0x7f2d50000b00, rawbuf=0x7f2d5019644b "CREATE OR REPLACE TABLE `t2` (\n  `SUM(id)` decimal(32,0) DEFAULT NULL\n) ENGINE=InnoDB", length=85, parser_state=0x7f2db972ee10, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7949
#11 0x00005592d3798271 in Query_log_event::do_apply_event (this=0x7f2d5016a460, rgi=0x7f2d500434a0, query_arg=0x7f2d5019644b "CREATE OR REPLACE TABLE `t2` (\n  `SUM(id)` decimal(32,0) DEFAULT NULL\n) ENGINE=InnoDB", q_len_arg=85) at /data/src/10.3/sql/log_event.cc:5596
#12 0x00005592d3797349 in Query_log_event::do_apply_event (this=0x7f2d5016a460, rgi=0x7f2d500434a0) at /data/src/10.3/sql/log_event.cc:5301
#13 0x00005592d32ab4d3 in Log_event::apply_event (this=0x7f2d5016a460, rgi=0x7f2d500434a0) at /data/src/10.3/sql/log_event.h:1481
#14 0x00005592d3597fea in wsrep_apply_events (thd=0x7f2d50000b00, events_buf=0x7f2dbbfffc37, buf_len=170) at /data/src/10.3/sql/wsrep_applier.cc:165
#15 0x00005592d35985d4 in wsrep_apply_cb (ctx=0x7f2d50000b00, buf=0x7f2dbbfffc37, buf_len=318, flags=9, meta=0x7f2db972fbb0) at /data/src/10.3/sql/wsrep_applier.cc:268
#16 0x00007f2dcaf85c9c in galera::TrxHandle::apply (this=this@entry=0x7f2d500510f0, recv_ctx=recv_ctx@entry=0x7f2d50000b00, apply_cb=apply_cb@entry=0x5592d35982b1 <wsrep_apply_cb(void*, void const*, size_t, uint32_t, wsrep_trx_meta_t const*)>, meta=...) at galera/src/trx_handle.cpp:315
#17 0x00007f2dcafcd7a7 in apply_trx_ws (recv_ctx=recv_ctx@entry=0x7f2d50000b00, apply_cb=0x5592d35982b1 <wsrep_apply_cb(void*, void const*, size_t, uint32_t, wsrep_trx_meta_t const*)>, commit_cb=0x5592d35988f5 <wsrep_commit_cb(void*, uint32_t, wsrep_trx_meta_t const*, wsrep_bool_t*, bool)>, trx=..., meta=...) at galera/src/replicator_smm.cpp:39
#18 0x00007f2dcafd2d2e in galera::ReplicatorSMM::replay_trx (this=0x5592d5950a20, trx=0x7f2d500510f0, trx_ctx=0x7f2d50000b00) at galera/src/replicator_smm.cpp:879
#19 0x00007f2dcafe9b6d in galera_replay_trx (gh=<optimized out>, trx_handle=0x7f2d500065a0, recv_ctx=0x7f2d50000b00) at galera/src/wsrep_provider.cpp:314
#20 0x00005592d35999ff in wsrep_replay_transaction (thd=0x7f2d50000b00) at /data/src/10.3/sql/wsrep_thd.cc:269
#21 0x00005592d338a975 in wsrep_mysql_parse (thd=0x7f2d50000b00, rawbuf=0x7f2d50014e48 "CREATE OR REPLACE TABLE t2 ENGINE=InnoDB SELECT SUM(id) FROM t1", length=63, parser_state=0x7f2db97305d0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7835
#22 0x00005592d337865f in dispatch_command (command=COM_QUERY, thd=0x7f2d50000b00, packet=0x7f2d5000b351 "CREATE OR REPLACE TABLE t2 ENGINE=InnoDB SELECT SUM(id) FROM t1", packet_length=63, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1835
#23 0x00005592d33770f5 in do_command (thd=0x7f2d50000b00) at /data/src/10.3/sql/sql_parse.cc:1383
#24 0x00005592d34db5b9 in do_handle_one_connection (connect=0x5592d5e39bb0) at /data/src/10.3/sql/sql_connect.cc:1402
#25 0x00005592d34db346 in handle_one_connection (arg=0x5592d5e39bb0) at /data/src/10.3/sql/sql_connect.cc:1308
#26 0x00005592d39693ed in pfs_spawn_thread (arg=0x5592d5d82b90) at /data/src/10.3/storage/perfschema/pfs.cc:1862
#27 0x00007f2dd1987494 in start_thread (arg=0x7f2db9731700) at pthread_create.c:333
#28 0x00007f2dcfd6d93f in clone () from /lib/x86_64-linux-gnu/libc.so.6


Generated at Thu Feb 08 08:22:28 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.