Bug #6013 Temporary heap table residue
Submitted: 11 Oct 2004 9:16 Modified: 16 Aug 2005 18:40
Reporter: Lars Rönnbäck Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.0.20 OS:Linux (Linux)
Assigned to: Ingo Strüwing CPU Architecture:Any

[11 Oct 2004 9:16] Lars Rönnbäck
Description:
Temporary heap tables does not deallocate properly when a query involving the table crashes (i e due to lack of memory). Using the same session, the table cannot be dropped and a new table cannot be created with the same name. Even after the session is dropped the memory remains allocated and the only way to free it up is to restart mysql.

How to repeat:
The repeatability seems somewhat arbitrary, but the following two methods do reproduce the bug if you persist:

Method 1
---------
* Create a large temporary heap table
* Make sure you run out of memory when indexing that table
* Drop the session

Method 2
---------
* Create a temporary heap table
* Run a select involving the table and crash (kill?) the query while it is running
* Try to create a new table with the same name or drop the old one

Suggested fix:
Make sure all temporary tables are deallocated when sessions are dropped?
[4 Jan 2005 18:53] MySQL Verification Team
I was only able for to repeat with method 2 (killing the mysql session)
but I am not sure if that can be considered a bug (let Serg to comment).

I tested with 4.0.23 version.
[4 Jan 2005 23:03] Sergei Golubchik
I agree, it's a bug.
[16 Aug 2005 18:40] MySQL Verification Team
I wasn't able to repeat anymore this issue.