Bug #57196 more fun with assertion: !table->file || table->file->inited == handler::NONE
Submitted: 2 Oct 2010 12:14 Modified: 10 Feb 2012 13:46
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S1 (Critical)
Version:5.0.91, 5.1.52, 5.6.1 OS:Any
Assigned to: CPU Architecture:Any

[2 Oct 2010 12:14] Shane Bester
Description:
Version: '5.1.52-debug'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
101002 14:05:17 [ERROR] trx->active_trans == 0, but trx->conc_state != TRX_NOT_STARTED
mysqld: sql_base.cc:1381: bool close_thread_table(THD*, TABLE**): Assertion `!table->file || table->file->inited == handler::NONE' failed.
101002 14:05:17 - mysqld got signal 6 ;

How to repeat:
# debug server crashes after client receives a result.
# non-debug server just prints error: 
# trx->active_trans == 0, but trx->conc_state != TRX_NOT_STARTED

drop table if exists `t1`;
create table `t1`(`a` int)engine=innodb;
insert into `t1` values (0);
select distinct pow(count(*),
@a:=(select 1 from `t1` left join `t1` `t2`
on @a))`b` from `t1` group by `a`;
[2 Oct 2010 12:57] MySQL Verification Team
Thank you for the bug report. Verified as described.
[10 Feb 2012 13:46] Paul DuBois
Noted in 5.6.5 changelog.

Assigning the result of a subquery to a user variable raised an
assertion when the outer query included DISTINCT and GROUP BY.
[20 May 2013 15:29] Paul DuBois
Noted in 5.1.71, 5.5.33 changelogs.