Bug #27768 Falcon: crash if create database and create table
Submitted: 11 Apr 2007 20:51 Modified: 26 Apr 2007 11:01
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S2 (Serious)
Version:5.2.4-falcon-alpha-debug OS:Linux (SUSE 10.0 / 64-bit)
Assigned to: CPU Architecture:Any

[11 Apr 2007 20:51] Peter Gulutzan
Description:
I create a procedure which has a loop.
In the loop, I drop database, create database, create table.
I call the procedure.
Crash.

It might take a long time to crash. It seems that there's
a rare problem which occurs when I say CREATE TABLE
immediately after CREATE DATABASE. This caused crashes
for the initial setup steps of Bug#27767
"Falcon: crash after select for update",
which I initially thought were irreproducible.

ChangeSet@1.2575.1.1, 2007-04-10

How to repeat:
delimiter //
drop procedure test.p//
use test
delimiter //
create database d//
create procedure p ()
begin
  declare v int default 0;
  while v < 10000 do
    select v, 'drop database d';
    drop database d;
    select v, 'create database d';
    create database d;
    select v, 'create table d.t (s1 int, key(s1))';
    create table d.t (s1 int, key(s1)) engine=falcon;
    commit;
    set v = v + 1;
    end while;
end//
call p()//

Example run:

mysql> delimiter //
mysql> create database d//
Query OK, 1 row affected (0.00 sec)

mysql> create procedure p ()
    -> begin
    ->   declare v int default 0;
    ->   while v < 10000 do
    ->     select v, 'drop database d';
    ->     drop database d;
    ->     select v, 'create database d';
    ->     create database d;
    ->     select v, 'create table d.t (s1 int, key(s1))';
    ->     create table d.t (s1 int, key(s1)) engine=falcon;
    ->     commit;
    ->     set v = v + 1;
    ->     end while;
    -> end//
Query OK, 0 rows affected (0.01 sec)

mysql> call p()//
+------+-----------------+
| v    | drop database d |
+------+-----------------+
|    0 | drop database d |
+------+-----------------+
1 row in set (0.00 sec)

+------+-------------------+
| v    | create database d |
+------+-------------------+
|    0 | create database d |
+------+-------------------+
1 row in set (0.19 sec)

+------+------------------------------------+
| v    | create table d.t (s1 int, key(s1)) |
+------+------------------------------------+
|    0 | create table d.t (s1 int, key(s1)) |
+------+------------------------------------+
1 row in set (0.19 sec)

...

+------+-----------------+
| v    | drop database d |
+------+-----------------+
|   12 | drop database d |
+------+-----------------+
1 row in set (14.16 sec)

+------+-------------------+
| v    | create database d |
+------+-------------------+
|   12 | create database d |
+------+-------------------+
1 row in set (14.23 sec)

+------+------------------------------------+
| v    | create table d.t (s1 int, key(s1)) |
+------+------------------------------------+
|   12 | create table d.t (s1 int, key(s1)) |
+------+------------------------------------+
1 row in set (14.23 sec)

ERROR 2013 (HY000): Lost connection to MySQL server during query
[11 Apr 2007 23:37] MySQL Verification Team
Thank you for the bug report. Verified as described on FC 6.0 32-bit.

Program received signal SIGILL, Illegal instruction.
[Switching to Thread -1267369072 (LWP 8334)]
0x00641402 in __kernel_vsyscall ()
(gdb) bt full
#0  0x00641402 in __kernel_vsyscall ()
No symbol table info available.
#1  0x00bb40d1 in raise () from /lib/libpthread.so.0
No symbol table info available.
#2  0x084fe13c in Error::debugBreak () at Error.cpp:93
No locals.
#3  0x084fe19d in Error::error (string=0x88e16a8 "page %d wrong page type, expected %d got %d\n") at Error.cpp:70
<cut>
[18 Apr 2007 13:01] Hakan Küçükyılmaz
Works now:

+------+------------------------------------+
| 9998 | create table d.t (s1 int, key(s1)) |
+------+------------------------------------+
1 row in set (4 hours 9 min 53.45 sec)

+------+-----------------+
| v    | drop database d |
+------+-----------------+
| 9999 | drop database d |
+------+-----------------+
1 row in set (4 hours 9 min 54.07 sec)

+------+-------------------+
| v    | create database d |
+------+-------------------+
| 9999 | create database d |
+------+-------------------+
1 row in set (4 hours 9 min 55.16 sec)

+------+------------------------------------+
| v    | create table d.t (s1 int, key(s1)) |
+------+------------------------------------+
| 9999 | create table d.t (s1 int, key(s1)) |
+------+------------------------------------+
1 row in set (4 hours 9 min 55.16 sec)

Query OK, 0 rows affected (4 hours 9 min 55.78 sec)
[21 Apr 2007 23:25] Peter Gulutzan
I confirm that I no longer see this crash.
[26 Apr 2007 11:01] MC Brown
A note has been added to the 6.0.0 changelog.