[thelist] broken mysql table

Chris Anderson Chris at activeide.com
Wed Nov 21 14:13:06 CST 2007


> While that solves the immediate crisis, it also raises lots of
> questions. How can a database table spontaneously break? Is there
> anything I can do to prevent it from happening again (I have the same
> basic shopping cart running on several sites)? Does it have anything
> to do with the structure of the table or the data put in it?
> 
> Here's the structure of the table in question (as exported from
> phpmyadmin):
> CREATE TABLE cart (
>    cartId int(11) NOT NULL auto_increment,
>    cookieId varchar(50) NOT NULL default '',
>    itemId varchar(30) NOT NULL default '0',
>    qty int(3) NOT NULL default '1',
>    PRIMARY KEY  (cartId)
> ) TYPE=MyISAM;

How long has the site been running?
Do you delete the cart after the sale?
If so, might the auto increment have "run out" (i.e. might the last cart
have had a cartId of 2,147,483,647?)

If that sounds unfeasible take a look at the auto_increment_offset
server variable - if it's not 1 the cartId may have been growing faster
than you anticipated.

What information was on the page that pointed you to the repair function
(i.e. what did it say it was actually repairing, or did it just say it
made the error "go away") ?

Chris



More information about the thelist mailing list