summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSatya B <satya.bn@sun.com>2009-05-19 13:50:28 +0530
committerSatya B <satya.bn@sun.com>2009-05-19 13:50:28 +0530
commit07b93588609d8b5c2db72b61e61a8a2a70281175 (patch)
treefc67aa02f947fd197d2ff57f74f397207f8cabdc /mysql-test
parent65eac15004f2f455182dc09e100bacca21afaa36 (diff)
downloadmariadb-git-07b93588609d8b5c2db72b61e61a8a2a70281175.tar.gz
Applying InnoDB snashot 5.1-ss5024,part 3. Fixes BUG#42101
BUG#42101 - Race condition in innodb_commit_concurrency Detailed revision comments: r4994 | marko | 2009-05-14 15:04:55 +0300 (Thu, 14 May 2009) | 18 lines branches/5.1: Prevent a race condition in innobase_commit() by ensuring that innodb_commit_concurrency>0 remains constant at run time. (Bug #42101) srv_commit_concurrency: Make this a static variable in ha_innodb.cc. innobase_commit_concurrency_validate(): Check that innodb_commit_concurrency is not changed from or to 0 at run time. This is needed, because innobase_commit() assumes that innodb_commit_concurrency>0 remains constant. Without this limitation, the checks for innodb_commit_concurrency>0 in innobase_commit() should be removed and that function would have to acquire and release commit_cond_m at least twice per invocation. Normally, innodb_commit_concurrency=0, and introducing the mutex operations would mean significant overhead. innodb_bug42101.test, innodb_bug42101-nonzero.test: Test cases. rb://123 approved by Heikki Tuuri
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/innodb_bug42101-nonzero.result22
-rw-r--r--mysql-test/r/innodb_bug42101.result18
-rw-r--r--mysql-test/t/innodb_bug42101-nonzero-master.opt1
-rw-r--r--mysql-test/t/innodb_bug42101-nonzero.test19
-rw-r--r--mysql-test/t/innodb_bug42101.test17
5 files changed, 77 insertions, 0 deletions
diff --git a/mysql-test/r/innodb_bug42101-nonzero.result b/mysql-test/r/innodb_bug42101-nonzero.result
new file mode 100644
index 00000000000..8a14296381c
--- /dev/null
+++ b/mysql-test/r/innodb_bug42101-nonzero.result
@@ -0,0 +1,22 @@
+set global innodb_commit_concurrency=0;
+ERROR HY000: Incorrect arguments to SET
+select @@innodb_commit_concurrency;
+@@innodb_commit_concurrency
+1
+set global innodb_commit_concurrency=1;
+select @@innodb_commit_concurrency;
+@@innodb_commit_concurrency
+1
+set global innodb_commit_concurrency=42;
+select @@innodb_commit_concurrency;
+@@innodb_commit_concurrency
+42
+set global innodb_commit_concurrency=0;
+ERROR HY000: Incorrect arguments to SET
+select @@innodb_commit_concurrency;
+@@innodb_commit_concurrency
+42
+set global innodb_commit_concurrency=1;
+select @@innodb_commit_concurrency;
+@@innodb_commit_concurrency
+1
diff --git a/mysql-test/r/innodb_bug42101.result b/mysql-test/r/innodb_bug42101.result
new file mode 100644
index 00000000000..9a9c8e0ce9b
--- /dev/null
+++ b/mysql-test/r/innodb_bug42101.result
@@ -0,0 +1,18 @@
+set global innodb_commit_concurrency=0;
+select @@innodb_commit_concurrency;
+@@innodb_commit_concurrency
+0
+set global innodb_commit_concurrency=1;
+ERROR HY000: Incorrect arguments to SET
+select @@innodb_commit_concurrency;
+@@innodb_commit_concurrency
+0
+set global innodb_commit_concurrency=42;
+ERROR HY000: Incorrect arguments to SET
+select @@innodb_commit_concurrency;
+@@innodb_commit_concurrency
+0
+set global innodb_commit_concurrency=0;
+select @@innodb_commit_concurrency;
+@@innodb_commit_concurrency
+0
diff --git a/mysql-test/t/innodb_bug42101-nonzero-master.opt b/mysql-test/t/innodb_bug42101-nonzero-master.opt
new file mode 100644
index 00000000000..d71dbe17d5b
--- /dev/null
+++ b/mysql-test/t/innodb_bug42101-nonzero-master.opt
@@ -0,0 +1 @@
+--innodb_commit_concurrency=1
diff --git a/mysql-test/t/innodb_bug42101-nonzero.test b/mysql-test/t/innodb_bug42101-nonzero.test
new file mode 100644
index 00000000000..c691a234c51
--- /dev/null
+++ b/mysql-test/t/innodb_bug42101-nonzero.test
@@ -0,0 +1,19 @@
+#
+# Bug#42101 Race condition in innodb_commit_concurrency
+# http://bugs.mysql.com/42101
+#
+
+-- source include/have_innodb.inc
+
+--error ER_WRONG_ARGUMENTS
+set global innodb_commit_concurrency=0;
+select @@innodb_commit_concurrency;
+set global innodb_commit_concurrency=1;
+select @@innodb_commit_concurrency;
+set global innodb_commit_concurrency=42;
+select @@innodb_commit_concurrency;
+--error ER_WRONG_ARGUMENTS
+set global innodb_commit_concurrency=0;
+select @@innodb_commit_concurrency;
+set global innodb_commit_concurrency=1;
+select @@innodb_commit_concurrency;
diff --git a/mysql-test/t/innodb_bug42101.test b/mysql-test/t/innodb_bug42101.test
new file mode 100644
index 00000000000..13d531ecde7
--- /dev/null
+++ b/mysql-test/t/innodb_bug42101.test
@@ -0,0 +1,17 @@
+#
+# Bug#42101 Race condition in innodb_commit_concurrency
+# http://bugs.mysql.com/42101
+#
+
+-- source include/have_innodb.inc
+
+set global innodb_commit_concurrency=0;
+select @@innodb_commit_concurrency;
+--error ER_WRONG_ARGUMENTS
+set global innodb_commit_concurrency=1;
+select @@innodb_commit_concurrency;
+--error ER_WRONG_ARGUMENTS
+set global innodb_commit_concurrency=42;
+select @@innodb_commit_concurrency;
+set global innodb_commit_concurrency=0;
+select @@innodb_commit_concurrency;