Translation: MariaDB wait/nowait, mariadbnowait
This article is a translation of the mariadb official manual: wait/nowait.
Original article: https://mariadb.com/kb/en/library/wait-and-nowait/
Https://mariadb.com/kb/zh-cn/wait-and-nowait/ I submitted to the MariaDB official manual
Starting from MariaDB 10.3.0, introduce the extension syntax so that the following statements can be usedinnodb_lock_wait_timeoutVariable andlock_wait_timeoutVariable lock wait duration:
Syntax
ALTER TABLE tbl_name [WAIT n|NOWAIT] ...CREATE ... INDEX ON tbl_name (index_col_name, ...) [WAIT n|NOWAIT] ...DROP INDEX ... [WAIT n|NOWAIT]DROP TABLE tbl_name [WAIT n|NOWAIT] ...LOCK TABLE ... [WAIT n|NOWAIT]OPTIMIZE TABLE tbl_name [WAIT n|NOWAIT]RENAME TABLE tbl_name [WAIT n|NOWAIT] ...SELECT ... FOR UPDATE [WAIT n|NOWAIT]SELECT ... LOCK IN SHARE MODE [WAIT n|NOWAIT]TRUNCATE TABLE tbl_name [WAIT n|NOWAIT]
Description
The lock wait timeout period can passWAIT n(In seconds) to precisely set or setNOWAITIn this case, if the lock cannot be obtained, an error will be returned immediately.WAIT 0EquivalentNOWAIT.
Go back to the Linux series article outline: workshop!