Commit edb93ca4 authored by marko@hundin.mysql.fi's avatar marko@hundin.mysql.fi

Added startup option and settable session variable

innodb_table_locks_old_behavior: do not acquire an
InnoDB table lock for LOCK TABLES, as in mysql-4.0.18
and earlier.
parent 41ab008a
...@@ -4693,7 +4693,8 @@ ha_innobase::external_lock( ...@@ -4693,7 +4693,8 @@ ha_innobase::external_lock(
} }
if (prebuilt->select_lock_type != LOCK_NONE) { if (prebuilt->select_lock_type != LOCK_NONE) {
if (thd->in_lock_tables) { if (thd->in_lock_tables &&
!thd->variables.innodb_table_locks_old_behavior) {
ulint error; ulint error;
error = row_lock_table_for_mysql(prebuilt); error = row_lock_table_for_mysql(prebuilt);
......
...@@ -3526,6 +3526,7 @@ enum options_mysqld { ...@@ -3526,6 +3526,7 @@ enum options_mysqld {
OPT_INNODB_FORCE_RECOVERY, OPT_INNODB_FORCE_RECOVERY,
OPT_INNODB_STATUS_FILE, OPT_INNODB_STATUS_FILE,
OPT_INNODB_MAX_DIRTY_PAGES_PCT, OPT_INNODB_MAX_DIRTY_PAGES_PCT,
OPT_INNODB_TABLE_LOCKS_OLD_BEHAVIOR,
OPT_BDB_CACHE_SIZE, OPT_BDB_CACHE_SIZE,
OPT_BDB_LOG_BUFFER_SIZE, OPT_BDB_LOG_BUFFER_SIZE,
OPT_BDB_MAX_LOCK, OPT_BDB_MAX_LOCK,
...@@ -3699,7 +3700,11 @@ struct my_option my_long_options[] = ...@@ -3699,7 +3700,11 @@ struct my_option my_long_options[] =
{"innodb_max_dirty_pages_pct", OPT_INNODB_MAX_DIRTY_PAGES_PCT, {"innodb_max_dirty_pages_pct", OPT_INNODB_MAX_DIRTY_PAGES_PCT,
"Percentage of dirty pages allowed in bufferpool", (gptr*) &srv_max_buf_pool_modified_pct, "Percentage of dirty pages allowed in bufferpool", (gptr*) &srv_max_buf_pool_modified_pct,
(gptr*) &srv_max_buf_pool_modified_pct, 0, GET_ULONG, REQUIRED_ARG, 90, 0, 100, 0, 0, 0}, (gptr*) &srv_max_buf_pool_modified_pct, 0, GET_ULONG, REQUIRED_ARG, 90, 0, 100, 0, 0, 0},
{"innodb_table_locks_old_behavior", OPT_INNODB_TABLE_LOCKS_OLD_BEHAVIOR,
"Disable InnoDB locking in LOCK TABLES",
(gptr*) &global_system_variables.innodb_table_locks_old_behavior,
(gptr*) &global_system_variables.innodb_table_locks_old_behavior,
0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif /* End HAVE_INNOBASE_DB */ #endif /* End HAVE_INNOBASE_DB */
{"help", '?', "Display this help and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, {"help", '?', "Display this help and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
0, 0, 0, 0, 0}, 0, 0, 0, 0, 0},
......
...@@ -263,6 +263,8 @@ sys_var_thd_ulong sys_net_wait_timeout("wait_timeout", ...@@ -263,6 +263,8 @@ sys_var_thd_ulong sys_net_wait_timeout("wait_timeout",
#ifdef HAVE_INNOBASE_DB #ifdef HAVE_INNOBASE_DB
sys_var_long_ptr sys_innodb_max_dirty_pages_pct("innodb_max_dirty_pages_pct", sys_var_long_ptr sys_innodb_max_dirty_pages_pct("innodb_max_dirty_pages_pct",
&srv_max_buf_pool_modified_pct); &srv_max_buf_pool_modified_pct);
sys_var_thd_bool sys_innodb_table_locks_old_behavior("innodb_table_locks_old_behavior",
&SV::innodb_table_locks_old_behavior);
#endif #endif
...@@ -449,6 +451,7 @@ sys_var *sys_variables[]= ...@@ -449,6 +451,7 @@ sys_var *sys_variables[]=
&sys_os, &sys_os,
#ifdef HAVE_INNOBASE_DB #ifdef HAVE_INNOBASE_DB
&sys_innodb_max_dirty_pages_pct, &sys_innodb_max_dirty_pages_pct,
&sys_innodb_table_locks_old_behavior,
#endif #endif
&sys_unique_checks &sys_unique_checks
}; };
...@@ -520,6 +523,7 @@ struct show_var_st init_vars[]= { ...@@ -520,6 +523,7 @@ struct show_var_st init_vars[]= {
{"innodb_log_group_home_dir", (char*) &innobase_log_group_home_dir, SHOW_CHAR_PTR}, {"innodb_log_group_home_dir", (char*) &innobase_log_group_home_dir, SHOW_CHAR_PTR},
{"innodb_mirrored_log_groups", (char*) &innobase_mirrored_log_groups, SHOW_LONG}, {"innodb_mirrored_log_groups", (char*) &innobase_mirrored_log_groups, SHOW_LONG},
{sys_innodb_max_dirty_pages_pct.name, (char*) &sys_innodb_max_dirty_pages_pct, SHOW_SYS}, {sys_innodb_max_dirty_pages_pct.name, (char*) &sys_innodb_max_dirty_pages_pct, SHOW_SYS},
{sys_innodb_table_locks_old_behavior.name, (char*) &sys_innodb_table_locks_old_behavior, SHOW_SYS},
#endif #endif
{sys_interactive_timeout.name,(char*) &sys_interactive_timeout, SHOW_SYS}, {sys_interactive_timeout.name,(char*) &sys_interactive_timeout, SHOW_SYS},
{sys_join_buffer_size.name, (char*) &sys_join_buffer_size, SHOW_SYS}, {sys_join_buffer_size.name, (char*) &sys_join_buffer_size, SHOW_SYS},
......
...@@ -338,6 +338,9 @@ struct system_variables ...@@ -338,6 +338,9 @@ struct system_variables
my_bool low_priority_updates; my_bool low_priority_updates;
my_bool new_mode; my_bool new_mode;
my_bool query_cache_wlock_invalidate; my_bool query_cache_wlock_invalidate;
#ifdef HAVE_INNOBASE_DB
my_bool innodb_table_locks_old_behavior;
#endif /* HAVE_INNOBASE_DB */
CONVERT *convert_set; CONVERT *convert_set;
}; };
......
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