Jump to content

Resolved - Incorrect key file for table


ravuth

Recommended Posts

got this error log :

********

File: [gui.class.php] Line: [869] "SELECT * FROM `CubeCart_inventory` WHERE CubeCart_inventory.status = '1' ORDER BY RAND() LIMIT 1;" - Incorrect key file for table '/var/mysqltmp/#sql_4a89_5.MYI'; try to repair it

******

don't know what does it mean ?

Link to comment
Share on other sites

I will post a bug report.

If CC510 is installed fresh, the installer creates the table CubeCart_inventory with an index on `status`. Apparently, though I have not yet confirmed it, a RAND() function creates a temporary table and at least one named column (`status`, in this case) must be indexed.

On the other hand, in analyzing the upgrade scripts that would bring any CC4 version to CC510 levels, I conclude that there is no instruction to create the index on `status` (was named `disabled` in CC4). Thus the problem.

On the third hand, I'm surprised that there aren't more CC4 upgrades with this problem.

On the fourth hand, ORDER BY RAND() is a sloppy way (but, unfortunately, a very popular way) to get a random record. Once the table row count gets above 100, the time it takes to get that record expands exponentially.

@ravuth, please visit the CC5 administrative screen Maintenance, Special (or something like that) where you can type in a database statement. You won't get a response on this screen. Or, you can log into your hosting account control panel, find phpMyAdmin, and execute the following statement there.

If you upgraded, then try...

ALTER TABLE `CubeCart_inventory` ADD INDEX (`status`);

Link to comment
Share on other sites

@ Dirty Butter my store upgrade from v5.0.7 to v.5.1.0 , frankly, i don't know how does it come with that error log ?

@

bsmither , thanks your instruction, i have did as your guidance, and still get that eror, please see below

*****************

File: [gui.class.php] Line: [869] "SELECT * FROM `CubeCart_inventory` ORDER BY RAND() LIMIT 1;" - Incorrect key file for table '/var/mysqltmp/#sql_4a89_8.MYI'; try to repair it

File: [gui.class.php] Line: [869] "SELECT * FROM `CubeCart_inventory` WHERE CubeCart_inventory.status = '1' ORDER BY RAND() LIMIT 1;" - Incorrect key file for table '/var/mysqltmp/#sql_4a89_0.MYI'; try to repair it

************

Link to comment
Share on other sites

Here's why I think a repair warning is misleading:

1. The path to the MYI file includes mysqltmp, indicating to me that this is a temporary table created because RAND() is involved.

2. The .MYI filename, along with .MYD and .FRM, constitute a set of files positively named for the actual table.

#sql_4a89_0 is undoubtedly a valid name for a table, but it is not a table created by the CubeCart installer. I very much doubt that phpMyAdmin looking at the database holding all of CubeCart's tables will see a table named #sql_4a89_0.

@ravuth, please use phpMyAdmin to look at the table CubeCart_inventory and determine if an index has in fact been added to that table for the status column. Then, if phpMyAdmin reports that the inventory table needs repairing, repair that table. It could be that a temporary table will be as broke if derived from an existing table that is broken. (Although I would think that the MySQL engine would see that broken table and issue a warning against that and not allow a temp table to be derived from it.)

Please also start a conversation with your hosting provider. They may be able to offer some suggestions.

Specifically, ask if there is enough space in the temp folder. The amount of free space should be two-three times the size of the size of the database. (http://www.mysqlperf...for-table-mysql)

Link to comment
Share on other sites

@bsmither , Thanks you .

that error was happened again yesterday. Then i do as your advice by ask to my host provider . and got the following reply .

This was due to the temporary table not getting created correctly in the /tmp partition. /tmp got full and caused the problem. Please try it once more? We have free'd up plenty of space in the partition. It is currently at 4% usage.

so, if that happen again, i will email to my host provider to fix that.

that sould be solved

Thanks All

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...