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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user