Commit c0e41e12 authored by osku's avatar osku

Port r170 from branches/5.0:

Fix bug #16827, better error message if ibdata files omitted from my.cnf.
parent 549dfbc6
...@@ -3820,6 +3820,31 @@ fil_node_complete_io( ...@@ -3820,6 +3820,31 @@ fil_node_complete_io(
} }
} }
/************************************************************************
Report information about an invalid page access. */
static
void
fil_report_invalid_page_access(
/*===========================*/
ulint block_offset, /* in: block offset */
ulint space_id, /* in: space id */
const char* space_name, /* in: space name */
ulint byte_offset, /* in: byte offset */
ulint len, /* in: I/O length */
ulint type) /* in: I/O type */
{
fprintf(stderr,
"InnoDB: Error: trying to access page number %lu in space %lu,\n"
"InnoDB: space name %s,\n"
"InnoDB: which is outside the tablespace bounds.\n"
"InnoDB: Byte offset %lu, len %lu, i/o type %lu.\n"
"InnoDB: If you get this error at mysqld startup, please check that\n"
"InnoDB: your my.cnf matches the ibdata files that you have in the\n"
"InnoDB: MySQL server.\n",
(ulong) block_offset, (ulong) space_id, space_name,
(ulong) byte_offset, (ulong) len, (ulong) type);
}
/************************************************************************ /************************************************************************
Reads or writes data. This operation is asynchronous (aio). */ Reads or writes data. This operation is asynchronous (aio). */
...@@ -3926,14 +3951,8 @@ fil_io( ...@@ -3926,14 +3951,8 @@ fil_io(
for (;;) { for (;;) {
if (node == NULL) { if (node == NULL) {
fprintf(stderr, fil_report_invalid_page_access(block_offset, space_id,
"InnoDB: Error: trying to access page number %lu in space %lu,\n" space->name, byte_offset, len, type);
"InnoDB: space name %s,\n"
"InnoDB: which is outside the tablespace bounds.\n"
"InnoDB: Byte offset %lu, len %lu, i/o type %lu\n",
(ulong) block_offset, (ulong) space_id,
space->name, (ulong) byte_offset, (ulong) len,
(ulong) type);
ut_error; ut_error;
} }
...@@ -3962,15 +3981,10 @@ fil_io( ...@@ -3962,15 +3981,10 @@ fil_io(
if (space->purpose == FIL_TABLESPACE && space->id != 0 if (space->purpose == FIL_TABLESPACE && space->id != 0
&& node->size <= block_offset) { && node->size <= block_offset) {
fprintf(stderr, fil_report_invalid_page_access(block_offset, space_id,
"InnoDB: Error: trying to access page number %lu in space %lu,\n" space->name, byte_offset, len, type);
"InnoDB: space name %s,\n"
"InnoDB: which is outside the tablespace bounds.\n" ut_error;
"InnoDB: Byte offset %lu, len %lu, i/o type %lu\n",
(ulong) block_offset, (ulong) space_id,
space->name, (ulong) byte_offset, (ulong) len,
(ulong) type);
ut_a(0);
} }
/* Now we have made the changes in the data structures of system */ /* Now we have made the changes in the data structures of system */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment