Syntax
SLEEP(duration)
Purpose
The SLEEP function pauses for the specified duration (in seconds) and returns 0 after the pause.
If executed alone and not interrupted, it returns
0.If interrupted during execution, it returns
1without any error code.If part of a query and interrupted during the pause, it returns error code
ERROR 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
