summaryrefslogtreecommitdiff
path: root/innobase/dict
diff options
context:
space:
mode:
authorunknown <serg@sergbook.mysql.com>2004-12-31 15:26:24 +0100
committerunknown <serg@sergbook.mysql.com>2004-12-31 15:26:24 +0100
commitb99bea6704299399c84bd8374ef7f248ff9570c5 (patch)
tree928b06c231edee4cb95ace87ed30e879e3dcb0fb /innobase/dict
parentbd23099be0b22845e8c97e2fb36ee3c6eb0e2491 (diff)
parent5eaf65ab4be77911eb03cceefac9ecea48c25f71 (diff)
downloadmariadb-git-b99bea6704299399c84bd8374ef7f248ff9570c5.tar.gz
manually merged
configure.in: Auto merged client/mysqldump.c: Auto merged innobase/buf/buf0rea.c: Auto merged innobase/dict/dict0load.c: Auto merged innobase/fil/fil0fil.c: Auto merged innobase/include/fil0fil.h: Auto merged innobase/include/row0mysql.h: Auto merged innobase/include/trx0trx.h: Auto merged innobase/os/os0file.c: Auto merged innobase/row/row0ins.c: Auto merged innobase/row/row0mysql.c: Auto merged innobase/row/row0sel.c: Auto merged innobase/srv/srv0start.c: Auto merged innobase/trx/trx0trx.c: Auto merged libmysqld/lib_sql.cc: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/alter_table.result: Auto merged mysql-test/r/ctype_ucs.result: Auto merged mysql-test/r/func_str.result: Auto merged mysql-test/r/grant.result: Auto merged mysql-test/r/grant_cache.result: Auto merged mysql-test/r/merge.result: Auto merged mysql-test/r/ndb_blob.result: Auto merged mysql-test/r/ps_1general.result: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/r/timezone2.result: Auto merged mysql-test/t/ctype_ucs.test: Auto merged mysql-test/t/grant.test: Auto merged mysql-test/t/merge.test: Auto merged mysql-test/t/multi_update.test: Auto merged mysql-test/t/mysqldump.test: Auto merged mysql-test/t/subselect.test: Auto merged ndb/src/ndbapi/NdbBlob.cpp: Auto merged ndb/src/ndbapi/NdbConnection.cpp: Auto merged ndb/src/ndbapi/NdbDictionaryImpl.cpp: Auto merged ndb/src/ndbapi/NdbOperationDefine.cpp: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_myisammrg.cc: Auto merged sql/ha_myisammrg.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/log.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql-common/client.c: Auto merged sql/sql_table.cc: Auto merged sql/strfunc.cc: Auto merged sql/unireg.cc: Auto merged vio/vio.c: Auto merged vio/viosocket.c: Auto merged
Diffstat (limited to 'innobase/dict')
-rw-r--r--innobase/dict/dict0load.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c
index 12ceba38815..f835d1b949a 100644
--- a/innobase/dict/dict0load.c
+++ b/innobase/dict/dict0load.c
@@ -207,12 +207,14 @@ loop:
In a crash recovery we already have all the tablespace objects created.
This function compares the space id information in the InnoDB data dictionary
to what we already read with fil_load_single_table_tablespaces().
-In a normal startup we just scan the biggest space id, and store it to
-fil_system. */
+
+In a normal startup, we create the tablespace objects for every table in
+InnoDB's data dictionary, if the corresponding .ibd file exists.
+We also scan the biggest space id, and store it to fil_system. */
void
-dict_check_tablespaces_or_store_max_id(
-/*===================================*/
+dict_check_tablespaces_and_store_max_id(
+/*====================================*/
ibool in_crash_recovery) /* in: are we doing a crash recovery */
{
dict_table_t* sys_tables;
@@ -283,6 +285,14 @@ loop:
FALSE, TRUE, TRUE);
}
+ if (space_id != 0 && !in_crash_recovery) {
+ /* It is a normal database startup: create the space
+ object and check that the .ibd file exists. */
+
+ fil_open_single_table_tablespace(FALSE, space_id,
+ name);
+ }
+
mem_free(name);
if (space_id > max_space_id) {
@@ -797,8 +807,18 @@ dict_load_table(
/* Ok; (if we did a crash recovery then the tablespace
can already be in the memory cache) */
} else {
+ /* In >= 4.1.9, InnoDB scans the data dictionary also
+ at a normal mysqld startup. It is an error if the
+ space object does not exist in memory. */
+
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+" InnoDB: error: space object of table %s,\n"
+"InnoDB: space id %lu did not exist in memory. Retrying an open.\n",
+ name, (ulong)space);
/* Try to open the tablespace */
- if (!fil_open_single_table_tablespace(space, name)) {
+ if (!fil_open_single_table_tablespace(TRUE,
+ space, name)) {
/* We failed to find a sensible tablespace
file */