1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Add SLEEP(seconds) function, which always returns 0 after the given

number of seconds (which can include microseconds). (Bug #6760)


mysql-test/r/func_misc.result:
  Add new results
mysql-test/t/func_misc.test:
  Add new regression test.
sql/item_create.cc:
  Add create_func_sleep()
sql/item_create.h:
  Add create_func_sleep()
sql/item_func.cc:
  Add sleep() implementation
sql/item_func.h:
  Add class for sleep() function
sql/lex.h:
  Handle SLEEP() function
This commit is contained in:
unknown
2005-08-11 18:58:22 -07:00
parent 036c5b28d7
commit 7eebb75132
7 changed files with 49 additions and 0 deletions

View File

@ -46,3 +46,12 @@ drop table t1;
create table t1 as select uuid(), length(uuid());
show create table t1;
drop table t1;
# Bug #6760: Add SLEEP() function
create table t1 (a timestamp default '2005-05-05 01:01:01',
b timestamp default '2005-05-05 01:01:01');
insert into t1 set a = now();
select sleep(3);
update t1 set b = now();
select timediff(b, a) >= '00:00:03' from t1;
drop table t1;