MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:klewis Date:January 31 2008 10:48pm
Subject:bk commit into 6.0 tree (klewis:1.2796) BUG#34164
View as plain text  
Below is the list of changes that have just been committed into a local
6.0 repository of . When  does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-01-31 16:48:23-06:00, klewis@klewis-mysql. +3 -0
  Bug#34164 - Add a testcase and improve code to convert serializable
  and read-uncommitted modes into the current version of repeatable-read.

  mysql-test/suite/falcon/r/falcon_bug_34164.result@stripped, 2008-01-31 16:48:13-06:00, klewis@klewis-mysql. +106 -0
    Bug#34164 - Add a testcase

  mysql-test/suite/falcon/r/falcon_bug_34164.result@stripped, 2008-01-31 16:48:13-06:00, klewis@klewis-mysql. +0 -0

  mysql-test/suite/falcon/t/falcon_bug_34164.test@stripped, 2008-01-31 16:48:15-06:00, klewis@klewis-mysql. +89 -0
    Bug#34164 - Add a testcase

  mysql-test/suite/falcon/t/falcon_bug_34164.test@stripped, 2008-01-31 16:48:15-06:00, klewis@klewis-mysql. +0 -0

  storage/falcon/ha_falcon.cpp@stripped, 2008-01-31 16:48:05-06:00, klewis@klewis-mysql. +12 -6
    Bug#34164 - Better code

