mysql的“Incorrect key file for table '/tmp/#sql_1194_12.MYI';
而这个函数调用mysql_file_pwrite函数。这里就比较清楚了,实际操作就是写文件了。确定的是写文件失败了。而之所以写文件的位置是/tmp,通过
线上数据库出现以下错误:
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
通过查看源码,在mi_write函数的223行报错。
mi_write.c:44
/* Write new record to database */
int mi_write (MI_INFO * info, uchar *record)
而这里是一段err处理逻辑,跳转到err的函数是mi_write.c:142行的write_record函数。而该函数的实现是_mi_write_static_record 函数。
mi_statrec.c:21
int _mi_write_static_record (MI_INFO * info, const uchar * record)
到这里实际还没有结束,还没有完全显示出具体操作的逻辑。继续调试代码,该函数调用了mi_nommap_pwrite函数。
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)
而这个函数调用mysql_file_pwrite函数。这里就比较清楚了,实际操作就是写文件了。确定的是写文件失败了。而之所以写文件的位置是/tmp,通过查看发现,该表有复杂的sql查询,用到了临时表。并且临时表的大小甚至达到了1G,导致了/tmp下的空间不足,,从而导致错误。
推荐阅读
-
mysql出现“Incorrect key file for table”处理方法_MySQL
-
[error] [mysql]:"1034 Incorrect key file for table 'table_name'; try to repair it"
-
ERROR 126 (HY000): Incorrect key file for table '/tmp/#sql__MySQL
-
mysql中Incorrect key file for table: Try to repair it
-
mysql中Incorrect key file for table: Try to repair it
-
mysql出现“Incorrect key file for table”处理方法
-
mysql的“Incorrect key file for table '/tmp/#sql_1194_12.MYI';
-
mysql出现“Incorrect key file for table”处理方法_MySQL
-
mysql出现“Incorrect key file for table”处理方法