mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-21921 Make transaction_isolation and transaction_read_only into system variables
In MariaDB, we have a confusing problem where: * The transaction_isolation option can be set in a configuration file, but it cannot be set dynamically. * The tx_isolation system variable can be set dynamically, but it cannot be set in a configuration file. Therefore, we have two different names for the same thing in different contexts. This is needlessly confusing, and it complicates the documentation. The same thing applys for transaction_read_only. MySQL 5.7 solved this problem by making them into system variables. https://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-20.html This commit takes a similar approach by adding new system variables and marking the original ones as deprecated. This commit also resolves some legacy problems related to SET STATEMENT and transaction_isolation.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
SET GLOBAL tx_isolation='REPEATABLE-READ';
|
||||
SET GLOBAL transaction_isolation='REPEATABLE-READ';
|
||||
CREATE TABLE bug56680(
|
||||
a INT AUTO_INCREMENT PRIMARY KEY,
|
||||
b CHAR(1),
|
||||
@@ -28,7 +28,7 @@ connection default;
|
||||
SELECT b FROM bug56680;
|
||||
b
|
||||
x
|
||||
SET GLOBAL tx_isolation='READ-UNCOMMITTED';
|
||||
SET GLOBAL transaction_isolation='READ-UNCOMMITTED';
|
||||
INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
|
||||
INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
|
||||
INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
|
||||
|
@@ -10,8 +10,8 @@ show warnings;
|
||||
Level Code Message
|
||||
begin;
|
||||
update worklog5743 set a = (repeat("x", 17000));
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
REPEATABLE-READ
|
||||
connect con1,localhost,root,,;
|
||||
select a = repeat("x", 17000) from worklog5743;
|
||||
@@ -22,8 +22,8 @@ a = repeat("b", 16000)
|
||||
1
|
||||
connect con2,localhost,root,,;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a = repeat("x", 17000) from worklog5743;
|
||||
a = repeat("x", 17000)
|
||||
@@ -42,8 +42,8 @@ insert into worklog5743 values(9, repeat("a", 10000));
|
||||
begin;
|
||||
update worklog5743 set a1 = 1000;
|
||||
connection con1;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
REPEATABLE-READ
|
||||
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@@ -53,8 +53,8 @@ a1 a2 = repeat("a", 10000)
|
||||
9 1
|
||||
connection con2;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
a1 a2 = repeat("a", 10000)
|
||||
@@ -68,8 +68,8 @@ insert into worklog5743 values(9, repeat("a", 10000));
|
||||
begin;
|
||||
update worklog5743 set a1 = 1000;
|
||||
connection con1;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
REPEATABLE-READ
|
||||
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@@ -79,8 +79,8 @@ a1 a2 = repeat("a", 10000)
|
||||
9 1
|
||||
connection con2;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
a1 a2 = repeat("a", 10000)
|
||||
@@ -258,8 +258,8 @@ select a1, left(a2, 20) from worklog5743_16;
|
||||
a1 left(a2, 20)
|
||||
1000 aaaaaaaaaaaaaaaaaaaa
|
||||
connection con1;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
REPEATABLE-READ
|
||||
explain select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@@ -293,8 +293,8 @@ a1 left(a2, 20)
|
||||
9 aaaaaaaaaaaaaaaaaaaa
|
||||
connection con2;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
|
||||
a1 left(a2, 20)
|
||||
@@ -367,8 +367,8 @@ repeat("a", 3068));
|
||||
begin;
|
||||
update worklog5743 set a1 = 1000;
|
||||
connection con1;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
REPEATABLE-READ
|
||||
explain select a1 from worklog5743 where a1 = 9;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@@ -378,8 +378,8 @@ a1
|
||||
9
|
||||
connection con2;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a1 from worklog5743 where a1 = 9;
|
||||
a1
|
||||
@@ -399,8 +399,8 @@ insert into worklog5743 values(repeat("a", 20000));
|
||||
begin;
|
||||
insert into worklog5743 values(repeat("b", 20000));
|
||||
update worklog5743 set a = (repeat("x", 25000));
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
REPEATABLE-READ
|
||||
connection con1;
|
||||
select a = repeat("a", 20000) from worklog5743;
|
||||
@@ -409,8 +409,8 @@ a = repeat("a", 20000)
|
||||
disconnect con1;
|
||||
connection con2;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a = repeat("x", 25000) from worklog5743;
|
||||
a = repeat("x", 25000)
|
||||
|
@@ -13,8 +13,8 @@ Level Code Message
|
||||
SET sql_mode= default;
|
||||
begin;
|
||||
update worklog5743 set a = (repeat("x", 17000));
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
REPEATABLE-READ
|
||||
connect con1,localhost,root,,;
|
||||
select a = repeat("x", 17000) from worklog5743;
|
||||
@@ -25,8 +25,8 @@ a = repeat("b", 16000)
|
||||
1
|
||||
connect con2,localhost,root,,;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a = repeat("x", 17000) from worklog5743;
|
||||
a = repeat("x", 17000)
|
||||
@@ -45,8 +45,8 @@ insert into worklog5743 values(9, repeat("a", 10000));
|
||||
begin;
|
||||
update worklog5743 set a1 = 1111;
|
||||
connection con1;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
REPEATABLE-READ
|
||||
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@@ -56,8 +56,8 @@ a1 a2 = repeat("a", 10000)
|
||||
9 1
|
||||
connection con2;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
a1 a2 = repeat("a", 10000)
|
||||
@@ -71,8 +71,8 @@ insert into worklog5743 values(9, repeat("a", 10000));
|
||||
begin;
|
||||
update worklog5743 set a1 = 2222;
|
||||
connection con1;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
REPEATABLE-READ
|
||||
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@@ -82,8 +82,8 @@ a1 a2 = repeat("a", 10000)
|
||||
9 1
|
||||
connection con2;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
a1 a2 = repeat("a", 10000)
|
||||
@@ -183,8 +183,8 @@ select a1, left(a2, 20) from worklog5743_4;
|
||||
a1 left(a2, 20)
|
||||
1000 aaaaaaaaaaaaaaaaaaaa
|
||||
connection con1;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
REPEATABLE-READ
|
||||
explain select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@@ -206,8 +206,8 @@ a1 left(a2, 20)
|
||||
9 aaaaaaaaaaaaaaaaaaaa
|
||||
connection con2;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
|
||||
a1 left(a2, 20)
|
||||
@@ -261,8 +261,8 @@ insert into worklog5743 values(9, repeat("a", 764));
|
||||
begin;
|
||||
update worklog5743 set a1 = 4444;
|
||||
connection con1;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
REPEATABLE-READ
|
||||
explain select a1 from worklog5743 where a1 = 9;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@@ -272,8 +272,8 @@ a1
|
||||
9
|
||||
connection con2;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a1 from worklog5743 where a1 = 9;
|
||||
a1
|
||||
@@ -289,8 +289,8 @@ insert into worklog5743 values(repeat("a", 20000));
|
||||
begin;
|
||||
insert into worklog5743 values(repeat("b", 20000));
|
||||
update worklog5743 set a = (repeat("x", 25000));
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
REPEATABLE-READ
|
||||
connection con1;
|
||||
select a = repeat("a", 20000) from worklog5743;
|
||||
@@ -299,8 +299,8 @@ a = repeat("a", 20000)
|
||||
disconnect con1;
|
||||
connection con2;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a = repeat("x", 25000) from worklog5743;
|
||||
a = repeat("x", 25000)
|
||||
|
@@ -16,8 +16,8 @@ Note 1071 Specified key was too long; max key length is 1536 bytes
|
||||
SET sql_mode= default;
|
||||
begin;
|
||||
update worklog5743 set a = (repeat("x", 17000));
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
REPEATABLE-READ
|
||||
connect con1,localhost,root,,;
|
||||
select a = repeat("x", 17000) from worklog5743;
|
||||
@@ -28,8 +28,8 @@ a = repeat("b", 16000)
|
||||
1
|
||||
connect con2,localhost,root,,;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a = repeat("x", 17000) from worklog5743;
|
||||
a = repeat("x", 17000)
|
||||
@@ -48,8 +48,8 @@ insert into worklog5743 values(9, repeat("a", 10000));
|
||||
begin;
|
||||
update worklog5743 set a1 = 1000;
|
||||
connection con1;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
REPEATABLE-READ
|
||||
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@@ -59,8 +59,8 @@ a1 a2 = repeat("a", 10000)
|
||||
9 1
|
||||
connection con2;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
a1 a2 = repeat("a", 10000)
|
||||
@@ -74,8 +74,8 @@ insert into worklog5743 values(9, repeat("a", 10000));
|
||||
begin;
|
||||
update worklog5743 set a1 = 1000;
|
||||
connection con1;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
REPEATABLE-READ
|
||||
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@@ -85,8 +85,8 @@ a1 a2 = repeat("a", 10000)
|
||||
9 1
|
||||
connection con2;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
a1 a2 = repeat("a", 10000)
|
||||
@@ -217,8 +217,8 @@ select a1, left(a2, 20) from worklog5743_8;
|
||||
a1 left(a2, 20)
|
||||
1000 aaaaaaaaaaaaaaaaaaaa
|
||||
connection con1;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
REPEATABLE-READ
|
||||
explain select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@@ -246,8 +246,8 @@ a1 left(a2, 20)
|
||||
9 aaaaaaaaaaaaaaaaaaaa
|
||||
connection con2;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
|
||||
a1 left(a2, 20)
|
||||
@@ -295,8 +295,8 @@ update worklog5743 set a1 = 1000;
|
||||
begin;
|
||||
update worklog5743 set a1 = 1000;
|
||||
connection con1;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
REPEATABLE-READ
|
||||
explain select a1 from worklog5743 where a1 = 9;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@@ -305,8 +305,8 @@ select a1 from worklog5743 where a1 = 9;
|
||||
a1
|
||||
connection con2;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a1 from worklog5743 where a1 = 9;
|
||||
a1
|
||||
@@ -325,8 +325,8 @@ insert into worklog5743 values(repeat("a", 20000));
|
||||
begin;
|
||||
insert into worklog5743 values(repeat("b", 20000));
|
||||
update worklog5743 set a = (repeat("x", 25000));
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
REPEATABLE-READ
|
||||
connection con1;
|
||||
select a = repeat("a", 20000) from worklog5743;
|
||||
@@ -335,8 +335,8 @@ a = repeat("a", 20000)
|
||||
disconnect con1;
|
||||
connection con2;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a = repeat("x", 25000) from worklog5743;
|
||||
a = repeat("x", 25000)
|
||||
|
@@ -793,16 +793,16 @@ col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
|
||||
1 1
|
||||
0 1
|
||||
connection con1;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
REPEATABLE-READ
|
||||
SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
|
||||
worklog5743;
|
||||
col_1_text = REPEAT("b", 200) col_2_text = REPEAT("o", 200)
|
||||
0 1
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
READ-UNCOMMITTED
|
||||
SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
|
||||
worklog5743;
|
||||
@@ -864,8 +864,8 @@ col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
|
||||
COMMIT;
|
||||
connection con1;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
select @@session.transaction_isolation;
|
||||
@@session.transaction_isolation
|
||||
READ-UNCOMMITTED
|
||||
SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
|
||||
worklog5743;
|
||||
|
@@ -15,7 +15,7 @@
|
||||
-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
|
||||
SET GLOBAL innodb_change_buffering_debug = 1;
|
||||
-- enable_query_log
|
||||
SET GLOBAL tx_isolation='REPEATABLE-READ';
|
||||
SET GLOBAL transaction_isolation='REPEATABLE-READ';
|
||||
|
||||
CREATE TABLE bug56680(
|
||||
a INT AUTO_INCREMENT PRIMARY KEY,
|
||||
@@ -50,7 +50,7 @@ SELECT b FROM bug56680;
|
||||
|
||||
# For the rest of this test, use the READ UNCOMMITTED isolation level
|
||||
# to see what exists in the secondary index.
|
||||
SET GLOBAL tx_isolation='READ-UNCOMMITTED';
|
||||
SET GLOBAL transaction_isolation='READ-UNCOMMITTED';
|
||||
|
||||
# Create enough rows for the table, so that the insert buffer will be
|
||||
# used for modifying the secondary index page. There must be multiple
|
||||
|
@@ -40,7 +40,7 @@ update worklog5743 set a = (repeat("x", 17000));
|
||||
# Start a new session to select the column to force it build
|
||||
# an earlier version of the clustered index through undo log. So it should
|
||||
# just see the result of repeat("b", 16000)
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
--connect (con1,localhost,root,,)
|
||||
select a = repeat("x", 17000) from worklog5743;
|
||||
select a = repeat("b", 16000) from worklog5743;
|
||||
@@ -49,7 +49,7 @@ select a = repeat("b", 16000) from worklog5743;
|
||||
# should see the uncommitted update
|
||||
--connect (con2,localhost,root,,)
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
select a = repeat("x", 17000) from worklog5743;
|
||||
|
||||
# Roll back the transaction
|
||||
@@ -73,7 +73,7 @@ update worklog5743 set a1 = 1000;
|
||||
|
||||
# Do a select from another connection that would use the secondary index
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
|
||||
@@ -81,7 +81,7 @@ select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
# row with a1 = 9
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
|
||||
--connection default
|
||||
@@ -103,7 +103,7 @@ update worklog5743 set a1 = 1000;
|
||||
|
||||
# Do a select from another connection that would use the secondary index
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
|
||||
@@ -111,7 +111,7 @@ select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
# row with a1 = 9
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
|
||||
--connection default
|
||||
@@ -247,7 +247,7 @@ select a1, left(a2, 20) from worklog5743_16;
|
||||
|
||||
# Do a select from another connection that would use the secondary index
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
explain select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
|
||||
explain select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
|
||||
explain select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
|
||||
@@ -263,7 +263,7 @@ select a1, left(a2, 20) from worklog5743_16 where a1 = 9;
|
||||
# row with a1 = 9
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
|
||||
select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
|
||||
select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
|
||||
@@ -318,14 +318,14 @@ update worklog5743 set a1 = 1000;
|
||||
|
||||
# Do a select from another connection that would use the secondary index
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
explain select a1 from worklog5743 where a1 = 9;
|
||||
select a1 from worklog5743 where a1 = 9;
|
||||
|
||||
# Do read uncommitted, it would show there is no row with a1 = 9
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
select a1 from worklog5743 where a1 = 9;
|
||||
|
||||
--connection default
|
||||
@@ -358,14 +358,14 @@ update worklog5743 set a = (repeat("x", 25000));
|
||||
|
||||
# Start a new session to select the table to force it build
|
||||
# an earlier version of the cluster index through undo log
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
--connection con1
|
||||
select a = repeat("a", 20000) from worklog5743;
|
||||
--disconnect con1
|
||||
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
select a = repeat("x", 25000) from worklog5743;
|
||||
--disconnect con2
|
||||
|
||||
|
@@ -41,7 +41,7 @@ update worklog5743 set a = (repeat("x", 17000));
|
||||
# Start a new session to select the column to force it build
|
||||
# an earlier version of the clustered index through undo log. So it should
|
||||
# just see the result of repeat("b", 16000)
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
--connect (con1,localhost,root,,)
|
||||
select a = repeat("x", 17000) from worklog5743;
|
||||
select a = repeat("b", 16000) from worklog5743;
|
||||
@@ -50,7 +50,7 @@ select a = repeat("b", 16000) from worklog5743;
|
||||
# should see the uncommitted update
|
||||
--connect (con2,localhost,root,,)
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
select a = repeat("x", 17000) from worklog5743;
|
||||
|
||||
# Roll back the transaction
|
||||
@@ -74,7 +74,7 @@ update worklog5743 set a1 = 1111;
|
||||
|
||||
# Do a select from another connection that would use the secondary index
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
|
||||
@@ -82,7 +82,7 @@ select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
# row with a1 = 9
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
|
||||
--connection default
|
||||
@@ -104,7 +104,7 @@ update worklog5743 set a1 = 2222;
|
||||
|
||||
# Do a select from another connection that would use the secondary index
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
|
||||
@@ -112,7 +112,7 @@ select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
# row with a1 = 9
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
|
||||
--connection default
|
||||
@@ -195,7 +195,7 @@ select a1, left(a2, 20) from worklog5743_4;
|
||||
|
||||
# Do a select from another connection that would use the secondary index
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
explain select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
|
||||
explain select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
|
||||
explain select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
|
||||
@@ -207,7 +207,7 @@ select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
|
||||
# row with a1 = 9
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
|
||||
select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
|
||||
select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
|
||||
@@ -293,14 +293,14 @@ update worklog5743 set a1 = 4444;
|
||||
|
||||
# Do a select from another connection that would use the secondary index
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
explain select a1 from worklog5743 where a1 = 9;
|
||||
select a1 from worklog5743 where a1 = 9;
|
||||
|
||||
# Do read uncommitted, it would show there is no row with a1 = 9
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
select a1 from worklog5743 where a1 = 9;
|
||||
|
||||
--connection default
|
||||
@@ -327,14 +327,14 @@ update worklog5743 set a = (repeat("x", 25000));
|
||||
|
||||
# Start a new session to select the table to force it build
|
||||
# an earlier version of the cluster index through undo log
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
--connection con1
|
||||
select a = repeat("a", 20000) from worklog5743;
|
||||
--disconnect con1
|
||||
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
select a = repeat("x", 25000) from worklog5743;
|
||||
--disconnect con2
|
||||
|
||||
|
@@ -42,7 +42,7 @@ update worklog5743 set a = (repeat("x", 17000));
|
||||
# Start a new session to select the column to force it build
|
||||
# an earlier version of the clustered index through undo log. So it should
|
||||
# just see the result of repeat("b", 16000)
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
--connect (con1,localhost,root,,)
|
||||
select a = repeat("x", 17000) from worklog5743;
|
||||
select a = repeat("b", 16000) from worklog5743;
|
||||
@@ -51,7 +51,7 @@ select a = repeat("b", 16000) from worklog5743;
|
||||
# should see the uncommitted update
|
||||
--connect (con2,localhost,root,,)
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
select a = repeat("x", 17000) from worklog5743;
|
||||
|
||||
# Roll back the transaction
|
||||
@@ -75,7 +75,7 @@ update worklog5743 set a1 = 1000;
|
||||
|
||||
# Do a select from another connection that would use the secondary index
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
|
||||
@@ -83,7 +83,7 @@ select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
# row with a1 = 9
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
|
||||
--connection default
|
||||
@@ -105,7 +105,7 @@ update worklog5743 set a1 = 1000;
|
||||
|
||||
# Do a select from another connection that would use the secondary index
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
|
||||
@@ -113,7 +113,7 @@ select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
# row with a1 = 9
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
|
||||
--connection default
|
||||
@@ -217,7 +217,7 @@ select a1, left(a2, 20) from worklog5743_8;
|
||||
|
||||
# Do a select from another connection that would use the secondary index
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
explain select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
|
||||
explain select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
|
||||
explain select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
|
||||
@@ -231,7 +231,7 @@ select a1, left(a2, 20) from worklog5743_8 where a1 = 9;
|
||||
# row with a1 = 9
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
|
||||
select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
|
||||
select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
|
||||
@@ -314,14 +314,14 @@ update worklog5743 set a1 = 1000;
|
||||
|
||||
# Do a select from another connection that would use the secondary index
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
explain select a1 from worklog5743 where a1 = 9;
|
||||
select a1 from worklog5743 where a1 = 9;
|
||||
|
||||
# Do read uncommitted, it would show there is no row with a1 = 9
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
select a1 from worklog5743 where a1 = 9;
|
||||
|
||||
--connection default
|
||||
@@ -353,14 +353,14 @@ update worklog5743 set a = (repeat("x", 25000));
|
||||
|
||||
# Start a new session to select the table to force it build
|
||||
# an earlier version of the cluster index through undo log
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
--connection con1
|
||||
select a = repeat("a", 20000) from worklog5743;
|
||||
--disconnect con1
|
||||
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
select a = repeat("x", 25000) from worklog5743;
|
||||
--disconnect con2
|
||||
|
||||
|
@@ -722,11 +722,11 @@ SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
|
||||
worklog5743;
|
||||
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
|
||||
worklog5743;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
|
||||
worklog5743;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
||||
@@ -789,7 +789,7 @@ WHERE info='COMMIT';
|
||||
|
||||
--connection con1
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select @@session.transaction_isolation;
|
||||
SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
|
||||
worklog5743;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
||||
|
Reference in New Issue
Block a user