Commit 74f499fa authored by unknown's avatar unknown
Browse files

Applied patch recieved from Marko:

 Make innodb_flush_log_at_trx_commit a settable global variable.


innobase/include/srv0srv.h:
  Change the type of srv_flush_log_at_trx_commit.
innobase/srv/srv0srv.c:
  Change the type of srv_flush_log_at_trx_commit.
sql/ha_innodb.cc:
  Remove innobase_flush_log_at_trx_commit.
   (Set srv_flush_log_at_trx_commit directly).
sql/ha_innodb.h:
  Remove innobase_flush_log_at_trx_commit.
   (Set srv_flush_log_at_trx_commit directly).
sql/mysqld.cc:
  Bypass the variable innobase innobase_flush_log_at_trx_commit.
sql/set_var.cc:
  Make innodb_flush_log_at_trx_commit a settable global variable.
parent 596666f7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 ulint	srv_flush_log_at_trx_commit;
extern ulong	srv_flush_log_at_trx_commit;

extern byte	srv_latin1_ordering[256];/* The sort order table of the latin1
					character set */
+1 −1
Original line number Diff line number Diff line
@@ -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 */ 
ulint	srv_flush_log_at_trx_commit = 1;
ulong	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
+1 −3
Original line number Diff line number Diff line
@@ -167,7 +167,6 @@ 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;
@@ -1341,7 +1340,6 @@ 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. */
@@ -1816,7 +1814,7 @@ innobase_commit_complete(

                trx->active_trans = 0;

                if (srv_flush_log_at_trx_commit == 0) {
                if (UNIV_UNLIKELY(srv_flush_log_at_trx_commit == 0)) {

                        return(0);
                }
+1 −1
Original line number Diff line number Diff line
@@ -200,7 +200,6 @@ class ha_innobase: public handler

extern struct show_var_st innodb_status_variables[];
extern uint innobase_init_flags, innobase_lock_type;
extern uint innobase_flush_log_at_trx_commit;
extern ulong innobase_cache_size, innobase_fast_shutdown;
extern ulong innobase_large_page_size;
extern char *innobase_home, *innobase_tmpdir, *innobase_logdir;
@@ -238,6 +237,7 @@ 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;
}

extern TYPELIB innobase_lock_typelib;
+2 −2
Original line number Diff line number Diff line
@@ -4823,8 +4823,8 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite,
   (gptr*) &innobase_file_per_table, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
  {"innodb_flush_log_at_trx_commit", OPT_INNODB_FLUSH_LOG_AT_TRX_COMMIT,
   "Set to 0 (write and flush once per second), 1 (write and flush at each commit) or 2 (write at commit, flush once per second).",
   (gptr*) &innobase_flush_log_at_trx_commit,
   (gptr*) &innobase_flush_log_at_trx_commit,
   (gptr*) &srv_flush_log_at_trx_commit,
   (gptr*) &srv_flush_log_at_trx_commit,
   0, GET_UINT, OPT_ARG,  1, 0, 2, 0, 0, 0},
  {"innodb_flush_method", OPT_INNODB_FLUSH_METHOD,
   "With which method to flush data.", (gptr*) &innobase_unix_file_flush_method,
Loading