diff -Nrup a/mysql-test/suite/falcon/r/falcon_bug_34164.result b/mysql-test/suite/falcon/r/falcon_bug_34164.result
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/suite/falcon/r/falcon_bug_34164.result	2008-01-31 16:48:13 -06:00
@@ -0,0 +1,106 @@
+SET storage_engine = Falcon;
+*** Bug #34164 ***
+DROP DATABASE IF EXISTS test2;
+SET GLOBAL FALCON_CONSISTENT_READ=OFF;
+CREATE DATABASE test2;
+USE test2;
+CREATE TABLE t1 (a int primary key, b int) engine=falcon;
+# Establish connection conn1 (user = root)
+USE test2;
+SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+SHOW VARIABLES LIKE 'tx_isolation';
+Variable_name	Value
+tx_isolation	SERIALIZABLE
+SHOW VARIABLES LIKE 'falcon_consistent_read';
+Variable_name	Value
+falcon_consistent_read	OFF
+START TRANSACTION;
+SELECT * FROM t1;
+a	b
+Warnings:
+Warning	1568	Falcon does not support SERIALIZABLE ISOLATION, using REPEATABLE READ instead.
+INSERT INTO t1 VALUES (1,1);
+Warnings:
+Warning	1568	Falcon does not support SERIALIZABLE ISOLATION, using REPEATABLE READ instead.
+UPDATE t1 SET b = 11 WHERE a = 1;
+COMMIT;
+SELECT * FROM t1;
+a	b
+1	11
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SHOW VARIABLES LIKE 'tx_isolation';
+Variable_name	Value
+tx_isolation	READ-UNCOMMITTED
+SHOW VARIABLES LIKE 'falcon_consistent_read';
+Variable_name	Value
+falcon_consistent_read	OFF
+START TRANSACTION;
+SELECT * FROM t1;
+a	b
+1	11
+Warnings:
+Warning	1568	Falcon does not support READ UNCOMMITTED ISOLATION, using REPEATABLE READ instead.
+INSERT INTO t1 VALUES (2,2);
+Warnings:
+Warning	1568	Falcon does not support READ UNCOMMITTED ISOLATION, using REPEATABLE READ instead.
+UPDATE t1 SET b = 22 WHERE a = 2;
+COMMIT;
+SELECT * FROM t1;
+a	b
+1	11
+2	22
+SET GLOBAL FALCON_CONSISTENT_READ=ON;
+# Establish connection conn2 (user = root)
+USE test2;
+SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+SHOW VARIABLES LIKE 'tx_isolation';
+Variable_name	Value
+tx_isolation	SERIALIZABLE
+SHOW VARIABLES LIKE 'falcon_consistent_read';
+Variable_name	Value
+falcon_consistent_read	ON
+START TRANSACTION;
+SELECT * FROM t1;
+a	b
+1	11
+2	22
+Warnings:
+Warning	1568	Falcon does not support SERIALIZABLE ISOLATION, using REPEATABLE READ instead.
+INSERT INTO t1 VALUES (3,3);
+Warnings:
+Warning	1568	Falcon does not support SERIALIZABLE ISOLATION, using REPEATABLE READ instead.
+UPDATE t1 SET b = 33 WHERE a = 3;
+COMMIT;
+SELECT * FROM t1;
+a	b
+1	11
+2	22
+3	3
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SHOW VARIABLES LIKE 'tx_isolation';
+Variable_name	Value
+tx_isolation	READ-UNCOMMITTED
+SHOW VARIABLES LIKE 'falcon_consistent_read';
+Variable_name	Value
+falcon_consistent_read	ON
+START TRANSACTION;
+SELECT * FROM t1;
+a	b
+1	11
+2	22
+3	3
+Warnings:
+Warning	1568	Falcon does not support READ UNCOMMITTED ISOLATION, using REPEATABLE READ instead.
+INSERT INTO t1 VALUES (4,4);
+Warnings:
+Warning	1568	Falcon does not support READ UNCOMMITTED ISOLATION, using REPEATABLE READ instead.
+UPDATE t1 SET b = 44 WHERE a = 4;
+COMMIT;
+SELECT * FROM t1;
+a	b
+1	11
+2	22
+3	3
+4	4
+DROP DATABASE test2;
+USE test;
diff -Nrup a/mysql-test/suite/falcon/t/falcon_bug_34164.test b/mysql-test/suite/falcon/t/falcon_bug_34164.test
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/suite/falcon/t/falcon_bug_34164.test	2008-01-31 16:48:15 -06:00
@@ -0,0 +1,89 @@
+--disable_abort_on_error
+--source include/have_falcon.inc
+
+SET storage_engine = Falcon;
+#
+# Bug #34164: Serializable Transaction asserts
+#
+--echo *** Bug #34164 ***
+--disable_warnings
+DROP DATABASE IF EXISTS test2;
+--enable_warnings
+
+SET GLOBAL FALCON_CONSISTENT_READ=OFF;
+CREATE DATABASE test2;
+USE test2;
+CREATE TABLE t1 (a int primary key, b int) engine=falcon;
+
+--echo # Establish connection conn1 (user = root)
+connect (conn1,localhost,root,,);
+connection conn1;
+USE test2;
+SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+SHOW VARIABLES LIKE 'tx_isolation';
+SHOW VARIABLES LIKE 'falcon_consistent_read';
+START TRANSACTION;
+SELECT * FROM t1;
+INSERT INTO t1 VALUES (1,1);
+connection default;
+--send UPDATE t1 SET b = 11 WHERE a = 1
+connection conn1;
+COMMIT;
+connection default;
+--reap
+SELECT * FROM t1;
+
+
+connection conn1;
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SHOW VARIABLES LIKE 'tx_isolation';
+SHOW VARIABLES LIKE 'falcon_consistent_read';
+START TRANSACTION;
+SELECT * FROM t1;
+INSERT INTO t1 VALUES (2,2);
+connection default;
+--send UPDATE t1 SET b = 22 WHERE a = 2
+connection conn1;
+COMMIT;
+connection default;
+--reap
+SELECT * FROM t1;
+
+
+SET GLOBAL FALCON_CONSISTENT_READ=ON;
+--echo # Establish connection conn2 (user = root)
+connect (conn2,localhost,root,,);
+connection conn2;
+USE test2;
+SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+SHOW VARIABLES LIKE 'tx_isolation';
+SHOW VARIABLES LIKE 'falcon_consistent_read';
+START TRANSACTION;
+SELECT * FROM t1;
+INSERT INTO t1 VALUES (3,3);
+connection default;
+UPDATE t1 SET b = 33 WHERE a = 3;
+connection conn2;
+COMMIT;
+SELECT * FROM t1;
+
+connection conn2;
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SHOW VARIABLES LIKE 'tx_isolation';
+SHOW VARIABLES LIKE 'falcon_consistent_read';
+START TRANSACTION;
+SELECT * FROM t1;
+INSERT INTO t1 VALUES (4,4);
+connection default;
+UPDATE t1 SET b = 44 WHERE a = 4;
+connection conn2;
+COMMIT;
+SELECT * FROM t1;
+
+
+# Final cleanup
+connection default;
+disconnect conn1;
+disconnect conn2;
+DROP DATABASE test2;
+USE test;
diff -Nrup a/storage/falcon/ha_falcon.cpp b/storage/falcon/ha_falcon.cpp
--- a/storage/falcon/ha_falcon.cpp	2008-01-31 11:19:03 -06:00
+++ b/storage/falcon/ha_falcon.cpp	2008-01-31 16:48:05 -06:00
@@ -189,12 +189,15 @@ int StorageInterface::falcon_init(void *
 	falcon_hton->flags = HTON_NO_FLAGS;
 	storageHandler->addNfsLogger(falcon_debug_mask, StorageInterface::logger, NULL);
 
-	int repeatableRead = (falcon_consistent_read ? 
+	int newRepeatableRead = (falcon_consistent_read ? 
 		TRANSACTION_CONSISTENT_READ : TRANSACTION_WRITE_COMMITTED);
-	if (isolation_levels[2] != repeatableRead)
+	if (isolation_levels[ISO_REPEATABLE_READ] != newRepeatableRead)
+		{
+		int oldRepeatableRead = isolation_levels[ISO_REPEATABLE_READ];
 		for (int i = 0; i < 4; i++)
-			if ((i == 2) || (isolation_levels[i] == isolation_levels[2]))
-				isolation_levels[i] = repeatableRead;
+			if (isolation_levels[i] == oldRepeatableRead)
+				isolation_levels[i] = newRepeatableRead;
+		}
 
 	if (falcon_debug_server)
 		storageHandler->startNfsServer();
@@ -3036,10 +3039,13 @@ void StorageInterface::updateConsistentR
 	int newRepeatableRead = (falcon_consistent_read ? 
 		TRANSACTION_CONSISTENT_READ : TRANSACTION_WRITE_COMMITTED);
 
-	if (isolation_levels[2] != newRepeatableRead)
+	if (isolation_levels[ISO_REPEATABLE_READ] != newRepeatableRead)
+		{
+		int oldRepeatableRead = isolation_levels[ISO_REPEATABLE_READ];
 		for (int i = 0; i < 4; i++)
-			if ((i == 2) || (isolation_levels[i] == isolation_levels[2]))
+			if (isolation_levels[i] == oldRepeatableRead)
 				isolation_levels[i] = newRepeatableRead;
+		}
 }
 
 void StorageInterface::updateRecordMemoryMax(MYSQL_THD thd, struct st_mysql_sys_var* variable, void* var_ptr, void* save)
Thread
bk commit into 6.0 tree (klewis:1.2796) BUG#34164klewis31 Jan