List:Commits« Previous MessageNext Message »
From:Vladislav Vaintroub Date:February 22 2008 10:54pm
Subject:RE: bk commit into 6.0 tree (vvaintroub:1.2821) BUG#33041
View as plain text  
Kevin,
It is the first  connection-specific variable in Falcon, not the global one thus needs to
be defined as MYSQL_THDVAR_BOOL.
+static MYSQL_THDVAR_BOOL(consistent_read, PLUGIN_VAR_OPCMDARG,
+   "Enable Consistent Read Mode for Repeatable Reads",
+   NULL, NULL,1);

And it has *not* have the same effect as MYSQL_SYSVAR_BOOL , even if I set 0x0100==
PLUGIN_VAR_THDLOCAL flag for the variable, it will be lost due to logic mask in the
MYSQL_SYSVAR definition ( s. MYSQL_SYSVAR_BOOL and MYSQL_THDVAR_BOOL in plugin.h)

> Also, since SET GLOBAL FALCON_CONSISTENT_READ still works, you need to
> leave the code in
> 
> 	StorageInterface::falcon_init()
> and
> 	StorageInterface::updateConsistentRead()


SET GLOBAL FALCON_CONSISTENT_READ still works, *but* differently, i.e better.  It does
zero effect  for existing transactions, and used with current and newly created
connections only. I put together falcon_bug_33041.test to demonstrate this behavior.

As we always can get the value for current connection via THDVAR(consistent_read), there
is no reason to do own hooks for variable update and check
(I originally planned to implement check() hook to reject GLOBAL setting, but found that
GLOBAL is not passed)

Code that we had previously is can't be used  - it changed global variable
isolation_levels  and so made the parameter change visible to all current sessions
immediately. THDVAR(consistent_read) is evaluated in getTransactionIsolation(), that
remaps TRANSACTION_CONSISTENT_READ to TRANSACTION_WRITE_COMMITTED if necessary.


> How will you know if the value sent is GLOBAL or not?
As I said, OPT_GLOBAL is not passed down and knowing whether GLOBAL or not is *not*
possible.  
So I do not implement any set/check hooks and rely on the plugin API magic that always
returns me  correct per-connection value in THDVAR(consistent_read).
I also know, that startup parameter --falcon_consistent_read if used or default is in
falcon_consistent_read variable.

Vlad






