1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Fix cases where SLEEP() calls would get optimized away or cached. (Bug #12689)

This commit is contained in:
jimw@mysql.com
2005-08-19 15:51:40 -07:00
parent dd1e0fb8c7
commit a3c893e0b8
4 changed files with 54 additions and 0 deletions

View File

@@ -70,3 +70,27 @@ select timediff(b, a) >= '00:00:03' from t1;
timediff(b, a) >= '00:00:03'
1
drop table t1;
set global query_cache_size=1355776;
create table t1 (a int);
insert into t1 values (1),(1),(1);
create table t2 (a datetime default null, b datetime default null);
insert into t2 set a = now();
select a from t1 where sleep(1);
a
update t2 set b = now() where b is null;
insert into t2 set a = now();
select a from t1 where sleep(a);
a
update t2 set b = now() where b is null;
insert into t2 set a = now();
select a from t1 where sleep(1);
a
update t2 set b = now() where b is null;
select timediff(b, a) >= '00:00:03' from t2;
timediff(b, a) >= '00:00:03'
1
1
1
drop table t2;
drop table t1;
set global query_cache_size=default;