Loading innobase/fil/fil0fil.c +14 −0 Original line number Diff line number Diff line Loading @@ -1868,6 +1868,10 @@ fil_delete_tablespace( if (success) { success = os_file_delete(path); if (!success) { success = os_file_delete_if_exists(path); } } if (success) { Loading Loading @@ -2366,6 +2370,16 @@ fil_reset_too_high_lsns( file = os_file_create_simple_no_error_handling(filepath, OS_FILE_OPEN, OS_FILE_READ_WRITE, &success); if (!success) { /* The following call prints an error message */ os_file_get_last_error(TRUE); ut_print_timestamp(stderr); fputs( " InnoDB: Error: trying to open a table, but could not\n" "InnoDB: open the tablespace file ", stderr); ut_print_filename(stderr, filepath); fputs("!\n", stderr); mem_free(filepath); return(FALSE); Loading innobase/os/os0file.c +11 −14 Original line number Diff line number Diff line Loading @@ -410,14 +410,11 @@ os_file_handle_error_no_exit( /*=========================*/ /* out: TRUE if we should retry the operation */ os_file_t file, /* in: file pointer */ const char* name, /* in: name of a file or NULL */ const char* operation)/* in: operation */ { ulint err; UT_NOT_USED(file); err = os_file_get_last_error(FALSE); if (err == OS_FILE_DISK_FULL) { Loading Loading @@ -624,7 +621,7 @@ os_file_closedir( ret = FindClose(dir); if (!ret) { os_file_handle_error_no_exit(NULL, NULL, "closedir"); os_file_handle_error_no_exit(NULL, "closedir"); return(-1); } Loading @@ -636,7 +633,7 @@ os_file_closedir( ret = closedir(dir); if (ret) { os_file_handle_error_no_exit(0, NULL, "closedir"); os_file_handle_error_no_exit(NULL, "closedir"); } return(ret); Loading Loading @@ -705,7 +702,7 @@ dbname.sym can redirect a database directory: return(1); } else { os_file_handle_error_no_exit(NULL, dirname, os_file_handle_error_no_exit(dirname, "readdir_next_file"); return(-1); } Loading Loading @@ -737,7 +734,7 @@ dbname.sym can redirect a database directory: ret = stat(full_path, &statinfo); if (ret) { os_file_handle_error_no_exit(0, full_path, "stat"); os_file_handle_error_no_exit(full_path, "stat"); ut_free(full_path); Loading Loading @@ -1326,7 +1323,7 @@ os_file_delete_if_exists( ret = unlink((const char*)name); if (ret != 0 && errno != ENOENT) { os_file_handle_error(name, "delete"); os_file_handle_error_no_exit(name, "delete"); return(FALSE); } Loading Loading @@ -1388,7 +1385,7 @@ os_file_delete( ret = unlink((const char*)name); if (ret != 0) { os_file_handle_error(name, "delete"); os_file_handle_error_no_exit(name, "delete"); return(FALSE); } Loading Loading @@ -2117,7 +2114,7 @@ os_file_read_no_error_handling( #ifdef __WIN__ error_handling: #endif retry = os_file_handle_error_no_exit(file, NULL, "read"); retry = os_file_handle_error_no_exit(NULL, "read"); if (retry) { goto try_again; Loading Loading @@ -2310,7 +2307,7 @@ os_file_status( } else if (ret) { /* file exists, but stat call failed */ os_file_handle_error_no_exit(0, path, "stat"); os_file_handle_error_no_exit(path, "stat"); return(FALSE); } Loading Loading @@ -2338,7 +2335,7 @@ os_file_status( } else if (ret) { /* file exists, but stat call failed */ os_file_handle_error_no_exit(0, path, "stat"); os_file_handle_error_no_exit(path, "stat"); return(FALSE); } Loading Loading @@ -2381,7 +2378,7 @@ os_file_get_status( } else if (ret) { /* file exists, but stat call failed */ os_file_handle_error_no_exit(0, path, "stat"); os_file_handle_error_no_exit(path, "stat"); return(FALSE); } Loading Loading @@ -2412,7 +2409,7 @@ os_file_get_status( } else if (ret) { /* file exists, but stat call failed */ os_file_handle_error_no_exit(0, path, "stat"); os_file_handle_error_no_exit(path, "stat"); return(FALSE); } Loading innobase/row/row0mysql.c +25 −0 Original line number Diff line number Diff line Loading @@ -2153,6 +2153,12 @@ row_import_tablespace_for_mysql( success = fil_reset_too_high_lsns(name, current_lsn); if (!success) { ut_print_timestamp(stderr); fputs(" InnoDB: Error: cannot reset lsn's in table ", stderr); ut_print_name(stderr, trx, name); fputs("\n" "InnoDB: in ALTER TABLE ... IMPORT TABLESPACE\n", stderr); err = DB_ERROR; row_mysql_lock_data_dictionary(trx); Loading @@ -2168,6 +2174,14 @@ row_import_tablespace_for_mysql( table = dict_table_get_low(name); if (!table) { ut_print_timestamp(stderr); fputs(" InnoDB: table ", stderr); ut_print_name(stderr, trx, name); fputs("\n" "InnoDB: does not exist in the InnoDB data dictionary\n" "InnoDB: in ALTER TABLE ... IMPORT TABLESPACE\n", stderr); err = DB_TABLE_NOT_FOUND; goto funct_exit; Loading Loading @@ -2209,6 +2223,17 @@ row_import_tablespace_for_mysql( table->ibd_file_missing = FALSE; table->tablespace_discarded = FALSE; } else { if (table->ibd_file_missing) { ut_print_timestamp(stderr); fputs( " InnoDB: cannot find of open in the database directory the .ibd file of\n" "InnoDB: table ", stderr); ut_print_name(stderr, trx, name); fputs("\n" "InnoDB: in ALTER TABLE ... IMPORT TABLESPACE\n", stderr); } err = DB_ERROR; } Loading Loading
innobase/fil/fil0fil.c +14 −0 Original line number Diff line number Diff line Loading @@ -1868,6 +1868,10 @@ fil_delete_tablespace( if (success) { success = os_file_delete(path); if (!success) { success = os_file_delete_if_exists(path); } } if (success) { Loading Loading @@ -2366,6 +2370,16 @@ fil_reset_too_high_lsns( file = os_file_create_simple_no_error_handling(filepath, OS_FILE_OPEN, OS_FILE_READ_WRITE, &success); if (!success) { /* The following call prints an error message */ os_file_get_last_error(TRUE); ut_print_timestamp(stderr); fputs( " InnoDB: Error: trying to open a table, but could not\n" "InnoDB: open the tablespace file ", stderr); ut_print_filename(stderr, filepath); fputs("!\n", stderr); mem_free(filepath); return(FALSE); Loading
innobase/os/os0file.c +11 −14 Original line number Diff line number Diff line Loading @@ -410,14 +410,11 @@ os_file_handle_error_no_exit( /*=========================*/ /* out: TRUE if we should retry the operation */ os_file_t file, /* in: file pointer */ const char* name, /* in: name of a file or NULL */ const char* operation)/* in: operation */ { ulint err; UT_NOT_USED(file); err = os_file_get_last_error(FALSE); if (err == OS_FILE_DISK_FULL) { Loading Loading @@ -624,7 +621,7 @@ os_file_closedir( ret = FindClose(dir); if (!ret) { os_file_handle_error_no_exit(NULL, NULL, "closedir"); os_file_handle_error_no_exit(NULL, "closedir"); return(-1); } Loading @@ -636,7 +633,7 @@ os_file_closedir( ret = closedir(dir); if (ret) { os_file_handle_error_no_exit(0, NULL, "closedir"); os_file_handle_error_no_exit(NULL, "closedir"); } return(ret); Loading Loading @@ -705,7 +702,7 @@ dbname.sym can redirect a database directory: return(1); } else { os_file_handle_error_no_exit(NULL, dirname, os_file_handle_error_no_exit(dirname, "readdir_next_file"); return(-1); } Loading Loading @@ -737,7 +734,7 @@ dbname.sym can redirect a database directory: ret = stat(full_path, &statinfo); if (ret) { os_file_handle_error_no_exit(0, full_path, "stat"); os_file_handle_error_no_exit(full_path, "stat"); ut_free(full_path); Loading Loading @@ -1326,7 +1323,7 @@ os_file_delete_if_exists( ret = unlink((const char*)name); if (ret != 0 && errno != ENOENT) { os_file_handle_error(name, "delete"); os_file_handle_error_no_exit(name, "delete"); return(FALSE); } Loading Loading @@ -1388,7 +1385,7 @@ os_file_delete( ret = unlink((const char*)name); if (ret != 0) { os_file_handle_error(name, "delete"); os_file_handle_error_no_exit(name, "delete"); return(FALSE); } Loading Loading @@ -2117,7 +2114,7 @@ os_file_read_no_error_handling( #ifdef __WIN__ error_handling: #endif retry = os_file_handle_error_no_exit(file, NULL, "read"); retry = os_file_handle_error_no_exit(NULL, "read"); if (retry) { goto try_again; Loading Loading @@ -2310,7 +2307,7 @@ os_file_status( } else if (ret) { /* file exists, but stat call failed */ os_file_handle_error_no_exit(0, path, "stat"); os_file_handle_error_no_exit(path, "stat"); return(FALSE); } Loading Loading @@ -2338,7 +2335,7 @@ os_file_status( } else if (ret) { /* file exists, but stat call failed */ os_file_handle_error_no_exit(0, path, "stat"); os_file_handle_error_no_exit(path, "stat"); return(FALSE); } Loading Loading @@ -2381,7 +2378,7 @@ os_file_get_status( } else if (ret) { /* file exists, but stat call failed */ os_file_handle_error_no_exit(0, path, "stat"); os_file_handle_error_no_exit(path, "stat"); return(FALSE); } Loading Loading @@ -2412,7 +2409,7 @@ os_file_get_status( } else if (ret) { /* file exists, but stat call failed */ os_file_handle_error_no_exit(0, path, "stat"); os_file_handle_error_no_exit(path, "stat"); return(FALSE); } Loading
innobase/row/row0mysql.c +25 −0 Original line number Diff line number Diff line Loading @@ -2153,6 +2153,12 @@ row_import_tablespace_for_mysql( success = fil_reset_too_high_lsns(name, current_lsn); if (!success) { ut_print_timestamp(stderr); fputs(" InnoDB: Error: cannot reset lsn's in table ", stderr); ut_print_name(stderr, trx, name); fputs("\n" "InnoDB: in ALTER TABLE ... IMPORT TABLESPACE\n", stderr); err = DB_ERROR; row_mysql_lock_data_dictionary(trx); Loading @@ -2168,6 +2174,14 @@ row_import_tablespace_for_mysql( table = dict_table_get_low(name); if (!table) { ut_print_timestamp(stderr); fputs(" InnoDB: table ", stderr); ut_print_name(stderr, trx, name); fputs("\n" "InnoDB: does not exist in the InnoDB data dictionary\n" "InnoDB: in ALTER TABLE ... IMPORT TABLESPACE\n", stderr); err = DB_TABLE_NOT_FOUND; goto funct_exit; Loading Loading @@ -2209,6 +2223,17 @@ row_import_tablespace_for_mysql( table->ibd_file_missing = FALSE; table->tablespace_discarded = FALSE; } else { if (table->ibd_file_missing) { ut_print_timestamp(stderr); fputs( " InnoDB: cannot find of open in the database directory the .ibd file of\n" "InnoDB: table ", stderr); ut_print_name(stderr, trx, name); fputs("\n" "InnoDB: in ALTER TABLE ... IMPORT TABLESPACE\n", stderr); } err = DB_ERROR; } Loading