diff options
author | monty@mashka.mysql.fi <> | 2002-09-17 05:17:32 +0300 |
---|---|---|
committer | monty@mashka.mysql.fi <> | 2002-09-17 05:17:32 +0300 |
commit | 3bb2660d1047f33988ae9703dd8172d059037fdc (patch) | |
tree | 6684292d18658097f30b2ff7eadd9af7357a4e51 /innobase | |
parent | c7b6854f704f4bd536a5ba4ecd76d1a5543ada9b (diff) | |
parent | ff993695a43914561488f71f3819bdf81d4df97a (diff) | |
download | mariadb-git-3bb2660d1047f33988ae9703dd8172d059037fdc.tar.gz |
Merge with 3.23.53
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/include/srv0srv.h | 2 | ||||
-rw-r--r-- | innobase/os/os0file.c | 21 | ||||
-rw-r--r-- | innobase/row/row0mysql.c | 15 | ||||
-rw-r--r-- | innobase/srv/srv0srv.c | 2 |
4 files changed, 30 insertions, 10 deletions
diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h index 178c7b6971f..9de5e9ccfc9 100644 --- a/innobase/include/srv0srv.h +++ b/innobase/include/srv0srv.h @@ -53,7 +53,7 @@ extern ulint srv_n_log_files; extern ulint srv_log_file_size; extern ibool srv_log_archive_on; extern ulint srv_log_buffer_size; -extern ibool srv_flush_log_at_trx_commit; +extern ulint srv_flush_log_at_trx_commit; extern byte srv_latin1_ordering[256];/* The sort order table of the latin1 character set */ diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 6f122f38107..1da66fdc512 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -15,8 +15,6 @@ Created 10/21/1995 Heikki Tuuri #undef HAVE_FDATASYNC -#undef UNIV_NON_BUFFERED_IO - #ifdef POSIX_ASYNC_IO /* We assume in this case that the OS has standard Posix aio (at least SunOS 2.6, HP-UX 11i and AIX 4.3 have) */ @@ -500,14 +498,25 @@ try_again: } #endif #ifdef UNIV_NON_BUFFERED_IO - attributes = attributes | FILE_FLAG_NO_BUFFERING; + if (type == OS_LOG_FILE && srv_flush_log_at_trx_commit == 2) { + /* Do not use unbuffered i/o to log files because + value 2 denotes that we do not flush the log at every + commit, but only once per second */ + } else { + attributes = attributes | FILE_FLAG_NO_BUFFERING; + } #endif } else if (purpose == OS_FILE_NORMAL) { - attributes = 0 + attributes = 0; #ifdef UNIV_NON_BUFFERED_IO - | FILE_FLAG_NO_BUFFERING + if (type == OS_LOG_FILE && srv_flush_log_at_trx_commit == 2) { + /* Do not use unbuffered i/o to log files because + value 2 denotes that we do not flush the log at every + commit, but only once per second */ + } else { + attributes = attributes | FILE_FLAG_NO_BUFFERING; + } #endif - ; } else { attributes = 0; ut_error; diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 43eef8c5092..dc028b1c67b 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -1186,7 +1186,12 @@ row_create_table_for_mysql( ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); ut_ad(mutex_own(&(dict_sys->mutex))); - if (srv_created_new_raw || srv_force_recovery) { + /* We allow a create table also if innodb_force_recovery is used. This + enables the user to stop a runaway rollback or a crash caused by + a temporary table #sql... He can use the trick explained in the + manual to rename the temporary table to rsql..., and then drop it. */ + + if (srv_created_new_raw) { fprintf(stderr, "InnoDB: A new raw disk partition was initialized or\n" "InnoDB: innodb_force_recovery is on: we do not allow\n" @@ -1707,7 +1712,13 @@ row_drop_table_for_mysql( ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); ut_a(name != NULL); - if (srv_created_new_raw || srv_force_recovery) { + /* Note that we allow dropping of a table even if innodb_force_recovery + is used. If a rollback or purge would crash because of a corrupt + table, the user can try dropping it to avoid the crash. This is also + a nice way to stop a runaway rollback caused by a failing big + table import in a single transaction. */ + + if (srv_created_new_raw) { fprintf(stderr, "InnoDB: A new raw disk partition was initialized or\n" "InnoDB: innodb_force_recovery is on: we do not allow\n" diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 95bcd2351cd..d754f603efc 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -96,7 +96,7 @@ ulint srv_n_log_files = ULINT_MAX; ulint srv_log_file_size = ULINT_MAX; /* size in database pages */ ibool srv_log_archive_on = TRUE; ulint srv_log_buffer_size = ULINT_MAX; /* size in database pages */ -ibool srv_flush_log_at_trx_commit = TRUE; +ulint srv_flush_log_at_trx_commit = 1; byte srv_latin1_ordering[256] /* The sort order table of the latin1 character set. The following table is |