############# mysql-test\t\sql_low_priority_updates_func.test ################# # # # Variable Name: sql_low_priority_updates # # Scope: GLOBAL & SESSION # # Access Type: Dynamic # # Data Type: BOOLEAN # # Default Value: 1 TRUE # # Values: 1 TRUE, 0 FALSE # # # # # # Creation Date: 2008-02-25 # # Author: Sharique Abdullah # # # # Description: Test Cases of Dynamic System Variable sql_low_priority_updates# # that checks behavior of this variable in the following ways # # * Functionality based on different values # # # # Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html # # # ############################################################################### --source include/not_embedded.inc ################################################################ # sql_low_priority_updates was renamed to low_priority_updates # ################################################################ --echo ** Setup ** --echo # # Setup # --echo ** Connecting con0 using root ** connect (con0,localhost,root,,); --echo ** Connecting con1 using root ** connect (con1,localhost,root,,); --echo ** Connection default ** connection default; SET @global_low_priority_updates = @@GLOBAL.low_priority_updates; SET @session_low_priority_updates = @@SESSION.low_priority_updates; # # Create Table # CREATE TABLE t1 (a varchar(100)); --echo '#--------------------FN_DYNVARS_160_01-------------------------#' # # Value ON # --echo ** Connection con0 ** connection con0; SET SESSION low_priority_updates = ON; --echo ** Connection con1 ** connection con1; SET SESSION low_priority_updates = ON; --echo ** Connection default ** 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 t1 WRITE; --echo ** Connection con1 ** connection con1; --echo ** Asynchronous Execution ** delimiter |; send UPDATE t1 SET a = CONCAT(a,"-updated");| delimiter ;| --echo ** Connection con0 ** connection con0; --echo ** Asynchronous Execution ** delimiter |; send LOCK TABLE t1 READ; SELECT * FROM t1; UNLOCK TABLES;| delimiter ;| --echo ** Connection default ** connection default; --echo Sleeping for 1 secs --sleep 1 UNLOCK TABLES; --echo ** Connection con0 ** connection con0; --echo ** Asynchronous Result ** reap; --echo Expected values of a without -updated; --echo ** Connection default ** connection default; DELETE FROM t1; --echo '#--------------------FN_DYNVARS_160_02-------------------------#' # # Value ON # --echo ** Connection con0 ** connection con0; SET SESSION low_priority_updates = OFF; --echo ** Connection con1 ** connection con1; SET SESSION low_priority_updates = OFF; --echo ** Connection default** 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 t1 WRITE; --echo ** Connection con1 ** connection con1; --echo ** Asynchronous Execution ** delimiter |; send UPDATE t1 SET a = CONCAT(a,"-updated");| delimiter ;| --echo ** Connection con0 ** connection con0; --echo ** Asynchronous Execution ** delimiter |; send LOCK TABLE t1 READ; SELECT * FROM t1; UNLOCK TABLES;| delimiter ;| --echo ** Connection default ** connection default; --echo Sleeping for 1 secs --sleep 1 UNLOCK TABLES; --echo ** Connection con0 ** connection con0; --echo ** Asynchronous Result ** reap; --echo Expected values of a with -updated; --echo ** Connection default** connection default; DELETE FROM t1; --echo '#--------------------FN_DYNVARS_160_03-------------------------#' # # Session data integrity check & GLOBAL Value check # --echo ** Connecting con_int1 using root ** connect (con_int1,localhost,root,,); --echo ** Connection con_int1 ** connection con_int1; SELECT @@SESSION.low_priority_updates; --echo 1 / TRUE Expected SET SESSION low_priority_updates = FALSE; --echo ** Connecting con_int2 using root ** connect (con_int2,localhost,root,,); --echo ** Connection con_int2 ** connection con_int2; SELECT @@SESSION.low_priority_updates; --echo 1 / TRUE Expected SET SESSION low_priority_updates = TRUE; --echo ** Connection con_int1 ** connection con_int1; SELECT @@SESSION.low_priority_updates; --echo 0 / FALSE Expected --echo ** Connection con_int2 ** connection con_int2; SELECT @@SESSION.low_priority_updates; --echo 1 / TRUE Expected --echo ** Connection default ** connection default; --echo Disconnecting Connections con_int1, con_int2 disconnect con_int1; disconnect con_int2; # # Cleanup # --echo ** Connection default ** connection default; --echo Disconnecting Connections con0, con1 disconnect con0; disconnect con1; DROP TABLE t1; SET @@GLOBAL.low_priority_updates = @global_low_priority_updates; SET @@SESSION.low_priority_updates = @session_low_priority_updates;