summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSneha Modi <sneha.modi@oracle.com>2011-12-22 16:39:08 +0530
committerSneha Modi <sneha.modi@oracle.com>2011-12-22 16:39:08 +0530
commit805989f6cea992f93f4755ac44860919f9fee2c8 (patch)
tree72da3a7244b89c9f26b2e5d82cfaafe8ea92a0de /mysql-test
parentc225712f41d08ecf1acf6f5c42f8c5ebd0e17309 (diff)
downloadmariadb-git-805989f6cea992f93f4755ac44860919f9fee2c8.tar.gz
Bug#11754150: A TEST CASE FOR BUG#6857 IS DISABLED IN SP.TEST
unix_timestamp() is implemented in this part of the code in place of current_time(). Also, since the pb2 machines may be extremely fast, instead of looping through the code, we use sleep(1.1) so that the variables t0 and t1 have different values.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/sp.result15
-rw-r--r--mysql-test/t/sp.test17
2 files changed, 14 insertions, 18 deletions
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 1644c764431..07c945db5e6 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -2772,20 +2772,23 @@ userid
drop procedure bug8116|
drop table t3|
drop procedure if exists bug6857|
-create procedure bug6857(counter int)
+create procedure bug6857()
begin
declare t0, t1 int;
declare plus bool default 0;
-set t0 = current_time();
-while counter > 0 do
-set counter = counter - 1;
-end while;
-set t1 = current_time();
+set t0 = unix_timestamp();
+select sleep(1.1);
+set t1 = unix_timestamp();
if t1 > t0 then
set plus = 1;
end if;
select plus;
end|
+call bug6857()|
+sleep(1.1)
+0
+plus
+1
drop procedure bug6857|
drop procedure if exists bug8757|
create procedure bug8757()
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 3f6c50a9095..a6e06e4aabe 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -3336,28 +3336,21 @@ drop table t3|
--disable_warnings
drop procedure if exists bug6857|
--enable_warnings
-create procedure bug6857(counter int)
+create procedure bug6857()
begin
declare t0, t1 int;
declare plus bool default 0;
- set t0 = current_time();
- while counter > 0 do
- set counter = counter - 1;
- end while;
- set t1 = current_time();
+ set t0 = unix_timestamp();
+ select sleep(1.1);
+ set t1 = unix_timestamp();
if t1 > t0 then
set plus = 1;
end if;
select plus;
end|
-# QQ: This is currently disabled. Not only does it slow down a normal test
-# run, it makes running with valgrind (or similar tools) extremely
-# painful.
-# Make sure this takes at least one second on all machines in all builds.
-# 30000 makes it about 3 seconds on an old 1.1GHz linux.
-#call bug6857(300000)|
+call bug6857()|
drop procedure bug6857|