Bug #21039 Transaction cache not flushed after SELECT CREATE
Submitted: 13 Jul 2006 14:48 Modified: 28 Jul 2006 11:23
Reporter: Magnus Blåudd Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:5.1.12 OS:
Assigned to: Magnus Blåudd CPU Architecture:Any

[13 Jul 2006 14:48] Magnus Blåudd
Description:
This minimal test produces a server crash the connection  is closed and ~THD is called
delimiter |;
create function bug2773() returns int return null|
create table t3 as select bug2773()|

It only shows up in mysql-5.1-new-maint, but it exists also in mysql-5.1 clone, but in there it's "repaired" by a subsequent test:

create table t3 (f1 int, f2 varchar(3), primary key(f1)) engine=innodb|
insert into t3 values (1,'aaa'),(2,'bbb'),(3,'ccc')

Error in master.err is:
mysqld: log.cc:1179: int binlog_close_connection(THD*): Assertion `mysql_bin_log.is_open() && trx_data->empty()' failed.

How to repeat:
delimiter |;
create function bug2773() returns int return null|
create table t3 as select bug2773()|
[17 Jul 2006 15:30] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/9227
[21 Jul 2006 18:49] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/9430
[27 Jul 2006 12:08] Magnus Blåudd
Pushed to 5.1.12
[28 Jul 2006 11:23] MC Brown
Note added to the 5.1.12 changelog: 

When creating a table using <literal>CREATE...SELECT</literal> and a stored procedure, there would be a mismatch between the binary log  and transaction cache which would cause a server crash.