[MDEV-5328] Assertion `0' fails on creating a temporary table via trigger (MySQL:70983) Created: 2013-11-22  Updated: 2014-11-17  Resolved: 2014-11-16

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Temporary, Triggers
Affects Version/s: 5.1.67, 5.2.14, 5.3.12, 5.5.34, 10.0.6
Fix Version/s: 10.0.14

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: upstream-fixed


 Description   

create table t1 (i int);
create trigger tr after insert on t1 for each row
  create temporary table tmp as select new.i;
 
insert into t1 values (1);

sql/protocol.cc:518: void Protocol::end_statement(): Assertion `0' failed.
131122 21:21:26 [ERROR] mysqld got signal 6 ;

#6  0x00007f0e94cb5621 in *__GI___assert_fail (assertion=0xd4ed6d "0", file=<optimized out>, line=518, function=0xd4ff60 "void Protocol::end_statement()") at assert.c:81
#7  0x0000000000594054 in Protocol::end_statement (this=0x7f0e9067e628) at /home/elenst/bzr/5.5/sql/protocol.cc:518
#8  0x000000000062d973 in dispatch_command (command=COM_QUERY, thd=0x7f0e9067e060, packet=0x7f0e907d7061 "insert into t1 values (1)", packet_length=25) at /home/elenst/bzr/5.5/sql/sql_parse.cc:1471
#9  0x000000000062b796 in do_command (thd=0x7f0e9067e060) at /home/elenst/bzr/5.5/sql/sql_parse.cc:793
#10 0x000000000072c9ae in do_handle_one_connection (thd_arg=0x7f0e9067e060) at /home/elenst/bzr/5.5/sql/sql_connect.cc:1266
#11 0x000000000072c46d in handle_one_connection (arg=0x7f0e9067e060) at /home/elenst/bzr/5.5/sql/sql_connect.cc:1181
#12 0x00000000009746d5 in pfs_spawn_thread (arg=0x7f0e90683f80) at /home/elenst/bzr/5.5/storage/perfschema/pfs.cc:1015
#13 0x00007f0e96215b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
#14 0x00007f0e94d64a7d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

revision-id: elenst@wheezy-64.home-20131122160336-h4180sqb00z6xyvh
revno: 3983
branch-nick: 5.5
BUILD/compile-pentium-debug-max-no-ndb



 Comments   
Comment by Elena Stepanova [ 2014-11-16 ]

The upstream bug was fixed in 5.7.1.
Independently, the problem disappeared from 10.0 tree with the following revision:

revno: 4377
revision-id: sergii@pisem.net-20140906074641-93m5s4lde7p45x08
parent: sergii@pisem.net-20140906063356-8kpu546j1utk0kmf
fixes bug: https://mariadb.atlassian.net/browse/MDEV-6610
committer: Sergei Golubchik <sergii@pisem.net>
branch nick: 10.0
timestamp: Sat 2014-09-06 09:46:41 +0200
message:
  MDEV-6610 Assertion `thd->is_error() || thd->killed' failed in mysql_execute_command on executing an SP with repeated CREATE TABLE .. SELECT
  
  the bug was introduced by CREATE OR REPLACE implementation.
  CREATE IF NOT EXISTS ... SELECT was returning an error status to the caller,
  while sending an ok packet to the user. SP code was not prepared for that
  and trusted that error status means an error.

Closing as fixed in 10.0.

Generated at Thu Feb 08 07:03:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.