Bug #26845 Server thread crash
Submitted: 5 Mar 2007 16:54 Modified: 5 Mar 2007 20:00
Reporter: João Mota Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: General Severity:S2 (Serious)
Version:5.0.27-community OS:Linux (Linux, W32)
Assigned to: CPU Architecture:Any

[5 Mar 2007 16:54] João Mota
Description:
When upgrading from 5.0.22 to 5.0.27 one of my views started to fail. After going through the daemon logs I found the following message:

Version: '5.0.27'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
mysqld got signal 11;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

...and so on.

I'm shure that I'm not the best one to debbug this or even try to do a strace so I've simplified the steps to the query so anyone can repeat the error/crash.

If indeed the strace info is usefull please let me know and I'll post it.

How to repeat:
As far I as know, the simplest way to reproduce this is:

create database ttt;
use ttt;

CREATE TABLE `t1` (
  `id` INT(10)
) ENGINE = INNODB;

CREATE TABLE `t2` (
  `id` int(10),
  `a` int(10)
) ENGINE=MyISAM;

CREATE TABLE `t3` (
  `id` INT(10),
  `b` INT(10)
) ENGINE = INNODB;

CREATE TABLE `t5` (
  `c` INT(10),
  INDEX `ic` (`c`)
) ENGINE = INNODB;

CREATE VIEW t4 AS SELECT t3.id
FROM t3 LEFT JOIN t5 ON t3.id=t5.c;

SELECT * FROM ((t3 LEFT JOIN t4 ON t3.id=t4.id) LEFT JOIN t1 ON t3.b=t1.id) INNER JOIN t2 ON t3.id=t2.a;
[5 Mar 2007 20:00] Valeriy Kravchuk
Thank you for a bug report. I was able to repeat the carsh just as you described with 5.0.27 on Windows. 

But with latest 5.0.36 released officially I've got no crashes:

-bash-2.05b$ bin/mysql -uroot test --socket=/tmp/valeriy.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.36-enterprise-gpl MySQL Enterprise Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create database ttt;
mysql> use ttt;
Database changed

mysql> CREATE TABLE `t1` (
    ->   `id` INT(10)
    -> ) ENGINE = INNODB;
Query OK, 0 rows affected (1.53 sec)

mysql> CREATE TABLE `t2` (
    ->   `id` int(10),
    ->   `a` int(10)
    -> ) ENGINE=MyISAM;
Query OK, 0 rows affected (0.01 sec)

mysql> CREATE TABLE `t3` (
    ->   `id` INT(10),
    ->   `b` INT(10)
    -> ) ENGINE = INNODB;
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE TABLE `t5` (
    ->   `c` INT(10),
    ->   INDEX `ic` (`c`)
    -> ) ENGINE = INNODB;
Query OK, 0 rows affected (0.01 sec)

mysql> CREATE VIEW t4 AS SELECT t3.id
    -> FROM t3 LEFT JOIN t5 ON t3.id=t5.c;
Query OK, 0 rows affected (0.30 sec)

mysql> SELECT * FROM ((t3 LEFT JOIN t4 ON t3.id=t4.id) LEFT JOIN t1 ON t3.b=t1.id)
    -> INNER JOIN t2 ON t3.id=t2.a;
Empty set (0.24 sec)

So, looks like bug is already fixed in current versions.