summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/innodb.result15
-rw-r--r--mysql-test/t/innodb.test9
-rw-r--r--sql/ha_innodb.h1
-rw-r--r--sql/mysqld.cc6
-rw-r--r--sql/set_var.cc4
5 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 06940d65a79..cdb2c1d6aae 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -1715,5 +1715,20 @@ Innodb_row_lock_time_max 0
show status like "Innodb_row_lock_time_avg";
Variable_name Value
Innodb_row_lock_time_avg 0
+show variables like "innodb_sync_spin_loops";
+Variable_name Value
+innodb_sync_spin_loops 20
+set global innodb_sync_spin_loops=1000;
+show variables like "innodb_sync_spin_loops";
+Variable_name Value
+innodb_sync_spin_loops 1000
+set global innodb_sync_spin_loops=0;
+show variables like "innodb_sync_spin_loops";
+Variable_name Value
+innodb_sync_spin_loops 0
+set global innodb_sync_spin_loops=20;
+show variables like "innodb_sync_spin_loops";
+Variable_name Value
+innodb_sync_spin_loops 20
create table t1 (v varchar(16384)) engine=innodb;
ERROR 42000: Column length too big for column 'v' (max = 255); use BLOB instead
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index cee216e9e29..0ffd9e4e9f5 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -1218,6 +1218,15 @@ show status like "Innodb_row_lock_time";
show status like "Innodb_row_lock_time_max";
show status like "Innodb_row_lock_time_avg";
+# Test for innodb_sync_spin_loops variable
+show variables like "innodb_sync_spin_loops";
+set global innodb_sync_spin_loops=1000;
+show variables like "innodb_sync_spin_loops";
+set global innodb_sync_spin_loops=0;
+show variables like "innodb_sync_spin_loops";
+set global innodb_sync_spin_loops=20;
+show variables like "innodb_sync_spin_loops";
+
#
# Test varchar
#
diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h
index fcb9165de64..e7277ea03a3 100644
--- a/sql/ha_innodb.h
+++ b/sql/ha_innodb.h
@@ -212,6 +212,7 @@ extern "C" {
extern ulong srv_max_buf_pool_modified_pct;
extern ulong srv_max_purge_lag;
extern ulong srv_auto_extend_increment;
+extern ulong srv_n_spin_wait_rounds;
extern ulong srv_max_purge_lag;
}
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index e9d4a088d16..e88f4eb0e73 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -4199,6 +4199,7 @@ enum options_mysqld
OPT_INNODB_TABLE_LOCKS,
OPT_INNODB_OPEN_FILES,
OPT_INNODB_AUTOEXTEND_INCREMENT,
+ OPT_INNODB_SYNC_SPIN_LOOPS,
OPT_BDB_CACHE_SIZE,
OPT_BDB_LOG_BUFFER_SIZE,
OPT_BDB_MAX_LOCK,
@@ -5044,6 +5045,11 @@ log and this option does nothing anymore.",
"How many files at the maximum InnoDB keeps open at the same time.",
(gptr*) &innobase_open_files, (gptr*) &innobase_open_files, 0,
GET_LONG, REQUIRED_ARG, 300L, 10L, ~0L, 0, 1L, 0},
+ {"innodb_sync_spin_loops", OPT_INNODB_SYNC_SPIN_LOOPS,
+ "Count of spin-loop rounds in InnoDB mutexes",
+ (gptr*) &srv_n_spin_wait_rounds,
+ (gptr*) &srv_n_spin_wait_rounds,
+ 0, GET_LONG, REQUIRED_ARG, 20L, 0L, ~0L, 0, 1L, 0},
#ifdef HAVE_REPLICATION
/*
Disabled for the 4.1.3 release. Disabling just this paragraph of code is
diff --git a/sql/set_var.cc b/sql/set_var.cc
index d710be2bb2e..3597a4930f8 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -378,6 +378,8 @@ sys_var_thd_bool sys_innodb_table_locks("innodb_table_locks",
&SV::innodb_table_locks);
sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment",
&srv_auto_extend_increment);
+sys_var_long_ptr sys_innodb_sync_spin_loops("innodb_sync_spin_loops",
+ &srv_n_spin_wait_rounds);
#endif
#ifdef HAVE_NDBCLUSTER_DB
@@ -651,6 +653,7 @@ sys_var *sys_variables[]=
&sys_innodb_table_locks,
&sys_innodb_max_purge_lag,
&sys_innodb_autoextend_increment,
+ &sys_innodb_sync_spin_loops,
#endif
#ifdef HAVE_NDBCLUSTER_DB
&sys_ndb_autoincrement_prefetch_sz,
@@ -763,6 +766,7 @@ struct show_var_st init_vars[]= {
{"innodb_mirrored_log_groups", (char*) &innobase_mirrored_log_groups, SHOW_LONG},
{"innodb_open_files", (char*) &innobase_open_files, SHOW_LONG },
{"innodb_thread_concurrency", (char*) &innobase_thread_concurrency, SHOW_LONG },
+ {sys_innodb_sync_spin_loops.name, (char*) &sys_innodb_sync_spin_loops, SHOW_SYS},
#endif
{sys_interactive_timeout.name,(char*) &sys_interactive_timeout, SHOW_SYS},
{sys_join_buffer_size.name, (char*) &sys_join_buffer_size, SHOW_SYS},