Syntax
SLEEP(duration)
Purpose
You can call the SLEEP function to pause a period that you specified for duration in seconds. It returns 0 when the pause period ends.
If
SLEEPis separately executed and not interrupted,0is returned.If
SLEEPis interrupted during separate execution,1is returned without any error code.If
SLEEPis 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