** Setup **

connect  con0,localhost,root,,;
connect  con1,localhost,root,,;
connection default;
SET @global_low_priority_updates = @@GLOBAL.low_priority_updates;
SET @session_low_priority_updates = @@SESSION.low_priority_updates;
CREATE TABLE t1 (a varchar(100));
create view v1 as select * from t1;
'#--------------------FN_DYNVARS_160_01-------------------------#'
connection con0;
SET SESSION low_priority_updates = ON;
connection con1;
SET SESSION low_priority_updates = ON;
connection default;
SET SESSION low_priority_updates = ON;
INSERT INTO t1 VALUES('1');
INSERT INTO t1 VALUES('2');
INSERT INTO t1 VALUES('3');
INSERT INTO t1 VALUES('4');
INSERT INTO t1 VALUES('5');
INSERT INTO t1 VALUES('6');
LOCK TABLE v1 WRITE CONCURRENT;
connection con1;
** Asynchronous Execution **
UPDATE t1 SET a = CONCAT(a,"-updated");|
connection con0;
** Asynchronous Execution **
LOCK TABLE t1 READ;
SELECT * FROM t1;
UNLOCK TABLES;|
connection default;
UNLOCK TABLES;
connection con0;
** Asynchronous Result **
a
1
2
3
4
5
6
Expected values of a without -updated;
connection default;
DELETE FROM t1;
'#--------------------FN_DYNVARS_160_02-------------------------#'
connection con0;
SET SESSION low_priority_updates = OFF;
connection con1;
SET SESSION low_priority_updates = OFF;
connection default;
SET SESSION low_priority_updates = OFF;
INSERT INTO t1 VALUES('1');
INSERT INTO t1 VALUES('2');
INSERT INTO t1 VALUES('3');
INSERT INTO t1 VALUES('4');
INSERT INTO t1 VALUES('5');
INSERT INTO t1 VALUES('6');
LOCK TABLE v1 READ;
connection con1;
** Asynchronous Execution **
UPDATE t1 SET a = CONCAT(a,"-updated");|
connection con0;
** Asynchronous Execution **
LOCK TABLE t1 READ;
SELECT * FROM t1;
UNLOCK TABLES;|
connection default;
UNLOCK TABLES;
connection con0;
** Asynchronous Result **
a
1-updated
2-updated
3-updated
4-updated
5-updated
6-updated
Expected values of a with -updated;
connection default;
DELETE FROM t1;
'#--------------------FN_DYNVARS_160_03-------------------------#'
connect  con_int1,localhost,root,,;
connection con_int1;
SELECT @@SESSION.low_priority_updates;
@@SESSION.low_priority_updates
0
1 / TRUE Expected
SET SESSION low_priority_updates = FALSE;
connect  con_int2,localhost,root,,;
connection con_int2;
SELECT @@SESSION.low_priority_updates;
@@SESSION.low_priority_updates
0
1 / TRUE Expected
SET SESSION low_priority_updates = TRUE;
connection con_int1;
SELECT @@SESSION.low_priority_updates;
@@SESSION.low_priority_updates
0
0 / FALSE Expected
connection con_int2;
SELECT @@SESSION.low_priority_updates;
@@SESSION.low_priority_updates
1
1 / TRUE Expected
connection default;
disconnect con_int1;
disconnect con_int2;
connection default;
disconnect con0;
disconnect con1;
drop view v1;
DROP TABLE t1;
SET @@GLOBAL.low_priority_updates = @global_low_priority_updates;
SET @@SESSION.low_priority_updates = @session_low_priority_updates;
