summaryrefslogtreecommitdiffstats
path: root/storage/innobase/fsp/fsp0file.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/fsp/fsp0file.cc')
-rw-r--r--storage/innobase/fsp/fsp0file.cc26
1 files changed, 18 insertions, 8 deletions
diff --git a/storage/innobase/fsp/fsp0file.cc b/storage/innobase/fsp/fsp0file.cc
index cafff419..1c20efcd 100644
--- a/storage/innobase/fsp/fsp0file.cc
+++ b/storage/innobase/fsp/fsp0file.cc
@@ -435,12 +435,22 @@ Datafile::validate_for_recovery()
return(err);
}
+ if (!m_space_id) {
+ m_space_id = recv_sys.dblwr.find_first_page(
+ m_filepath, m_handle);
+ if (m_space_id) {
+ m_defer= false;
+ goto free_first_page;
+ } else return err;
+ }
+
if (!m_defer) {
err = find_space_id();
if (err != DB_SUCCESS || m_space_id == 0) {
- ib::error() << "Datafile '" << m_filepath
- << "' is corrupted. Cannot determine "
- "the space ID from the first 64 pages.";
+ sql_print_error(
+ "InnoDB: Datafile '%s' is corrupted."
+ " Cannot determine the space ID from"
+ " the first 64 pages.", m_filepath);
return(err);
}
}
@@ -453,7 +463,7 @@ Datafile::validate_for_recovery()
m_space_id, m_filepath, m_handle)) {
return m_defer ? err : DB_CORRUPTION;
}
-
+free_first_page:
/* Free the previously read first page and then re-validate. */
free_first_page();
m_defer = false;
@@ -492,11 +502,11 @@ err_exit:
return DB_SUCCESS;
}
- ib::info() << error_txt << " in datafile: " << m_filepath
- << ", Space ID:" << m_space_id << ", Flags: "
- << m_flags;
+ sql_print_error("InnoDB: %s in datafile: %s, Space ID: "
+ UINT32PF ", " "Flags: " UINT32PF,
+ error_txt, m_filepath, m_space_id, m_flags);
m_is_valid = false;
- return(DB_CORRUPTION);
+ return DB_CORRUPTION;
}
/* Check if the whole page is blank. */