diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2015-08-07 11:44:22 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2015-08-07 11:44:22 +0200 |
commit | 4eb4c694be2bbbcdb2502f8f01a525d2eb254c5b (patch) | |
tree | 41430fde4060f738221d0ff0ca863f63c9831cda /mysql-test/t/max_statement_time.test | |
parent | afd59b575a75ebbc57f71ce2865fdff85e3e233b (diff) | |
download | mariadb-git-bb-10.1-MDEV-8346.tar.gz |
MDEV-8346: main.max_statement_time fails in buildbot in different waysbb-10.1-MDEV-8346
- the test dependence on computer characteristic removed
- reduced time of execution of the test
Diffstat (limited to 'mysql-test/t/max_statement_time.test')
-rw-r--r-- | mysql-test/t/max_statement_time.test | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/mysql-test/t/max_statement_time.test b/mysql-test/t/max_statement_time.test index d994f04be83..aec43be4b6c 100644 --- a/mysql-test/t/max_statement_time.test +++ b/mysql-test/t/max_statement_time.test @@ -9,32 +9,27 @@ --echo # Test the MAX_STATEMENT_TIME option. --echo -SET @@MAX_STATEMENT_TIME=2; +SET @@MAX_STATEMENT_TIME=0.2; select @@max_statement_time; -SELECT SLEEP(1); -SELECT SLEEP(3); +SELECT SLEEP(0.1); +SELECT SLEEP(0.3); SET @@MAX_STATEMENT_TIME=0; -SELECT SLEEP(1); +SELECT SLEEP(0.1); SHOW STATUS LIKE "max_statement_time_exceeded"; -CREATE TABLE t1 (a INT, b VARCHAR(300)) engine=myisam; +CREATE TABLE t1 (a INT); -INSERT INTO t1 VALUES (1, 'string'); +INSERT INTO t1 VALUES (1),(2),(3),(4); --disable_result_log --disable_query_log SET @@MAX_STATEMENT_TIME=2; -SET @@MAX_STATEMENT_TIME=0.1; -WHILE (! $mysql_errno) -{ - SET @@MAX_STATEMENT_TIME=0; - INSERT INTO t1 SELECT * FROM t1; - SET @@MAX_STATEMENT_TIME=0.1; - --error 0,ER_STATEMENT_TIMEOUT - SELECT COUNT(*) FROM t1 WHERE b LIKE '%z%'; -} +SET @@MAX_STATEMENT_TIME=0.01; +SET @@MAX_STATEMENT_TIME=0.01; +--error 0,ER_STATEMENT_TIMEOUT +SELECT a,sleep(0.005) FROM t1; SET @@MAX_STATEMENT_TIME=0; --enable_query_log @@ -52,7 +47,7 @@ CREATE PROCEDURE p1() BEGIN declare tmp int; SET @@MAX_STATEMENT_TIME=0.0001; - SELECT COUNT(*) INTO tmp FROM t1 WHERE b LIKE '%z%'; + SELECT a,sleep(0.05) FROM t1; SET @@MAX_STATEMENT_TIME=0; END| @@ -194,13 +189,12 @@ DROP TABLE t1; --echo # create table t1 (i int); insert into t1 values (1),(2),(3),(4); -insert into t1 select a.* from t1 a, t1 b, t1 c, t1 d, t1 e, t1 f, t1 g; delimiter |; create procedure pr() begin select 1; - select sql_no_cache * from t1 where i > 5; - select sql_no_cache * from t1 where i > 5; + select sql_no_cache *, sleep(0.01) from t1; + select sql_no_cache *, sleep(0.01) from t1; end | delimiter ;| set max_statement_time = 0.001; @@ -210,8 +204,8 @@ drop procedure pr; delimiter |; create procedure pr() begin - select sql_no_cache * from t1 where i > 5; - select sql_no_cache * from t1 where i > 5; + select sql_no_cache *, sleep(0.01) from t1; + select sql_no_cache *, sleep(0.01) from t1; end | delimiter ;| set max_statement_time = 0.001; |