Syntax
SLEEP(duration)
Purpose
SLEEP() pauses a period that you specified for duration in seconds. It returns 0 when the pause period ends.
If
SLEEP()is separately executed and not interrupted,0is returned.If
SLEEP()is interrupted during separate execution,1is returned without any error code.If
SLEEP()is a part of a query and is interrupted during the pause, it returnsERROR 1317.
Examples
obclient> SELECT SLEEP(1000);
+------------------+
| SLEEP(1000) |
+------------------+
| 0 |
+------------------+
obclient> SELECT SLEEP(1000);
+------------------+
| SLEEP(1000) |
+------------------+
| 1 |
+------------------+
obclient> SELECT 1 FROM t1 WHERE SLEEP(1000);
ERROR 1317 (70100): Query execution was interrupted