> -----Original Message-----
> From: Kevin Lewis [mailto:klewis@stripped]
> Sent: Friday, February 22, 2008 8:44 PM
> To: commits@stripped; falcon-private@stripped
> Cc: 'Vladislav Vaintroub'
> Subject: RE: bk commit into 6.0 tree (vvaintroub:1.2821) BUG#33041
> 
> Vlad,
> 
> I do not understand why you took the parameter out of
> StorageParameters.h.  I think it has the same effect.
> 
> Also, since SET GLOBAL FALCON_CONSISTENT_READ still works, you need to
> leave the code in
> 
> 	StorageInterface::falcon_init()
> and
> 	StorageInterface::updateConsistentRead()
> 
> These functions change the default way that the Falcon engine applies a
> repeatable-read isolation.
> 
> How will you know if the value sent is GLOBAL or not?
> 
> 
> >-----Original Message-----
> >From: vvaintroub@stripped [mailto:vvaintroub@stripped]
> >Sent: Friday, February 22, 2008 9:22 AM
> >To: commits@stripped
> >Subject: bk commit into 6.0 tree (vvaintroub:1.2821) BUG#33041
> >
> >Below is the list of changes that have just been committed into a
> local
> >6.0 repository of vvaintroub. When vvaintroub 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-02-22 16:21:34+01:00, vvaintroub@wva. +25 -0
> >  Bug#33041 : cannot set FALCON_CONSISTENT_READ for local sessions.
> >
> >  Solution is to change the scope of the variable to be connection-
> specific
> >  such that SET FALCON_CONSISTENT_READ=<ON|OFF> modifies the setting
> >  only for current connection.
> >
> >  SET GLOBAL FALCON_CONSISTENT_READ still works, but it affects only
> >  current and new connections. Currently it is not possible to disable
> >  "SET GLOBAL" ,as plugin API does not provide possibility to define
> >  local-only scope.
> >
> >
> >  mysql-test/suite/falcon/r/falcon_bug_22185.result@stripped, 2008-02-22
> 16:21:20+01:00, vvaintroub@wva. +1 -1
> >    replace "set global falcon_consistent_read" with
> >    "set falcon_consistent_read"
> >
> >  mysql-test/suite/falcon/r/falcon_bug_22211.result@stripped, 2008-02-22
> 16:21:20+01:00, vvaintroub@wva. +19 -3
> >    replace "set global falcon_consistent_read" with
> >    "set falcon_consistent_read"
> >
> >  mysql-test/suite/falcon/r/falcon_bug_22212.result@stripped, 2008-02-22
> 16:21:21+01:00, vvaintroub@wva. +3 -1
> >    replace "set global falcon_consistent_read" with
> >    "set falcon_consistent_read"
> >
> >  mysql-test/suite/falcon/r/falcon_bug_22852.result@stripped, 2008-02-22
> 16:21:21+01:00, vvaintroub@wva. +2 -2
> >    replace "set global falcon_consistent_read" with
> >    "set falcon_consistent_read"
> >
> >  mysql-test/suite/falcon/r/falcon_bug_27722.result@stripped, 2008-02-22
> 16:21:22+01:00, vvaintroub@wva. +2 -2
> >    replace "set global falcon_consistent_read" with
> >    "set falcon_consistent_read"
> >
> >  mysql-test/suite/falcon/r/falcon_bug_29151.result@stripped, 2008-02-22
> 16:21:22+01:00, vvaintroub@wva. +3 -2
> >    replace "set global falcon_consistent_read" with
> >    "set falcon_consistent_read"
> >
> >  mysql-test/suite/falcon/r/falcon_bug_29151_A.result@stripped, 2008-02-22
> 16:21:23+01:00, vvaintroub@wva. +1 -1
> >    replace "set global falcon_consistent_read" with
> >    "set falcon_consistent_read"
> >
> >  mysql-test/suite/falcon/r/falcon_bug_29151_B.result@stripped, 2008-02-22
> 16:21:23+01:00, vvaintroub@wva. +3 -1
> >    replace "set global falcon_consistent_read" with
> >    "set falcon_consistent_read"
> >
> >  mysql-test/suite/falcon/r/falcon_bug_29151_C.result@stripped, 2008-02-22
> 16:21:24+01:00, vvaintroub@wva. +3 -2
> >    replace "set global falcon_consistent_read" with
> >    "set falcon_consistent_read"
> >
> >  mysql-test/suite/falcon/r/falcon_bug_33041.result@stripped, 2008-02-22
> 16:21:31+01:00, vvaintroub@wva. +38 -0
> >    test for Bug#33041 (scope of FALCON_CONSISTENT_READ)
> >
> >  mysql-test/suite/falcon/r/falcon_bug_33041.result@stripped, 2008-02-22
> 16:21:31+01:00, vvaintroub@wva. +0 -0
> >
> >  mysql-test/suite/falcon/r/falcon_bug_34164.result@stripped, 2008-02-22
> 16:21:24+01:00, vvaintroub@wva. +2 -0
> >    cleanup after potential change of falcon_consistent_read
> >
> >  mysql-test/suite/falcon/t/falcon_bug_22185.test@stripped, 2008-02-22
> 16:21:25+01:00, vvaintroub@wva. +1 -1
> >    replace "set global falcon_consistent_read" with
> >    "set falcon_consistent_read"
> >
> >  mysql-test/suite/falcon/t/falcon_bug_22211.test@stripped, 2008-02-22
> 16:21:25+01:00, vvaintroub@wva. +26 -3
> >    replace "set global falcon_consistent_read" with
> >    "set falcon_consistent_read"
> >
> >  mysql-test/suite/falcon/t/falcon_bug_22212.test@stripped, 2008-02-22
> 16:21:26+01:00, vvaintroub@wva. +3 -1
> >    replace "set global falcon_consistent_read" with
> >    "set falcon_consistent_read"
> >
> >  mysql-test/suite/falcon/t/falcon_bug_22852.test@stripped, 2008-02-22
> 16:21:26+01:00, vvaintroub@wva. +2 -2
> >    replace "set global falcon_consistent_read" with
> >    "set falcon_consistent_read"
> >
> >  mysql-test/suite/falcon/t/falcon_bug_27722.test@stripped, 2008-02-22
> 16:21:27+01:00, vvaintroub@wva. +2 -2
> >    replace "set global falcon_consistent_read" with
> >    "set falcon_consistent_read"
> >
> >  mysql-test/suite/falcon/t/falcon_bug_29151.test@stripped, 2008-02-22
> 16:21:27+01:00, vvaintroub@wva. +4 -2
> >    replace "set global falcon_consistent_read" with
> >    "set falcon_consistent_read"
> >
> >  mysql-test/suite/falcon/t/falcon_bug_29151_A.test@stripped, 2008-02-22
> 16:21:27+01:00, vvaintroub@wva. +1 -1
> >    replace "set global falcon_consistent_read" with
> >    "set falcon_consistent_read"
> >
> >  mysql-test/suite/falcon/t/falcon_bug_29151_B.test@stripped, 2008-02-22
> 16:21:28+01:00, vvaintroub@wva. +3 -1
> >    replace "set global falcon_consistent_read" with
> >    "set falcon_consistent_read"
> >
> >  mysql-test/suite/falcon/t/falcon_bug_29151_C.test@stripped, 2008-02-22
> 16:21:28+01:00, vvaintroub@wva. +3 -4
> >    replace "set global falcon_consistent_read" with
> >    "set falcon_consistent_read"
> >
> >  mysql-test/suite/falcon/t/falcon_bug_33041.test@stripped, 2008-02-22
> 16:21:31+01:00, vvaintroub@wva. +68 -0
> >    test for Bug#33041 (scope of FALCON_CONSISTENT_READ)
> >
> >  mysql-test/suite/falcon/t/falcon_bug_33041.test@stripped, 2008-02-22
> 16:21:31+01:00, vvaintroub@wva. +0 -0
> >
> >  mysql-test/suite/falcon/t/falcon_bug_34164.test@stripped, 2008-02-22
> 16:21:29+01:00, vvaintroub@wva. +2 -1
> >    replace "set global falcon_consistent_read" with
> >    "set falcon_consistent_read"
> >
> >  storage/falcon/StorageParameters.h@stripped, 2008-02-22 16:21:29+01:00,
> vvaintroub@wva. +0 -1
> >    consistent_read moved to ha_falcon.cpp (unlike other parameters,
> it has
> >    connection scope now)
> >
> >  storage/falcon/ha_falcon.cpp@stripped, 2008-02-22 16:21:30+01:00,
> vvaintroub@wva. +29 -29
> >    Change falcon_consistent_read to local(connection) scope.
> >
> >  storage/falcon/ha_falcon.h@stripped, 2008-02-22 16:21:30+01:00,
> vvaintroub@wva. +0 -2
> >    Remove obsolete function declaration
> >
> >diff -Nrup a/mysql-test/suite/falcon/r/falcon_bug_22185.result
> b/mysql-
> >test/suite/falcon/r/falcon_bug_22185.result
> >--- a/mysql-test/suite/falcon/r/falcon_bug_22185.result	2007-11-21
> 06:40:58 +01:00
> >+++ b/mysql-test/suite/falcon/r/falcon_bug_22185.result	2008-02-22
> 16:21:20 +01:00
> >@@ -1,7 +1,7 @@
> > *** Bug #22185 ***
> > SET @@storage_engine = Falcon;
> > SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
> >-SET GLOBAL FALCON_CONSISTENT_READ=ON;
> >+SET FALCON_CONSISTENT_READ=ON;
> > DROP TABLE IF EXISTS sbtest;
> > # Establish connection conn1 (user = root)
> > SET @@storage_engine = Falcon;
> >diff -Nrup a/mysql-test/suite/falcon/r/falcon_bug_22211.result
> b/mysql-
> >test/suite/falcon/r/falcon_bug_22211.result
> >--- a/mysql-test/suite/falcon/r/falcon_bug_22211.result	2007-11-21
> 06:38:31 +01:00
> >+++ b/mysql-test/suite/falcon/r/falcon_bug_22211.result	2008-02-22
> 16:21:20 +01:00
> >@@ -1,19 +1,21 @@
> > *** Bug #263 ***
> > SET storage_engine = Falcon;
> >-SET GLOBAL FALCON_CONSISTENT_READ=ON;
> > DROP TABLE IF EXISTS t1;
> > # Establish connection 1 (REPEATABLE READ)
> > SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
> >+SET FALCON_CONSISTENT_READ=ON;
> > select @@TX_ISOLATION;
> > @@TX_ISOLATION
> > REPEATABLE-READ
> > # Establish connection 2 (READ COMMITTED)
> > SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
> >+SET FALCON_CONSISTENT_READ=ON;
> > select @@TX_ISOLATION;
> > @@TX_ISOLATION
> > READ-COMMITTED
> > # Switch to connection default (REPEATABLE READ)
> > SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
> >+SET FALCON_CONSISTENT_READ=ON;
> > select @@TX_ISOLATION;
> > @@TX_ISOLATION
> > REPEATABLE-READ
> >@@ -115,7 +117,14 @@ INSERT INTO t1 VALUES (0);
> > ############################################################
> > # #3 - client 2 (with InnoDB Compatibility) does not block on a
> vestigial record
> > ############################################################
> >-SET GLOBAL FALCON_CONSISTENT_READ=OFF;
> >+# Set consistent read=off for all connections
> >+# default
> >+SET  FALCON_CONSISTENT_READ=OFF;
> >+#conn1
> >+SET  FALCON_CONSISTENT_READ=OFF;
> >+#conn2
> >+SET  FALCON_CONSISTENT_READ=OFF;
> >+#back to default
> > START TRANSACTION;
> > UPDATE t1 SET a = 10;
> > SELECT * FROM t1;
> >@@ -146,7 +155,14 @@ a
> > # Switch to connection default (REPEATABLE READ)
> > DELETE FROM t1;
> > INSERT INTO t1 VALUES (0);
> >-SET GLOBAL FALCON_CONSISTENT_READ=ON;
> >+# Set consistent read=on for all connections
> >+# default
> >+SET  FALCON_CONSISTENT_READ=ON;
> >+# conn1
> >+SET  FALCON_CONSISTENT_READ=ON;
> >+# conn2
> >+SET  FALCON_CONSISTENT_READ=ON;
> >+#back to default
> > ############################################################
> > # #4 - make sure client 2 does not block on a vestigial records
> > # that were never committed.
> >diff -Nrup a/mysql-test/suite/falcon/r/falcon_bug_22212.result
> b/mysql-
> >test/suite/falcon/r/falcon_bug_22212.result
> >--- a/mysql-test/suite/falcon/r/falcon_bug_22212.result	2007-11-21
> 06:38:33 +01:00
> >+++ b/mysql-test/suite/falcon/r/falcon_bug_22212.result	2008-02-22
> 16:21:21 +01:00
> >@@ -1,15 +1,17 @@
> > #---- Bug #22212 (Mantis #264) ----
> > SET @@storage_engine = Falcon;
> > SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
> >-SET GLOBAL FALCON_CONSISTENT_READ=ON;
> >+SET FALCON_CONSISTENT_READ=ON;
> > # Initialization
> > DROP TABLE IF EXISTS t1;
> > CREATE TABLE t1 (id INTEGER, x CHAR(20)) ENGINE=Falcon;
> > INSERT INTO t1 VALUES(0, 'Initialized');
> > COMMIT;
> > # Establish connection con1 (user=root)
> >+SET FALCON_CONSISTENT_READ=ON;
> > SET AUTOCOMMIT = 0;
> > # Establish connection con2 (user=root)
> >+SET FALCON_CONSISTENT_READ=ON;
> > SET AUTOCOMMIT = 0;
> > # Switch to connection con1
> > UPDATE t1 SET x = 'Update by con1' WHERE id = 0;
> >diff -Nrup a/mysql-test/suite/falcon/r/falcon_bug_22852.result
> b/mysql-
> >test/suite/falcon/r/falcon_bug_22852.result
> >--- a/mysql-test/suite/falcon/r/falcon_bug_22852.result	2007-11-21
> 06:38:34 +01:00
> >+++ b/mysql-test/suite/falcon/r/falcon_bug_22852.result	2008-02-22
> 16:21:21 +01:00
> >@@ -2,12 +2,13 @@
> > SET storage_engine = Falcon;
> > SET @@autocommit = 0;
> > SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
> >-SET GLOBAL FALCON_CONSISTENT_READ=OFF;
> >+SET FALCON_CONSISTENT_READ=OFF;
> > DROP TABLE IF EXISTS t1;
> > DROP PROCEDURE IF EXISTS p1;
> > # Establish connection conn1 (user = root)
> > SET storage_engine = Falcon;
> > SET @@autocommit = 0;
> >+SET FALCON_CONSISTENT_READ=OFF;
> > # Switch to connection default
> > CREATE TABLE t1 (
> > a binary(1) NOT NULL,
> >@@ -41,4 +42,3 @@ count(*)
> > COMMIT;
> > DROP TABLE t1;
> > DROP PROCEDURE p1;
> >-SET GLOBAL FALCON_CONSISTENT_READ=ON;
> >diff -Nrup a/mysql-test/suite/falcon/r/falcon_bug_27722.result
> b/mysql-
> >test/suite/falcon/r/falcon_bug_27722.result
> >--- a/mysql-test/suite/falcon/r/falcon_bug_27722.result	2007-11-21
> 06:38:36 +01:00
> >+++ b/mysql-test/suite/falcon/r/falcon_bug_27722.result	2008-02-22
> 16:21:22 +01:00
> >@@ -1,6 +1,6 @@
> > *** Bug #27722 ***
> > SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
> >-SET GLOBAL FALCON_CONSISTENT_READ=OFF;
> >+SET FALCON_CONSISTENT_READ=OFF;
> > SET @@storage_engine = Falcon;
> > SET @@autocommit = 0;
> > DROP TABLE IF EXISTS t1;
> >@@ -10,6 +10,7 @@ INSERT INTO t1 VALUES (5);
> > INSERT INTO t1 VALUES (10);
> > INSERT INTO t1 VALUES (15);
> > # Establish connection conn1
> >+SET FALCON_CONSISTENT_READ=OFF;
> > SET @@storage_engine = Falcon;
> > SET @@autocommit = 0;
> > # Switch to connection default
> >@@ -30,4 +31,3 @@ a
> > 16
> > # Switch to connection default
> > DROP TABLE t1;
> >-SET GLOBAL FALCON_CONSISTENT_READ=ON;
> >diff -Nrup a/mysql-test/suite/falcon/r/falcon_bug_29151.result
> b/mysql-
> >test/suite/falcon/r/falcon_bug_29151.result
> >--- a/mysql-test/suite/falcon/r/falcon_bug_29151.result	2007-12-07
> 21:28:44 +01:00
> >+++ b/mysql-test/suite/falcon/r/falcon_bug_29151.result	2008-02-22
> 16:21:22 +01:00
> >@@ -1,6 +1,6 @@
> > *** Bug #29151 ***
> > SET @@storage_engine = 'Falcon';
> >-SET GLOBAL falcon_consistent_read = off;
> >+SET falcon_consistent_read = off;
> > DROP TABLE IF EXISTS t1;
> > CREATE TABLE t1 (
> > a int,
> >@@ -12,10 +12,12 @@ PRIMARY KEY (a)
> > SET storage_engine = 'Falcon';
> > SET @@tx_isolation = 'REPEATABLE-READ';
> > SET @@autocommit = 0;
> >+SET falcon_consistent_read = off;
> > # Establish connection conn2
> > SET storage_engine = 'Falcon';
> > SET @@tx_isolation = 'REPEATABLE-READ';
> > SET @@autocommit = 0;
> >+SET falcon_consistent_read = off;
> > INSERT INTO t1 VALUES(49990, 0, 'c1');
> > COMMIT;
> > # Switch to connection conn1
> >@@ -41,4 +43,3 @@ a	b	c
> > COMMIT;
> > # Switch to connection default
> > DROP TABLE t1;
> >-SET GLOBAL falcon_consistent_read = on;
> >diff -Nrup a/mysql-test/suite/falcon/r/falcon_bug_29151_A.result
> b/mysql-
> >test/suite/falcon/r/falcon_bug_29151_A.result
> >--- a/mysql-test/suite/falcon/r/falcon_bug_29151_A.result	2007-12-07
> 21:28:44 +01:00
> >+++ b/mysql-test/suite/falcon/r/falcon_bug_29151_A.result	2008-02-22
> 16:21:23 +01:00
> >@@ -1,6 +1,6 @@
> > *** Bug #29151 ***
> > SET @@storage_engine = Falcon;
> >-SET GLOBAL falcon_consistent_read = on;
> >+SET falcon_consistent_read = on;
> > DROP TABLE IF EXISTS t1;
> > CREATE TABLE t1 (a int, b int, c char(10), PRIMARY KEY (a));
> > # Establish connection conn1
> >diff -Nrup a/mysql-test/suite/falcon/r/falcon_bug_29151_B.result
> b/mysql-
> >test/suite/falcon/r/falcon_bug_29151_B.result
> >--- a/mysql-test/suite/falcon/r/falcon_bug_29151_B.result	2007-12-07
> 21:28:44 +01:00
> >+++ b/mysql-test/suite/falcon/r/falcon_bug_29151_B.result	2008-02-22
> 16:21:23 +01:00
> >@@ -1,12 +1,13 @@
> > *** Bug #29151 ***
> > SET @@storage_engine = Falcon;
> >-SET GLOBAL falcon_consistent_read = on;
> >+SET falcon_consistent_read = on;
> > DROP TABLE IF EXISTS t1;
> > CREATE TABLE t1 (a int, b int, c char(10), PRIMARY KEY (a));
> > # Establish connection conn1
> > # Establish connection conn2
> > INSERT INTO t1 VALUES(490, 0, 'inserted');
> > # Switch to connection conn1
> >+SET falcon_consistent_read = on;
> > BEGIN;
> > UPDATE t1 SET c = 'updated' WHERE a = 490;
> > DELETE FROM t1 WHERE a = 490;
> >@@ -15,6 +16,7 @@ SELECT * FROM t1;
> > a	b	c
> > 490	1	inserted
> > # Switch to connection conn2
> >+SET falcon_consistent_read = on;
> > BEGIN;
> > SELECT * FROM t1;
> > a	b	c
> >diff -Nrup a/mysql-test/suite/falcon/r/falcon_bug_29151_C.result
> b/mysql-
> >test/suite/falcon/r/falcon_bug_29151_C.result
> >--- a/mysql-test/suite/falcon/r/falcon_bug_29151_C.result	2007-12-07
> 21:28:44 +01:00
> >+++ b/mysql-test/suite/falcon/r/falcon_bug_29151_C.result	2008-02-22
> 16:21:24 +01:00
> >@@ -1,11 +1,13 @@
> > *** Bug #29151 ***
> > *** Initialization for 'InnoDB Compatibility Mode'
> > SET @@storage_engine = Falcon;
> >-SET GLOBAL falcon_consistent_read = off;
> >+SET falcon_consistent_read = off;
> > DROP TABLE IF EXISTS t1;
> > CREATE TABLE t1 (a int, b int, c char(10), PRIMARY KEY (a));
> > # Establish connection conn1
> >+SET falcon_consistent_read = off;
> > # Establish connection conn2
> >+SET falcon_consistent_read = off;
> > INSERT INTO t1 VALUES(490, 0, 'inserted');
> > *** Test if an UPDATE will get the new record after waiting
> > # Switch to connection conn1
> >@@ -90,4 +92,3 @@ a	b	c
> > 490	5	inserted
> > # Switch to connection default
> > DROP TABLE t1;
> >-SET GLOBAL falcon_consistent_read = on;
> >diff -Nrup a/mysql-test/suite/falcon/r/falcon_bug_33041.result
> b/mysql-
> >test/suite/falcon/r/falcon_bug_33041.result
> >--- /dev/null	Wed Dec 31 16:00:00 196900
> >+++ b/mysql-test/suite/falcon/r/falcon_bug_33041.result	2008-02-22
> 16:21:31 +01:00
> >@@ -0,0 +1,38 @@
> >+*** Bug#33041 ***
> >+SET @@storage_engine = 'Falcon';
> >+SELECT @@GLOBAL.falcon_consistent_read INTO
> @previous_falcon_consistent_read;
> >+SET GLOBAL falcon_consistent_read = OFF;
> >+#connect (conn1,localhost,root,,);
> >+#connection conn1;
> >+SET falcon_consistent_read = on;
> >+#check that it worked
> >+show variables like 'falcon_consistent_read';
> >+Variable_name	Value
> >+falcon_consistent_read	ON
> >+#verify local setting for conn1 does not affect other connections
> >+#connection conn2;
> >+show variables like 'falcon_consistent_read';
> >+Variable_name	Value
> >+falcon_consistent_read	OFF
> >+#connection conn1;
> >+#verify that local setting does NOT affect global value
> >+SELECT @@GLOBAL.falcon_consistent_read;
> >+@@GLOBAL.falcon_consistent_read
> >+0
> >+#change global setting and verify it worked
> >+SET global falcon_consistent_read = on;
> >+SELECT @@GLOBAL.falcon_consistent_read;
> >+@@GLOBAL.falcon_consistent_read
> >+1
> >+#check that "set global" does  NOT affect existing connections
> >+#connection conn2;
> >+show variables like 'falcon_consistent_read';
> >+Variable_name	Value
> >+falcon_consistent_read	OFF
> >+#check that "set global" DOES  affect new connection
> >+connect (conn3,localhost,root,,);
> >+show variables like 'falcon_consistent_read';
> >+Variable_name	Value
> >+falcon_consistent_read	ON
> >+SET @@GLOBAL.falcon_consistent_read =
> @previous_falcon_consistent_read;
> >+
> >diff -Nrup a/mysql-test/suite/falcon/r/falcon_bug_34164.result
> b/mysql-
> >test/suite/falcon/r/falcon_bug_34164.result
> >--- a/mysql-test/suite/falcon/r/falcon_bug_34164.result	2008-02-05
> 08:05:28 +01:00
> >+++ b/mysql-test/suite/falcon/r/falcon_bug_34164.result	2008-02-22
> 16:21:24 +01:00
> >@@ -1,6 +1,7 @@
> > *** Bug #34164 ***
> > SET @@storage_engine = 'Falcon';
> > DROP DATABASE IF EXISTS test2;
> >+SELECT @@GLOBAL.falcon_consistent_read INTO
> @previous_falcon_consistent_read;
> > SET GLOBAL FALCON_CONSISTENT_READ=OFF;
> > CREATE DATABASE test2;
> > USE test2;
> >@@ -209,4 +210,5 @@ a	b
> > 4	44
> > # Switch to default connection and cleanup other connections
> > DROP DATABASE test2;
> >+SET GLOBAL falcon_consistent_read = @previous_falcon_consistent_read;
> > USE test;
> >diff -Nrup a/mysql-test/suite/falcon/t/falcon_bug_22185.test b/mysql-
> test/suite/falcon/t/falcon_bug_22185.test
> >--- a/mysql-test/suite/falcon/t/falcon_bug_22185.test	2007-11-21
> 06:38:40 +01:00
> >+++ b/mysql-test/suite/falcon/t/falcon_bug_22185.test	2008-02-22
> 16:21:25 +01:00
> >@@ -7,7 +7,7 @@
> >
> > SET @@storage_engine = Falcon;
> > SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
> >-SET GLOBAL FALCON_CONSISTENT_READ=ON;
> >+SET FALCON_CONSISTENT_READ=ON;
> >
> > --disable_warnings
> > DROP TABLE IF EXISTS sbtest;
> >diff -Nrup a/mysql-test/suite/falcon/t/falcon_bug_22211.test b/mysql-
> test/suite/falcon/t/falcon_bug_22211.test
> >--- a/mysql-test/suite/falcon/t/falcon_bug_22211.test	2007-11-21
> 06:38:42 +01:00
> >+++ b/mysql-test/suite/falcon/t/falcon_bug_22211.test	2008-02-22
> 16:21:25 +01:00
> >@@ -7,7 +7,6 @@
> > --echo *** Bug #263 ***
> >
> > SET storage_engine = Falcon;
> >-SET GLOBAL FALCON_CONSISTENT_READ=ON;
> >
> > --disable_warnings
> > DROP TABLE IF EXISTS t1;
> >@@ -16,16 +15,19 @@ DROP TABLE IF EXISTS t1;
> > --echo # Establish connection 1 (REPEATABLE READ)
> > connect (conn1,localhost,root,,);
> > SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
> >+SET FALCON_CONSISTENT_READ=ON;
> > select @@TX_ISOLATION;
> >
> > --echo # Establish connection 2 (READ COMMITTED)
> > connect (conn2,localhost,root,,);
> > SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
> >+SET FALCON_CONSISTENT_READ=ON;
> > select @@TX_ISOLATION;
> >
> > --echo # Switch to connection default (REPEATABLE READ)
> > connection default;
> > SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
> >+SET FALCON_CONSISTENT_READ=ON;
> > select @@TX_ISOLATION;
> > CREATE TABLE t1 (a int, primary key (a)) ENGINE=falcon;
> > INSERT INTO t1 VALUES (0);
> >@@ -110,7 +112,18 @@ INSERT INTO t1 VALUES (0);
> > --echo ############################################################
> > --echo # #3 - client 2 (with InnoDB Compatibility) does not block on
> a vestigial record
> > --echo ############################################################
> >-SET GLOBAL FALCON_CONSISTENT_READ=OFF;
> >+--echo # Set consistent read=off for all connections
> >+--echo # default
> >+SET  FALCON_CONSISTENT_READ=OFF;
> >+--echo #conn1
> >+connection conn1;
> >+SET  FALCON_CONSISTENT_READ=OFF;
> >+--echo #conn2
> >+connection conn2;
> >+SET  FALCON_CONSISTENT_READ=OFF;
> >+--echo #back to default
> >+connection default;
> >+
> > START TRANSACTION;
> > UPDATE t1 SET a = 10;
> > SELECT * FROM t1;
> >@@ -134,7 +147,17 @@ SELECT * FROM t1;
> > connection default;
> > DELETE FROM t1;
> > INSERT INTO t1 VALUES (0);
> >-SET GLOBAL FALCON_CONSISTENT_READ=ON;
> >+--echo # Set consistent read=on for all connections
> >+--echo # default
> >+SET  FALCON_CONSISTENT_READ=ON;
> >+--echo # conn1
> >+connection conn1;
> >+SET  FALCON_CONSISTENT_READ=ON;
> >+--echo # conn2
> >+connection conn2;
> >+SET  FALCON_CONSISTENT_READ=ON;
> >+--echo #back to default
> >+connection default;
> >
> > --echo ############################################################
> > --echo # #4 - make sure client 2 does not block on a vestigial
> records
> >diff -Nrup a/mysql-test/suite/falcon/t/falcon_bug_22212.test b/mysql-
> test/suite/falcon/t/falcon_bug_22212.test
> >--- a/mysql-test/suite/falcon/t/falcon_bug_22212.test	2007-11-21
> 06:38:43 +01:00
> >+++ b/mysql-test/suite/falcon/t/falcon_bug_22212.test	2008-02-22
> 16:21:26 +01:00
> >@@ -19,7 +19,7 @@
> >
> > SET @@storage_engine = Falcon;
> > SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
> >-SET GLOBAL FALCON_CONSISTENT_READ=ON;
> >+SET FALCON_CONSISTENT_READ=ON;
> >
> > --echo # Initialization
> > --disable_warnings
> >@@ -32,10 +32,12 @@ COMMIT;
> >
> > --echo # Establish connection con1 (user=root)
> > connect (con1,localhost,root,,);
> >+SET FALCON_CONSISTENT_READ=ON;
> > SET AUTOCOMMIT = 0;
> >
> > --echo # Establish connection con2 (user=root)
> > connect (con2,localhost,root,,);
> >+SET FALCON_CONSISTENT_READ=ON;
> > SET AUTOCOMMIT = 0;
> >
> > --echo # Switch to connection con1
> >diff -Nrup a/mysql-test/suite/falcon/t/falcon_bug_22852.test b/mysql-
> test/suite/falcon/t/falcon_bug_22852.test
> >--- a/mysql-test/suite/falcon/t/falcon_bug_22852.test	2007-11-21
> 06:38:45 +01:00
> >+++ b/mysql-test/suite/falcon/t/falcon_bug_22852.test	2008-02-22
> 16:21:26 +01:00
> >@@ -8,7 +8,7 @@
> > SET storage_engine = Falcon;
> > SET @@autocommit = 0;
> > SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
> >-SET GLOBAL FALCON_CONSISTENT_READ=OFF;
> >+SET FALCON_CONSISTENT_READ=OFF;
> >
> > --disable_warnings
> > DROP TABLE IF EXISTS t1;
> >@@ -19,6 +19,7 @@ DROP PROCEDURE IF EXISTS p1;
> > connect (conn1,localhost,root,,);
> > SET storage_engine = Falcon;
> > SET @@autocommit = 0;
> >+SET FALCON_CONSISTENT_READ=OFF;
> >
> > --echo # Switch to connection default
> > connection default;
> >@@ -69,4 +70,3 @@ COMMIT;
> > disconnect conn1;
> > DROP TABLE t1;
> > DROP PROCEDURE p1;
> >-SET GLOBAL FALCON_CONSISTENT_READ=ON;
> >diff -Nrup a/mysql-test/suite/falcon/t/falcon_bug_27722.test b/mysql-
> test/suite/falcon/t/falcon_bug_27722.test
> >--- a/mysql-test/suite/falcon/t/falcon_bug_27722.test	2007-11-21
> 06:38:47 +01:00
> >+++ b/mysql-test/suite/falcon/t/falcon_bug_27722.test	2008-02-22
> 16:21:27 +01:00
> >@@ -10,7 +10,7 @@
> > # --- Initialisation                                --- #
> > # ----------------------------------------------------- #
> > SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
> >-SET GLOBAL FALCON_CONSISTENT_READ=OFF;
> >+SET FALCON_CONSISTENT_READ=OFF;
> > SET @@storage_engine = Falcon;
> > SET @@autocommit = 0;
> >
> >@@ -27,6 +27,7 @@ INSERT INTO t1 VALUES (15);
> >
> > --echo # Establish connection conn1
> > connect (conn1,localhost,root,,);
> >+SET FALCON_CONSISTENT_READ=OFF;
> > SET @@storage_engine = Falcon;
> > SET @@autocommit = 0;
> >
> >@@ -64,4 +65,3 @@ SELECT * FROM t1;
> > connection default;
> > disconnect conn1;
> > DROP TABLE t1;
> >-SET GLOBAL FALCON_CONSISTENT_READ=ON;
> >diff -Nrup a/mysql-test/suite/falcon/t/falcon_bug_29151.test b/mysql-
> test/suite/falcon/t/falcon_bug_29151.test
> >--- a/mysql-test/suite/falcon/t/falcon_bug_29151.test	2007-12-07
> 21:28:44 +01:00
> >+++ b/mysql-test/suite/falcon/t/falcon_bug_29151.test	2008-02-22
> 16:21:27 +01:00
> >@@ -9,7 +9,7 @@
> > # ----------------------------------------------------- #
> > let $engine = 'Falcon';
> > eval SET @@storage_engine = $engine;
> >-SET GLOBAL falcon_consistent_read = off;
> >+SET falcon_consistent_read = off;
> >
> > --disable_warnings
> > DROP TABLE IF EXISTS t1;
> >@@ -29,12 +29,14 @@ connect (conn1,localhost,root,,);
> > eval SET storage_engine = $engine;
> > SET @@tx_isolation = 'REPEATABLE-READ';
> > SET @@autocommit = 0;
> >+SET falcon_consistent_read = off;
> >
> > --echo # Establish connection conn2
> > connect (conn2,localhost,root,,);
> > eval SET storage_engine = $engine;
> > SET @@tx_isolation = 'REPEATABLE-READ';
> > SET @@autocommit = 0;
> >+SET falcon_consistent_read = off;
> >
> > INSERT INTO t1 VALUES(49990, 0, 'c1');
> > COMMIT;
> >@@ -83,4 +85,4 @@ connection default;
> > disconnect conn1;
> > disconnect conn2;
> > DROP TABLE t1;
> >-SET GLOBAL falcon_consistent_read = on;
> >+
> >diff -Nrup a/mysql-test/suite/falcon/t/falcon_bug_29151_A.test
> b/mysql-
> >test/suite/falcon/t/falcon_bug_29151_A.test
> >--- a/mysql-test/suite/falcon/t/falcon_bug_29151_A.test	2007-12-07
> 21:28:44 +01:00
> >+++ b/mysql-test/suite/falcon/t/falcon_bug_29151_A.test	2008-02-22
> 16:21:27 +01:00
> >@@ -11,7 +11,7 @@
> > # --- Initialization for Falcon's Consistent Read
> > # -----------------------------------------------------
> > SET @@storage_engine = Falcon;
> >-SET GLOBAL falcon_consistent_read = on;
> >+SET falcon_consistent_read = on;
> >
> > --disable_warnings
> > DROP TABLE IF EXISTS t1;
> >diff -Nrup a/mysql-test/suite/falcon/t/falcon_bug_29151_B.test
> b/mysql-
> >test/suite/falcon/t/falcon_bug_29151_B.test
> >--- a/mysql-test/suite/falcon/t/falcon_bug_29151_B.test	2007-12-07
> 21:28:44 +01:00
> >+++ b/mysql-test/suite/falcon/t/falcon_bug_29151_B.test	2008-02-22
> 16:21:28 +01:00
> >@@ -11,7 +11,7 @@
> > # --- Initialization for Falcon's Consistent Read
> > # -----------------------------------------------------
> > eval SET @@storage_engine = Falcon;
> >-SET GLOBAL falcon_consistent_read = on;
> >+SET falcon_consistent_read = on;
> >
> > --disable_warnings
> > DROP TABLE IF EXISTS t1;
> >@@ -33,6 +33,7 @@ INSERT INTO t1 VALUES(490, 0, 'inserted'
> > # -------------------------------------------------------------------
> > --echo # Switch to connection conn1
> > connection conn1;
> >+SET falcon_consistent_read = on;
> > BEGIN;
> > UPDATE t1 SET c = 'updated' WHERE a = 490;
> > DELETE FROM t1 WHERE a = 490;
> >@@ -41,6 +42,7 @@ SELECT * FROM t1;
> >
> > --echo # Switch to connection conn2
> > connection conn2;
> >+SET falcon_consistent_read = on;
> > BEGIN;
> > SELECT * FROM t1;
> > # This one blocks in case the other transaction aborts.
> >diff -Nrup a/mysql-test/suite/falcon/t/falcon_bug_29151_C.test
> b/mysql-
> >test/suite/falcon/t/falcon_bug_29151_C.test
> >--- a/mysql-test/suite/falcon/t/falcon_bug_29151_C.test	2007-12-07
> 21:28:44 +01:00
> >+++ b/mysql-test/suite/falcon/t/falcon_bug_29151_C.test	2008-02-22
> 16:21:28 +01:00
> >@@ -10,7 +10,7 @@
> > --echo *** Initialization for 'InnoDB Compatibility Mode'
> > # -----------------------------------------------------
> > SET @@storage_engine = Falcon;
> >-SET GLOBAL falcon_consistent_read = off;
> >+SET falcon_consistent_read = off;
> >
> > --disable_warnings
> > DROP TABLE IF EXISTS t1;
> >@@ -18,13 +18,13 @@ DROP TABLE IF EXISTS t1;
> >
> > CREATE TABLE t1 (a int, b int, c char(10), PRIMARY KEY (a));
> >
> >-# We need to set up an exlipicit connection here,
> >-# as SET GLOBAL does not set the current connection's setting.
> > --echo # Establish connection conn1
> > connect (conn1,localhost,root,,);
> >+SET falcon_consistent_read = off;
> >
> > --echo # Establish connection conn2
> > connect (conn2,localhost,root,,);
> >+SET falcon_consistent_read = off;
> > INSERT INTO t1 VALUES(490, 0, 'inserted');
> >
> > # -------------------------------------------------------
> >@@ -129,4 +129,3 @@ connection default;
> > disconnect conn1;
> > disconnect conn2;
> > DROP TABLE t1;
> >-SET GLOBAL falcon_consistent_read = on;
> >diff -Nrup a/mysql-test/suite/falcon/t/falcon_bug_33041.test b/mysql-
> test/suite/falcon/t/falcon_bug_33041.test
> >--- /dev/null	Wed Dec 31 16:00:00 196900
> >+++ b/mysql-test/suite/falcon/t/falcon_bug_33041.test	2008-02-22
> 16:21:31 +01:00
> >@@ -0,0 +1,68 @@
> >+#
> >+# Bug#33041: Cannot set FALCON_CONSISTENT_READ for local session
> >+#
> >+# The test tests the scope of falcon_consistent_read variable
> >+# the scope is "both" meaning per-connection and global.
> >+# 1) new connections get the global value of falcon_consistent_read
> >+# 2) existing connections are not affected by "set global
> falcon_consistent_read"
> >+# 3) within connection it is possible to change
> falcon_consistent_read with
> >+#   "set falcon_consistent_read" and the change does not affect
> existing connections
> >+#
> >+--echo *** Bug#33041 ***
> >+
> >+# ----------------------------------------------------- #
> >+# --- Initialisation                                --- #
> >+# ----------------------------------------------------- #
> >+let $engine = 'Falcon';
> >+eval SET @@storage_engine = $engine;
> >+SELECT @@GLOBAL.falcon_consistent_read INTO
> @previous_falcon_consistent_read;
> >+
> >+SET GLOBAL falcon_consistent_read = OFF;
> >+# ----------------------------------------------------- #
> >+# --- Test                                          --- #
> >+# ----------------------------------------------------- #
> >+--echo #connect (conn1,localhost,root,,);
> >+connect (conn1,localhost,root,,);
> >+
> >+#--echo #connect (conn2,localhost,root,,);
> >+connect (conn2,localhost,root,,);
> >+
> >+--echo #connection conn1;
> >+connection conn1;
> >+SET falcon_consistent_read = on;
> >+--echo #check that it worked
> >+show variables like 'falcon_consistent_read';
> >+
> >+
> >+--echo #verify local setting for conn1 does not affect other
> connections
> >+--echo #connection conn2;
> >+connection conn2;
> >+show variables like 'falcon_consistent_read';
> >+--echo #connection conn1;
> >+connection conn1;
> >+
> >+--echo #verify that local setting does NOT affect global value
> >+SELECT @@GLOBAL.falcon_consistent_read;
> >+--echo #change global setting and verify it worked
> >+SET global falcon_consistent_read = on;
> >+SELECT @@GLOBAL.falcon_consistent_read;
> >+
> >+
> >+--echo #check that "set global" does  NOT affect existing connections
> >+--echo #connection conn2;
> >+connection conn2;
> >+show variables like 'falcon_consistent_read';
> >+
> >+--echo #check that "set global" DOES  affect new connection
> >+--echo connect (conn3,localhost,root,,);
> >+connect (conn3,localhost,root,,);
> >+show variables like 'falcon_consistent_read';
> >+
> >+
> >+# Final cleanup.
> >+connection default;
> >+disconnect conn1;
> >+disconnect conn2;
> >+disconnect conn3;
> >+SET @@GLOBAL.falcon_consistent_read =
> @previous_falcon_consistent_read;
> >+
> >diff -Nrup a/mysql-test/suite/falcon/t/falcon_bug_34164.test b/mysql-
> test/suite/falcon/t/falcon_bug_34164.test
> >--- a/mysql-test/suite/falcon/t/falcon_bug_34164.test	2008-02-05
> 08:05:35 +01:00
> >+++ b/mysql-test/suite/falcon/t/falcon_bug_34164.test	2008-02-22
> 16:21:29 +01:00
> >@@ -18,7 +18,7 @@ DROP DATABASE IF EXISTS test2;
> > # ----------------------------------------------------- #
> > # --- Test                                          --- #
> > # ----------------------------------------------------- #
> >-
> >+SELECT @@GLOBAL.falcon_consistent_read INTO
> @previous_falcon_consistent_read;
> > SET GLOBAL FALCON_CONSISTENT_READ=OFF;
> > CREATE DATABASE test2;
> > USE test2;
> >@@ -183,6 +183,7 @@ disconnect conn2;
> > disconnect conn3;
> > disconnect conn4;
> > DROP DATABASE test2;
> >+SET GLOBAL falcon_consistent_read = @previous_falcon_consistent_read;
> > USE test;
> >
> >
> >diff -Nrup a/storage/falcon/StorageParameters.h
> b/storage/falcon/StorageParameters.h
> >--- a/storage/falcon/StorageParameters.h	2008-01-09 20:24:19
> +01:00
> >+++ b/storage/falcon/StorageParameters.h	2008-02-22 16:21:29
> +01:00
> >@@ -12,7 +12,6 @@
> > // #define PLUGIN_VAR_MEMALLOC     0x8000 = String needs memory
> allocated
> >
> >
> >-PARAMETER_BOOL(consistent_read, "Enable Consistent Read Mode for
> Repeatable Reads", 1, 0,
> >StorageInterface::updateConsistentRead)
> > PARAMETER_UINT(debug_mask, "Falcon message type mask for logged
> messages.", 0, 0, INT_MAX, 0,
> >StorageInterface::updateDebugMask)
> > PARAMETER_BOOL(debug_server, "Enable Falcon debug code.", 0, 0x0200,
> NULL)
> > PARAMETER_UINT(debug_trace, "Falcon debug trace trigger.", 0, 0,
> INT_MAX, 0, NULL)
> >diff -Nrup a/storage/falcon/ha_falcon.cpp
> b/storage/falcon/ha_falcon.cpp
> >--- a/storage/falcon/ha_falcon.cpp	2008-02-06 18:38:23 +01:00
> >+++ b/storage/falcon/ha_falcon.cpp	2008-02-22 16:21:30 +01:00
> >@@ -113,6 +113,7 @@ static struct st_mysql_show_var falconSt
> > };
> >
> > extern THD*		current_thd;
> >+static int getTransactionIsolation( THD * thd);
> >
> > static handler *falcon_create_handler(handlerton *hton,
> >                                       TABLE_SHARE *table, MEM_ROOT
> *mem_root)
> >@@ -190,16 +191,6 @@ int StorageInterface::falcon_init(void *
> > 	falcon_hton->flags = HTON_NO_FLAGS;
> > 	storageHandler->addNfsLogger(falcon_debug_mask,
> StorageInterface::logger, NULL);
> >
> >-	int newRepeatableRead = (falcon_consistent_read ?
> >-		TRANSACTION_CONSISTENT_READ : TRANSACTION_WRITE_COMMITTED);
> >-	if (isolation_levels[ISO_REPEATABLE_READ] != newRepeatableRead)
> >-		{
> >-		int oldRepeatableRead =
> isolation_levels[ISO_REPEATABLE_READ];
> >-		for (int i = 0; i < 4; i++)
> >-			if (isolation_levels[i] == oldRepeatableRead)
> >-				isolation_levels[i] = newRepeatableRead;
> >-		}
> >-
> > 	if (falcon_debug_server)
> > 		storageHandler->startNfsServer();
> >
> >@@ -1002,6 +993,7 @@ uint StorageInterface::max_supported_key
> > 	DBUG_RETURN(MAX_KEY);
> > }
> >
> >+
> > int StorageInterface::write_row(uchar *buff)
> > {
> > 	DBUG_ENTER("StorageInterface::write_row");
> >@@ -1050,7 +1042,7 @@ int StorageInterface::write_row(uchar *b
> > 			case SQLCOM_ALTER_TABLE:
> > 			case SQLCOM_CREATE_TABLE:
> > 				storageHandler->commit(mySqlThread);
> >-				storageConnection-
> >startTransaction(isolation_levels[thd_tx_isolation(mySqlThread)]);
> >+				storageConnection-
> >startTransaction(getTransactionIsolation(mySqlThread));
> > 				storageConnection->markVerb();
> > 				insertCount = 0;
> > 				break;
> >@@ -1229,9 +1221,11 @@ void StorageInterface::startTransaction(
> > {
> > 	threadSwitch(table->in_use);
> >
> >+	int isolation = getTransactionIsolation(mySqlThread);
> >+
> > 	if (!storageConnection->transactionActive)
> > 		{
> >-		storageConnection-
> >startTransaction(isolation_levels[thd_tx_isolation(mySqlThread)]);
> >+		storageConnection->startTransaction(isolation);
> >
> > 		if (storageTable)
> > 			storageTable->setTruncateLock();
> >@@ -1868,12 +1862,12 @@ int StorageInterface::external_lock(THD
> > 			default:
> > 				break;
> > 			}
> >-
> >+		int isolation = getTransactionIsolation(thd);
> > 		if (thd_test_options(thd, OPTION_NOT_AUTOCOMMIT |
> OPTION_BEGIN))
> > 			{
> > 			checkBinLog();
> >
> >-			if (storageConnection-
> >startTransaction(isolation_levels[thd_tx_isolation(thd)]))
> >+			if (storageConnection->startTransaction(isolation))
> > 				{
> > 				if (!isTruncate && storageTable)
> > 					storageTable->setTruncateLock();
> >@@ -1888,7 +1882,7 @@ int StorageInterface::external_lock(THD
> > 			{
> > 			checkBinLog();
> >
> >-			if (storageConnection-
> >startImplicitTransaction(isolation_levels[thd_tx_isolation(thd)]))
> >+			if (storageConnection-
> >startImplicitTransaction(isolation))
> > 				{
> > 				if (!isTruncate && storageTable)
> > 					storageTable->setTruncateLock();
> >@@ -3061,21 +3055,7 @@ static void updateRecordChillThreshold(M
> > 	//uint newFalconRecordChillThreshold = *((uint *) save);
> > }
> >
> >-void StorageInterface::updateConsistentRead(MYSQL_THD thd, struct
> st_mysql_sys_var* variable, void *var_ptr,
> >void *save)
> >-{
> >-	falcon_consistent_read = (my_bool) (*(int *) save ? 1 : 0);
> >-
> >-	int newRepeatableRead = (falcon_consistent_read ?
> >-		TRANSACTION_CONSISTENT_READ : TRANSACTION_WRITE_COMMITTED);
> >
> >-	if (isolation_levels[ISO_REPEATABLE_READ] != newRepeatableRead)
> >-		{
> >-		int oldRepeatableRead =
> isolation_levels[ISO_REPEATABLE_READ];
> >-		for (int i = 0; i < 4; i++)
> >-			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)
> > {
> >@@ -3168,6 +3148,7 @@ static MYSQL_SYSVAR_ULONGLONG(initial_al
> >   "Initial allocation (in bytes) of falcon user tablespace.",
> >   NULL, NULL, 0, 0, LL(4000000000), LL(1)<<20);
> >
> >+
> > /***
> > static MYSQL_SYSVAR_UINT(allocation_extent, falcon_allocation_extent,
> >   PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
> >@@ -3180,10 +3161,28 @@ static MYSQL_SYSVAR_ULONGLONG(page_cache
> >   "The amount of memory to be used for the database page cache.",
> >   NULL, NULL, LL(4)<<20, LL(2)<<20, (ulonglong) ~0,
> LL(1)<<20);
> >
> >+static MYSQL_THDVAR_BOOL(consistent_read, PLUGIN_VAR_OPCMDARG,
> >+   "Enable Consistent Read Mode for Repeatable Reads",
> >+   NULL, NULL,1);
> >+
> >+static int getTransactionIsolation(THD * thd)
> >+{
> >+	int level = isolation_levels[thd_tx_isolation(thd)];
> >+
> >+	// TRANSACTION_CONSISTENT_READ  mapped to
> TRANSACTION_WRITE_COMMITTED,
> >+	// if falcon_consistent_read is not set
> >+	if(level == TRANSACTION_CONSISTENT_READ &&
> !THDVAR(thd,consistent_read))
> >+		return TRANSACTION_WRITE_COMMITTED;
> >+
> >+	return level;
> >+}
> >+
> >+
> > static struct st_mysql_sys_var* falconVariables[]= {
> >
> > #define PARAMETER_UINT(_name, _text, _min, _default, _max, _flags,
> _update_function) MYSQL_SYSVAR(_name),
> > #define PARAMETER_BOOL(_name, _text, _default, _flags,
> _update_function) MYSQL_SYSVAR(_name),
> >+
> > #include "StorageParameters.h"
> > #undef PARAMETER_UINT
> > #undef PARAMETER_BOOL
> >@@ -3196,6 +3195,7 @@ static struct st_mysql_sys_var* falconVa
> > 	MYSQL_SYSVAR(initial_allocation),
> > 	//MYSQL_SYSVAR(allocation_extent),
> > 	MYSQL_SYSVAR(page_cache_size),
> >+	MYSQL_SYSVAR(consistent_read),
> > 	NULL
> > };
> >
> >diff -Nrup a/storage/falcon/ha_falcon.h b/storage/falcon/ha_falcon.h
> >--- a/storage/falcon/ha_falcon.h	2008-02-03 20:55:29 +01:00
> >+++ b/storage/falcon/ha_falcon.h	2008-02-22 16:21:30 +01:00
> >@@ -147,8 +147,6 @@ public:
> > 	static int		rollback_by_xid(handlerton* hton, XID* xid);
> > 	static int		start_consistent_snapshot(handlerton *, THD
> *thd);
> >
> >-	static void		updateFsyncDisable(MYSQL_THD thd, struct
> st_mysql_sys_var* variable, void *var_ptr,
> >void *save);
> >-	static void		updateConsistentRead(MYSQL_THD thd, struct
> st_mysql_sys_var* variable, void *var_ptr,
> >void *save);
> > 	static void		updateRecordMemoryMax(MYSQL_THD thd, struct
> st_mysql_sys_var* variable, void* var_ptr,
> >void* save);
> > 	static void		updateRecordScavengeThreshold(MYSQL_THD thd,
> struct st_mysql_sys_var* variable, void*
> >var_ptr, void* save);
> > 	static void		updateRecordScavengeFloor(MYSQL_THD thd, struct
> st_mysql_sys_var* variable, void*
> >var_ptr, void* save);
> >
> >
> >
> >--
> >MySQL Code Commits Mailing List
> >For list archives: http://lists.mysql.com/commits
> >To unsubscribe:
> http://lists.mysql.com/commits?unsub=1


Thread
bk commit into 6.0 tree (vvaintroub:1.2821) BUG#33041vvaintroub22 Feb 2008
  • RE: bk commit into 6.0 tree (vvaintroub:1.2821) BUG#33041Kevin Lewis22 Feb 2008
    • RE: bk commit into 6.0 tree (vvaintroub:1.2821) BUG#33041Vladislav Vaintroub22 Feb 2008