Bug #3280 optimize table damaged innodb table!
Submitted: 24 Mar 2004 4:21 Modified: 17 Sep 2004 12:29
Reporter: [ name withheld ] Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Embedded Library ( libmysqld ) Severity:S2 (Serious)
Version:4.0.16 OS:Linux (linux, 2.4)
Assigned to: CPU Architecture:Any

[24 Mar 2004 4:21] [ name withheld ]
Description:
This is a bit related to my last bugreport which said:
"When diskspace runs full the embedded mysqld crashes/hangs my application until kill -9."
As this was declared to be a feature of mysql i worked on routines to check
diskspace before i do any insertations.
(I currently work on an embedded tool and evaluate mysql for this)
The only way to free up diskspace is to delete old (backed up) rows from the tables, but this does not free up diskspace.
To free diskspace i have to additionally call an optimize table.

Optimize table damages the table when there is not enough diskspace available.
sometimes it just hangs, sometimes it quits, sometimes i get some error 28 messages (error28 = no disk space)when it creates some tempfile.
In 50% of the cases my table is damaged and needs to be repaired, i was able to reproduce this several times on 2 different systems!
(I have tried this with 5 mb free (5% of the flashdisk space)

Is there an easy way to change the path of the created tempfile so i get a fast workaround?

How to repeat:
read above
[24 Mar 2004 9:23] Heikki Tuuri
Hi!

What do you mean by 'optimize table'?

For InnoDB, OPTIMIZE TABLE is essentially a null operation and only updates the table stats in the handle.

Also, I think InnoDB does not give errors 28, but MyISAM does, if the table is corrupt. Are you sure your tables really are InnoDB type? Use

SHOW CREATE TABLE ...

to print the table type.

Regards,

Heikki
[17 Sep 2004 12:29] Heikki Tuuri
Hi!

No feedback in 6 months.

Regards,

Heikki