Commit f6485936 authored by marko's avatar marko

Revert r148 until MySQL AB has finally merged the code to the 5.1 tree:

Port r146 from branches/5.0:

Make innodb_flush_log_at_trx_commit a settable global variable.
parent 5d554cff
......@@ -164,6 +164,7 @@ char* innobase_unix_file_flush_method = NULL;
/* Below we have boolean-valued start-up parameters, and their default
values */
uint innobase_flush_log_at_trx_commit = 1;
ulong innobase_fast_shutdown = 1;
my_bool innobase_log_archive = FALSE;/* unused */
my_bool innobase_use_doublewrite = TRUE;
......@@ -1360,6 +1361,7 @@ innobase_init(void)
srv_log_archive_on = (ulint) innobase_log_archive;
#endif /* UNIV_LOG_ARCHIVE */
srv_log_buffer_size = (ulint) innobase_log_buffer_size;
srv_flush_log_at_trx_commit = (ulint) innobase_flush_log_at_trx_commit;
/* We set srv_pool_size here in units of 1 kB. InnoDB internally
changes the value so that it becomes the number of database pages. */
......@@ -1834,7 +1836,7 @@ innobase_commit_complete(
trx->active_trans = 0;
if (UNIV_UNLIKELY(srv_flush_log_at_trx_commit == 0)) {
if (srv_flush_log_at_trx_commit == 0) {
return(0);
}
......
......@@ -210,6 +210,7 @@ class ha_innobase: public handler
};
extern SHOW_VAR innodb_status_variables[];
extern uint innobase_flush_log_at_trx_commit;
extern ulong innobase_fast_shutdown;
extern ulong innobase_large_page_size;
extern long innobase_mirrored_log_groups, innobase_log_files_in_group;
......@@ -245,7 +246,6 @@ extern ulong srv_n_free_tickets_to_enter;
extern ulong srv_thread_sleep_delay;
extern ulong srv_thread_concurrency;
extern ulong srv_commit_concurrency;
extern ulong srv_flush_log_at_trx_commit;
}
bool innobase_init(void);
......
......@@ -77,7 +77,7 @@ extern ulint srv_n_log_groups;
extern ulint srv_n_log_files;
extern ulint srv_log_file_size;
extern ulint srv_log_buffer_size;
extern ulong 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 */
......
......@@ -518,61 +518,36 @@ os_file_create_tmpfile(void)
/*========================*/
/* out: temporary file handle, or NULL on error */
{
#ifdef __NETWARE__
#ifdef UNIV_HOTBACKUP
ut_error;
return(NULL);
#else
# ifdef __NETWARE__
FILE* file = tmpfile();
#else /* __NETWARE__ */
# else /* __NETWARE__ */
FILE* file = NULL;
int fd = -1;
# ifdef UNIV_HOTBACKUP
int tries;
for (tries = 10; tries--; ) {
char* name = tempnam(fil_path_to_mysql_datadir, "ib");
if (!name) {
break;
}
fd = open(name,
# ifdef __WIN__
O_SEQUENTIAL | O_SHORT_LIVED | O_TEMPORARY |
# endif /* __WIN__ */
O_CREAT | O_EXCL | O_RDWR,
S_IREAD | S_IWRITE);
if (fd >= 0) {
# ifndef __WIN__
unlink(name);
# endif /* !__WIN__ */
free(name);
break;
}
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: Warning: "
"unable to create temporary file %s, retrying\n",
name);
free(name);
}
# else /* UNIV_HOTBACKUP */
fd = innobase_mysql_tmpfile();
# endif /* UNIV_HOTBACKUP */
int fd = innobase_mysql_tmpfile();
if (fd >= 0) {
file = fdopen(fd, "w+b");
}
#endif /* __NETWARE__ */
# endif /* __NETWARE__ */
if (!file) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error: unable to create temporary file;"
" errno: %d\n", errno);
#ifndef __NETWARE__
# ifndef __NETWARE__
if (fd >= 0) {
close(fd);
}
#endif /* !__NETWARE__ */
# endif /* !__NETWARE__ */
}
return(file);
#endif /* UNIV_HOTBACKUP */
}
/***************************************************************************
......
......@@ -113,7 +113,7 @@ ulint srv_n_log_groups = ULINT_MAX;
ulint srv_n_log_files = ULINT_MAX;
ulint srv_log_file_size = ULINT_MAX; /* size in database pages */
ulint srv_log_buffer_size = ULINT_MAX; /* size in database pages */
ulong srv_flush_log_at_trx_commit = 1;
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
......
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