From d09c60cff9027f45ea526cf755305c3d9a9079c2 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Thu, 10 Dec 2015 15:32:07 +0400 Subject: MDEV-8571 - After mysqloptimize sometimes one of the tables is marked as crashed OPTIMIZE TABLE against MyISAM/Aria table may fail and leave stale temporary file if mysql_file_create() returns 0 file descriptor. This was due to wrong condition, which considered 0 as failure. 5.5 doesn't have fix for MDEV-5679, thus 0 file descriptor is always occupied by stdin and this bug is not reproducible. 10.1 has fix for MDEV-8475, which hides this bug. No test case since it mostly depends on how OS returns file descriptors. --- storage/myisam/mi_check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'storage/myisam') diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 178fff6a204..ec72e0b430a 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -1930,7 +1930,7 @@ int mi_sort_index(HA_CHECK *param, register MI_INFO *info, char * name) fn_format(param->temp_filename, param->temp_filename, "", INDEX_TMP_EXT, 2+4), - 0, param->tmpfile_createflag, MYF(0))) <= 0) + 0, param->tmpfile_createflag, MYF(0))) < 0) { mi_check_print_error(param,"Can't create new tempfile: '%s'", param->temp_filename); -- cgit v1.2.1