summaryrefslogtreecommitdiff
path: root/storage/innobase/srv
diff options
context:
space:
mode:
authorMikael Ronstrom <mikael@dator8>2011-01-12 14:43:03 +0100
committerMikael Ronstrom <mikael@dator8>2011-01-12 14:43:03 +0100
commit21850d2903cccfd49cac18e70201ca8cf7eceebf (patch)
tree2572fe5a1f81ea6ca0b1fa3d47f468b568ff5503 /storage/innobase/srv
parentcb59b06c40f0416465309604cdb1ca64e8988326 (diff)
parent003e87fef022c3d83430ca47bc5f8ea78c3353af (diff)
downloadmariadb-git-21850d2903cccfd49cac18e70201ca8cf7eceebf.tar.gz
merge
Diffstat (limited to 'storage/innobase/srv')
-rw-r--r--storage/innobase/srv/srv0srv.c44
-rw-r--r--storage/innobase/srv/srv0start.c393
2 files changed, 303 insertions, 134 deletions
diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
index 14fe7e57859..e19e75f27a5 100644
--- a/storage/innobase/srv/srv0srv.c
+++ b/storage/innobase/srv/srv0srv.c
@@ -87,9 +87,11 @@ Created 10/8/1995 Heikki Tuuri
#include "mysql/plugin.h"
#include "mysql/service_thd_wait.h"
-/* This is set to TRUE if the MySQL user has set it in MySQL; currently
-affects only FOREIGN KEY definition parsing */
-UNIV_INTERN ibool srv_lower_case_table_names = FALSE;
+/* This is set to the MySQL server value for this variable. It is only
+needed for FOREIGN KEY definition parsing since FOREIGN KEY names are not
+stored in the server metadata. The server stores and enforces it for
+regular database and table names.*/
+UNIV_INTERN uint srv_lower_case_table_names = 0;
/* The following counter is incremented whenever there is some user activity
in the server */
@@ -831,6 +833,7 @@ srv_table_reserve_slot(
ut_a(type > 0);
ut_a(type <= SRV_MASTER);
+ ut_ad(mutex_own(&kernel_mutex));
i = 0;
slot = srv_table_get_nth_slot(i);
@@ -980,6 +983,37 @@ srv_get_thread_type(void)
}
/*********************************************************************//**
+Check whether thread type has reserved a slot. Return the first slot that
+is found. This works because we currently have only 1 thread of each type.
+@return slot number or ULINT_UNDEFINED if not found*/
+UNIV_INTERN
+ulint
+srv_thread_has_reserved_slot(
+/*=========================*/
+ enum srv_thread_type type) /*!< in: thread type to check */
+{
+ ulint i;
+ ulint slot_no = ULINT_UNDEFINED;
+
+ mutex_enter(&kernel_mutex);
+
+ for (i = 0; i < OS_THREAD_MAX_N; i++) {
+ srv_slot_t* slot;
+
+ slot = srv_table_get_nth_slot(i);
+
+ if (slot->in_use && slot->type == type) {
+ slot_no = i;
+ break;
+ }
+ }
+
+ mutex_exit(&kernel_mutex);
+
+ return(slot_no);
+}
+
+/*********************************************************************//**
Initializes the server. */
UNIV_INTERN
void
@@ -2627,10 +2661,10 @@ srv_master_thread(
srv_main_thread_process_no = os_proc_get_number();
srv_main_thread_id = os_thread_pf(os_thread_get_curr_id());
- srv_table_reserve_slot(SRV_MASTER);
-
mutex_enter(&kernel_mutex);
+ srv_table_reserve_slot(SRV_MASTER);
+
srv_n_threads_active[SRV_MASTER]++;
mutex_exit(&kernel_mutex);
diff --git a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c
index d7ea3d5d3da..acb448a1a67 100644
--- a/storage/innobase/srv/srv0start.c
+++ b/storage/innobase/srv/srv0start.c
@@ -1026,26 +1026,35 @@ innobase_start_or_create_for_mysql(void)
on Mac OS X 10.3 or later. */
struct utsname utsname;
if (uname(&utsname)) {
- fputs("InnoDB: cannot determine Mac OS X version!\n", stderr);
+ ut_print_timestamp(stderr);
+ fputs(" InnoDB: cannot determine Mac OS X version!\n", stderr);
} else {
srv_have_fullfsync = strcmp(utsname.release, "7.") >= 0;
}
if (!srv_have_fullfsync) {
- fputs("InnoDB: On Mac OS X, fsync() may be"
- " broken on internal drives,\n"
- "InnoDB: making transactions unsafe!\n", stderr);
+ ut_print_timestamp(stderr);
+ fputs(" InnoDB: On Mac OS X, fsync() may be "
+ "broken on internal drives,\n", stderr);
+ ut_print_timestamp(stderr);
+ fputs(" InnoDB: making transactions unsafe!\n", stderr);
}
# endif /* F_FULLFSYNC */
#endif /* HAVE_DARWIN_THREADS */
if (sizeof(ulint) != sizeof(void*)) {
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Error: size of InnoDB's ulint is %lu,"
- " but size of void* is %lu.\n"
- "InnoDB: The sizes should be the same"
- " so that on a 64-bit platform you can\n"
- "InnoDB: allocate more than 4 GB of memory.",
- (ulong)sizeof(ulint), (ulong)sizeof(void*));
+ " InnoDB: Error: size of InnoDB's ulint is %lu, "
+ "but size of void*\n", (ulong) sizeof(ulint));
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: is %lu. The sizes should be the same "
+ "so that on a 64-bit\n",
+ (ulong) sizeof(void*));
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: platforms you can allocate more than 4 GB "
+ "of memory.\n");
}
/* System tables are created in tablespace 0. Thus, we must
@@ -1054,53 +1063,68 @@ innobase_start_or_create_for_mysql(void)
innodb_file_per_table) until this function has returned. */
srv_file_per_table = FALSE;
#ifdef UNIV_DEBUG
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n");
+ " InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n");
#endif
#ifdef UNIV_IBUF_DEBUG
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: !!!!!!!! UNIV_IBUF_DEBUG switched on !!!!!!!!!\n"
+ " InnoDB: !!!!!!!! UNIV_IBUF_DEBUG switched on !!!!!!!!!\n");
# ifdef UNIV_IBUF_COUNT_DEBUG
- "InnoDB: !!!!!!!! UNIV_IBUF_COUNT_DEBUG switched on !!!!!!!!!\n"
- "InnoDB: Crash recovery will fail with UNIV_IBUF_COUNT_DEBUG\n"
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: !!!!!!!! UNIV_IBUF_COUNT_DEBUG switched on "
+ "!!!!!!!!!\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Crash recovery will fail with UNIV_IBUF_COUNT_DEBUG\n");
# endif
- );
#endif
#ifdef UNIV_SYNC_DEBUG
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!\n");
+ " InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!\n");
#endif
#ifdef UNIV_SEARCH_DEBUG
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: !!!!!!!! UNIV_SEARCH_DEBUG switched on !!!!!!!!!\n");
+ " InnoDB: !!!!!!!! UNIV_SEARCH_DEBUG switched on !!!!!!!!!\n");
#endif
#ifdef UNIV_LOG_LSN_DEBUG
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: !!!!!!!! UNIV_LOG_LSN_DEBUG switched on !!!!!!!!!\n");
+ " InnoDB: !!!!!!!! UNIV_LOG_LSN_DEBUG switched on !!!!!!!!!\n");
#endif /* UNIV_LOG_LSN_DEBUG */
#ifdef UNIV_MEM_DEBUG
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: !!!!!!!! UNIV_MEM_DEBUG switched on !!!!!!!!!\n");
+ " InnoDB: !!!!!!!! UNIV_MEM_DEBUG switched on !!!!!!!!!\n");
#endif
if (UNIV_LIKELY(srv_use_sys_malloc)) {
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: The InnoDB memory heap is disabled\n");
+ " InnoDB: The InnoDB memory heap is disabled\n");
}
- fputs("InnoDB: " IB_ATOMICS_STARTUP_MSG
- "\nInnoDB: Compressed tables use zlib " ZLIB_VERSION
+ ut_print_timestamp(stderr);
+ fputs(" InnoDB: " IB_ATOMICS_STARTUP_MSG "\n", stderr);
+
+ ut_print_timestamp(stderr);
+ fputs(" InnoDB: Compressed tables use zlib " ZLIB_VERSION
#ifdef UNIV_ZIP_DEBUG
" with validation"
#endif /* UNIV_ZIP_DEBUG */
+ "\n" , stderr);
#ifdef UNIV_ZIP_COPY
- " and extra copying"
+ ut_print_timestamp(stderr);
+ fputs(" InnoDB: and extra copying\n", stderr);
#endif /* UNIV_ZIP_COPY */
- "\n" , stderr);
/* Since InnoDB does not currently clean up all its internal data
structures in MySQL Embedded Server Library server_end(), we
@@ -1108,13 +1132,17 @@ innobase_start_or_create_for_mysql(void)
second time during the process lifetime. */
if (srv_start_has_been_called) {
- fprintf(stderr,
- "InnoDB: Error: startup called second time"
- " during the process lifetime.\n"
- "InnoDB: In the MySQL Embedded Server Library"
- " you cannot call server_init()\n"
- "InnoDB: more than once during"
- " the process lifetime.\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: Error: startup called second time "
+ "during the process\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: lifetime. In the MySQL Embedded "
+ "Server Library you\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: cannot call server_init() more "
+ "than once during the\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: process lifetime.\n");
}
srv_start_has_been_called = TRUE;
@@ -1158,7 +1186,7 @@ innobase_start_or_create_for_mysql(void)
if (srv_use_native_aio) {
ut_print_timestamp(stderr);
fprintf(stderr,
- " InnoDB: Using Linux native AIO\n");
+ " InnoDB: Using Linux native AIO\n");
}
#else
/* Currently native AIO is supported only on windows and linux
@@ -1203,8 +1231,9 @@ innobase_start_or_create_for_mysql(void)
srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
#endif
} else {
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Unrecognized value %s for"
+ " InnoDB: Unrecognized value %s for"
" innodb_flush_method\n",
srv_file_flush_method_str);
return(DB_ERROR);
@@ -1285,7 +1314,8 @@ innobase_start_or_create_for_mysql(void)
we'll emit a message telling the user that this parameter
is now deprecated. */
if (srv_n_file_io_threads != 4) {
- fprintf(stderr, "InnoDB: Warning:"
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: Warning:"
" innodb_file_io_threads is deprecated."
" Please use innodb_read_io_threads and"
" innodb_write_io_threads instead\n");
@@ -1316,7 +1346,7 @@ innobase_start_or_create_for_mysql(void)
/* Print time to initialize the buffer pool */
ut_print_timestamp(stderr);
fprintf(stderr,
- " InnoDB: Initializing buffer pool, size =");
+ " InnoDB: Initializing buffer pool, size =");
if (srv_buf_pool_size >= 1024 * 1024 * 1024) {
fprintf(stderr,
@@ -1332,11 +1362,12 @@ innobase_start_or_create_for_mysql(void)
ut_print_timestamp(stderr);
fprintf(stderr,
- " InnoDB: Completed initialization of buffer pool\n");
+ " InnoDB: Completed initialization of buffer pool\n");
if (err != DB_SUCCESS) {
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Fatal error: cannot allocate the memory"
+ " InnoDB: Fatal error: cannot allocate memory"
" for the buffer pool\n");
return(DB_ERROR);
@@ -1348,7 +1379,8 @@ innobase_start_or_create_for_mysql(void)
if (srv_buf_pool_size <= 5 * 1024 * 1024) {
- fprintf(stderr, "InnoDB: Warning: Small buffer pool size "
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: Warning: Small buffer pool size "
"(%luM), the flst_validate() debug function "
"can cause a deadlock if the buffer pool fills up.\n",
srv_buf_pool_size / 1024 / 1024);
@@ -1370,18 +1402,19 @@ innobase_start_or_create_for_mysql(void)
#ifdef UNIV_LOG_ARCHIVE
if (0 != ut_strcmp(srv_log_group_home_dirs[0], srv_arch_dir)) {
- fprintf(stderr,
- "InnoDB: Error: you must set the log group"
- " home dir in my.cnf the\n"
- "InnoDB: same as log arch dir.\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: Error: you must set the log group home dir in my.cnf\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: the same as log arch dir.\n");
return(DB_ERROR);
}
#endif /* UNIV_LOG_ARCHIVE */
if (srv_n_log_files * srv_log_file_size >= 262144) {
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Error: combined size of log files"
+ " InnoDB: Error: combined size of log files"
" must be < 4 GB\n");
return(DB_ERROR);
@@ -1392,10 +1425,13 @@ innobase_start_or_create_for_mysql(void)
for (i = 0; i < srv_n_data_files; i++) {
#ifndef __WIN__
if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= 262144) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Error: file size must be < 4 GB"
+ " with this MySQL binary\n");
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Error: file size must be < 4 GB"
- " with this MySQL binary\n"
- "InnoDB: and operating system combination,"
+ " InnoDB: and operating system combination,"
" in some OS's < 2 GB\n");
return(DB_ERROR);
@@ -1405,8 +1441,9 @@ innobase_start_or_create_for_mysql(void)
}
if (sum_of_new_sizes < 10485760 / UNIV_PAGE_SIZE) {
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Error: tablespace size must be"
+ " InnoDB: Error: tablespace size must be"
" at least 10 MB\n");
return(DB_ERROR);
@@ -1419,19 +1456,32 @@ innobase_start_or_create_for_mysql(void)
&min_flushed_lsn, &max_flushed_lsn,
&sum_of_new_sizes);
if (err != DB_SUCCESS) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Could not open or create data files.\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: If you tried to add new data files,"
+ " and it failed here,\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: you should now edit innodb_data_file_path"
+ " in my.cnf back\n");
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Could not open or create data files.\n"
- "InnoDB: If you tried to add new data files,"
- " and it failed here,\n"
- "InnoDB: you should now edit innodb_data_file_path"
- " in my.cnf back\n"
- "InnoDB: to what it was, and remove the"
- " new ibdata files InnoDB created\n"
- "InnoDB: in this failed attempt. InnoDB only wrote"
- " those files full of\n"
- "InnoDB: zeros, but did not yet use them in any way."
- " But be careful: do not\n"
- "InnoDB: remove old data files"
+ " InnoDB: to what it was, and remove the"
+ " new ibdata files InnoDB created\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: in this failed attempt. InnoDB only wrote"
+ " those files full of\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: zeros, but did not yet use them in any way."
+ " But be careful: do not\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: remove old data files"
" which contain your precious data!\n");
return((int) err);
@@ -1457,18 +1507,29 @@ innobase_start_or_create_for_mysql(void)
}
if ((log_opened && create_new_db)
|| (log_opened && log_created)) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Error: all log files must be"
+ " created at the same time.\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: All log files must be"
+ " created also in database creation.\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: If you want bigger or smaller"
+ " log files, shut down the\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: database and make sure there"
+ " were no errors in shutdown.\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Then delete the existing log files."
+ " Edit the .cnf file\n");
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Error: all log files must be"
- " created at the same time.\n"
- "InnoDB: All log files must be"
- " created also in database creation.\n"
- "InnoDB: If you want bigger or smaller"
- " log files, shut down the\n"
- "InnoDB: database and make sure there"
- " were no errors in shutdown.\n"
- "InnoDB: Then delete the existing log files."
- " Edit the .cnf file\n"
- "InnoDB: and start the database again.\n");
+ " InnoDB: and start the database again.\n");
return(DB_ERROR);
}
@@ -1489,27 +1550,41 @@ innobase_start_or_create_for_mysql(void)
|| max_arch_log_no != min_arch_log_no
#endif /* UNIV_LOG_ARCHIVE */
) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Cannot initialize created"
+ " log files because\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: data files were not in sync"
+ " with each other\n");
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Cannot initialize created"
- " log files because\n"
- "InnoDB: data files were not in sync"
- " with each other\n"
- "InnoDB: or the data files are corrupt.\n");
+ " InnoDB: or the data files are corrupt.\n");
return(DB_ERROR);
}
if (max_flushed_lsn < (ib_uint64_t) 1000) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Cannot initialize created"
+ " log files because\n");
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Cannot initialize created"
- " log files because\n"
- "InnoDB: data files are corrupt,"
- " or new data files were\n"
- "InnoDB: created when the database"
- " was started previous\n"
- "InnoDB: time but the database"
- " was not shut down\n"
- "InnoDB: normally after that.\n");
+ " InnoDB: data files are corrupt,"
+ " or new data files were\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: created when the database"
+ " was started previous\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: time but the database"
+ " was not shut down\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: normally after that.\n");
return(DB_ERROR);
}
@@ -1548,8 +1623,9 @@ innobase_start_or_create_for_mysql(void)
#ifdef UNIV_LOG_ARCHIVE
} else if (srv_archive_recovery) {
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Starting archive"
+ " InnoDB: Starting archive"
" recovery from a backup...\n");
err = recv_recovery_from_archive_start(
min_flushed_lsn, srv_archive_recovery_limit_lsn,
@@ -1757,6 +1833,24 @@ innobase_start_or_create_for_mysql(void)
os_thread_create(&srv_purge_thread, NULL, NULL);
}
+ /* Wait for the purge and master thread to startup. */
+
+ while (srv_shutdown_state == SRV_SHUTDOWN_NONE) {
+ if (srv_thread_has_reserved_slot(SRV_MASTER) == ULINT_UNDEFINED
+ || (srv_n_purge_threads == 1
+ && srv_thread_has_reserved_slot(SRV_WORKER)
+ == ULINT_UNDEFINED)) {
+
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: "
+ "Waiting for the background threads to "
+ "start\n");
+ os_thread_sleep(1000000);
+ } else {
+ break;
+ }
+ }
+
#ifdef UNIV_DEBUG
/* buf_debug_prints = TRUE; */
#endif /* UNIV_DEBUG */
@@ -1771,11 +1865,14 @@ innobase_start_or_create_for_mysql(void)
if (!srv_auto_extend_last_data_file
&& sum_of_data_file_sizes != tablespace_size_in_header) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Error: tablespace size"
+ " stored in header is %lu pages, but\n",
+ (ulong) tablespace_size_in_header);
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Error: tablespace size"
- " stored in header is %lu pages, but\n"
"InnoDB: the sum of data file sizes is %lu pages\n",
- (ulong) tablespace_size_in_header,
(ulong) sum_of_data_file_sizes);
if (srv_force_recovery == 0
@@ -1783,16 +1880,25 @@ innobase_start_or_create_for_mysql(void)
/* This is a fatal error, the tail of a tablespace is
missing */
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Cannot start InnoDB."
+ " The tail of the system tablespace is\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: missing. Have you edited"
+ " innodb_data_file_path in my.cnf in an\n");
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Cannot start InnoDB."
- " The tail of the system tablespace is\n"
- "InnoDB: missing. Have you edited"
- " innodb_data_file_path in my.cnf in an\n"
- "InnoDB: inappropriate way, removing"
- " ibdata files from there?\n"
- "InnoDB: You can set innodb_force_recovery=1"
- " in my.cnf to force\n"
- "InnoDB: a startup if you are trying"
+ " InnoDB: inappropriate way, removing"
+ " ibdata files from there?\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: You can set innodb_force_recovery=1"
+ " in my.cnf to force\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: a startup if you are trying"
" to recover a badly corrupt database.\n");
return(DB_ERROR);
@@ -1802,26 +1908,38 @@ innobase_start_or_create_for_mysql(void)
if (srv_auto_extend_last_data_file
&& sum_of_data_file_sizes < tablespace_size_in_header) {
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Error: tablespace size stored in header"
- " is %lu pages, but\n"
- "InnoDB: the sum of data file sizes"
+ " InnoDB: Error: tablespace size stored in header"
+ " is %lu pages, but\n",
+ (ulong) tablespace_size_in_header);
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: the sum of data file sizes"
" is only %lu pages\n",
- (ulong) tablespace_size_in_header,
(ulong) sum_of_data_file_sizes);
if (srv_force_recovery == 0) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Cannot start InnoDB. The tail of"
+ " the system tablespace is\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: missing. Have you edited"
+ " innodb_data_file_path in my.cnf in an\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: inappropriate way, removing"
+ " ibdata files from there?\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: You can set innodb_force_recovery=1"
+ " in my.cnf to force\n");
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Cannot start InnoDB. The tail of"
- " the system tablespace is\n"
- "InnoDB: missing. Have you edited"
- " innodb_data_file_path in my.cnf in an\n"
- "InnoDB: inappropriate way, removing"
- " ibdata files from there?\n"
- "InnoDB: You can set innodb_force_recovery=1"
- " in my.cnf to force\n"
- "InnoDB: a startup if you are trying to"
+ " InnoDB: a startup if you are trying to"
" recover a badly corrupt database.\n");
return(DB_ERROR);
@@ -1832,10 +1950,13 @@ innobase_start_or_create_for_mysql(void)
os_fast_mutex_init(&srv_os_test_mutex);
if (0 != os_fast_mutex_trylock(&srv_os_test_mutex)) {
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Error: pthread_mutex_trylock returns"
- " an unexpected value on\n"
- "InnoDB: success! Cannot continue.\n");
+ " InnoDB: Error: pthread_mutex_trylock returns"
+ " an unexpected value on\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: success! Cannot continue.\n");
exit(1);
}
@@ -1850,14 +1971,15 @@ innobase_start_or_create_for_mysql(void)
if (srv_print_verbose_log) {
ut_print_timestamp(stderr);
fprintf(stderr,
- " InnoDB: %s started; "
+ " InnoDB: %s started; "
"log sequence number %llu\n",
INNODB_VERSION_STR, srv_start_lsn);
}
if (srv_force_recovery > 0) {
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: !!! innodb_force_recovery"
+ " InnoDB: !!! innodb_force_recovery"
" is set to %lu !!!\n",
(ulong) srv_force_recovery);
}
@@ -1878,12 +2000,17 @@ innobase_start_or_create_for_mysql(void)
4.1.1. It is essential that the insert buffer is emptied
here! */
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: You are upgrading to an"
+ " InnoDB version which allows multiple\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: tablespaces. Wait that purge"
+ " and insert buffer merge run to\n");
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: You are upgrading to an"
- " InnoDB version which allows multiple\n"
- "InnoDB: tablespaces. Wait that purge"
- " and insert buffer merge run to\n"
- "InnoDB: completion...\n");
+ " InnoDB: completion...\n");
for (;;) {
os_thread_sleep(1000000);
@@ -1895,21 +2022,29 @@ innobase_start_or_create_for_mysql(void)
break;
}
}
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Full purge and insert buffer merge"
+ " InnoDB: Full purge and insert buffer merge"
" completed.\n");
trx_sys_mark_upgraded_to_multiple_tablespaces();
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: You have now successfully upgraded"
+ " to the multiple tablespaces\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: format. You should NOT DOWNGRADE"
+ " to an earlier version of\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: InnoDB! But if you absolutely need to"
+ " downgrade, see\n");
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: You have now successfully upgraded"
- " to the multiple tablespaces\n"
- "InnoDB: format. You should NOT DOWNGRADE"
- " to an earlier version of\n"
- "InnoDB: InnoDB! But if you absolutely need to"
- " downgrade, see\n"
- "InnoDB: " REFMAN "multiple-tablespaces.html\n"
- "InnoDB: for instructions.\n");
+ " InnoDB: " REFMAN "multiple-tablespaces.html\n"
+ " InnoDB: for instructions.\n");
}
if (srv_force_recovery == 0) {