title | summary | category |
---|---|---|
DO | TiDB SQL Statement Reference |
An overview of the usage of DO for the TiDB database. |
reference |
This statement executes an expression, without returning a result. In MySQL, a common use-case is to excecute stored programs without needing to handle the result. Since TiDB does not provide stored routines, this function has a more limited use.
DoStmt:
ExpressionList:
Expression:
mysql> SELECT SLEEP(5);
+----------+
| SLEEP(5) |
+----------+
| 0 |
+----------+
1 row in set (5.00 sec)
mysql> DO SLEEP(5);
Query OK, 0 rows affected (5.00 sec)
mysql> DO SLEEP(1), SLEEP(1.5);
Query OK, 0 rows affected (2.50 sec)
This statement is understood to be fully compatible with MySQL. Any compatibility differences should be reported via an issue on GitHub.