diff options
author | unknown <jan@hundin.mysql.fi> | 2004-07-20 14:15:38 +0300 |
---|---|---|
committer | unknown <jan@hundin.mysql.fi> | 2004-07-20 14:15:38 +0300 |
commit | 238b226f2626573021103872b85d54a79c5743ea (patch) | |
tree | 7d6f3ac8dd078914213cb4bb489974bcbb92ec38 /sql | |
parent | 784191d9cec94721afb927a891bce77fc4797f30 (diff) | |
download | mariadb-git-238b226f2626573021103872b85d54a79c5743ea.tar.gz |
Added innodb_locks_unsafe_for_binlog option. This option turns off Innodb
next-key locking. Using this option the locks InnoDB sets on index
records do not affect the ``gap'' before that index record. Thus, this option
allows phantom problem.
innobase/include/srv0srv.h:
Added srv_locks_unsafe_for_binlog for innodb_locks_unsafe_for_binlog option.
innobase/row/row0sel.c:
If innodb_locks_unsafe_for_binlog option is used, we lock only the record, i.e.
next-key locking is not used. Therefore, setting lock to the index record
do not affect the ``gap'' before that index record. Thus, this option
allows phantom problem, because concurrent insert operations are allowed inside
the select range.
innobase/srv/srv0srv.c:
Added srv_locks_unsafe_for_binlog for innodb_locks_unsafe_for_binlog option.
sql/ha_innodb.cc:
Added innobase_locks_unsafe_for_binlog and srv_locks_unsafe_for_binlog for
innodb_locks_unsafe_for_binlog option.
sql/ha_innodb.h:
Added innobase_locks_unsafe_for_binlog for innodb_locks_unsafe_for_binlog option.
sql/mysqld.cc:
Added OPT_INNODB_LOCKS_UNSAFE_FOR_BINLOG, innobase_locks_unsafe_for_binlog for
innodb_locks_unsafe_for_binlog option.
sql/set_var.cc:
Added innodb_locks_unsafe_for_binlog and innobase_locks_unsafe_for_binlog for
innodb_locks_unsafe_for_binlog option.
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_innodb.cc | 2 | ||||
-rw-r--r-- | sql/ha_innodb.h | 2 | ||||
-rw-r--r-- | sql/mysqld.cc | 5 | ||||
-rw-r--r-- | sql/set_var.cc | 1 |
4 files changed, 9 insertions, 1 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 6eae315e443..a7dce3a6ab8 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -117,6 +117,7 @@ my_bool innobase_log_archive = FALSE;/* unused */ my_bool innobase_use_native_aio = FALSE; my_bool innobase_fast_shutdown = TRUE; my_bool innobase_file_per_table = FALSE; +my_bool innobase_locks_unsafe_for_binlog = FALSE; static char *internal_innobase_data_file_path = NULL; @@ -908,6 +909,7 @@ innobase_init(void) srv_fast_shutdown = (ibool) innobase_fast_shutdown; srv_file_per_table = (ibool) innobase_file_per_table; + srv_locks_unsafe_for_binlog = (ibool) innobase_locks_unsafe_for_binlog; srv_max_n_open_files = (ulint) innobase_open_files; diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index e09697f7ce6..6815bdd632d 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -189,7 +189,7 @@ extern char *innobase_unix_file_flush_method; /* The following variables have to be my_bool for SHOW VARIABLES to work */ extern my_bool innobase_log_archive, innobase_use_native_aio, innobase_fast_shutdown, - innobase_file_per_table; + innobase_file_per_table, innobase_locks_unsafe_for_binlog; extern "C" { extern ulong srv_max_buf_pool_modified_pct; } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 4fd13d33bab..869048cee93 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3880,6 +3880,7 @@ enum options_mysqld OPT_INNODB_FLUSH_METHOD, OPT_INNODB_FAST_SHUTDOWN, OPT_INNODB_FILE_PER_TABLE, OPT_CRASH_BINLOG_INNODB, + OPT_INNODB_LOCKS_UNSAFE_FOR_BINLOG, OPT_SAFE_SHOW_DB, OPT_INNODB_SAFE_BINLOG, OPT_INNODB, OPT_ISAM, OPT_NDBCLUSTER, OPT_SKIP_SAFEMALLOC, OPT_TEMP_POOL, OPT_TX_ISOLATION, @@ -4156,6 +4157,10 @@ Disable with --skip-bdb (will save memory).", "Stores each InnoDB table to an .ibd file in the database dir.", (gptr*) &innobase_file_per_table, (gptr*) &innobase_file_per_table, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"innodb_locks_unsafe_for_binlog", OPT_INNODB_LOCKS_UNSAFE_FOR_BINLOG, + "Force Innodb not to use next-key locking. Instead use only row-level locking", + (gptr*) &innobase_locks_unsafe_for_binlog, + (gptr*) &innobase_locks_unsafe_for_binlog, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif /* End HAVE_INNOBASE_DB */ {"init-connect", OPT_INIT_CONNECT, "Command(s) that are executed for each new connection", (gptr*) &opt_init_connect, (gptr*) &opt_init_connect, 0, GET_STR_ALLOC, diff --git a/sql/set_var.cc b/sql/set_var.cc index e1cfb77d297..fb9ff285859 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -673,6 +673,7 @@ struct show_var_st init_vars[]= { {"innodb_fast_shutdown", (char*) &innobase_fast_shutdown, SHOW_MY_BOOL}, {"innodb_file_io_threads", (char*) &innobase_file_io_threads, SHOW_LONG }, {"innodb_file_per_table", (char*) &innobase_file_per_table, SHOW_MY_BOOL}, + {"innodb_locks_unsafe_for_binlog", (char*) &innobase_locks_unsafe_for_binlog, SHOW_MY_BOOL}, {"innodb_flush_log_at_trx_commit", (char*) &innobase_flush_log_at_trx_commit, SHOW_INT}, {"innodb_flush_method", (char*) &innobase_unix_file_flush_method, SHOW_CHAR_PTR}, {"innodb_force_recovery", (char*) &innobase_force_recovery, SHOW_LONG }, |