Mysql "Incorrectkeyfilefortable"/tmp/# SQL _1194_12.MYI ';

Source: Internet
Author: User
This function calls the mysql_file_pwrite function. It is clear here that the actual operation is to write files. It is determined that the file fails to be written. The reason why the file is written is tmp

This function calls the mysql_file_pwrite function. It is clear here that the actual operation is to write files. It is determined that the file fails to be written. The reason why the file is written is/tmp

The following error occurs in the online database:
Incorrect key file for table '/tmp/# SQL _1194_1.myi'; try to repair it
Got an error from unknown thread, XXXX/storage/myisam/mi_write.c: 223

By viewing the source code, the mi_write function reports an error in row 223.
Mi_write.c: 44
/* Write new record to database */
Int mi_write (MI_INFO * info, uchar * record)

Here is a piece of err processing logic. The function to jump to err is the write_record function of row 142 in mi_write.c. The implementation of this function is the _ mi_write_static_record function.
Mi_statrec.c: 21
Int _ mi_write_static_record (MI_INFO * info, const uchar * record)

The logic of the specific operation is not displayed yet. Continue to debug the Code. This function calls the mi_nommap_pwrite function.
Mi_dynrec.c: 255
/* Wrapper for mysql_file_pwrite in case if mmap isn't used */
Size_t mi_nommap_pwrite (MI_INFO * info, const uchar * Buffer,
Size_t Count, my_off_t offset, myf MyFlags)

This function calls the mysql_file_pwrite function. It is clear here that the actual operation is to write files. It is determined that the file fails to be written. The reason why the file is written is/tmp. It is found that the table has a complex SQL query and uses a temporary table. In addition, the temporary table size even reaches 1 GB, resulting in insufficient space in/tmp, leading to errors.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.