Translation: SET clause (submitted to the MariaDB official Manual), clause mariadb
This document is the description of the SET in the mariadb official manual.
Original article: https://mariadb.com/kb/en/set/
Https://mariadb.com/kb/zh-cn/set/ I submitted to the MariaDB official manual
Syntax
SET variable_assignment [, variable_assignment] ...variable_assignment: user_var_name = expr | [GLOBAL | SESSION] system_var_name = expr | [@@global. | @@session. | @@]system_var_name = expr
You can use the following syntax to set user variables in any expression:
user_var_name:= expr
Description
SET
The statement can assign values to different variable types that affect the server or client. MySQL of earlier versions adoptsSET OPTION
But do not agree to useOPTION
OfSET
Syntax, which has been removed from MariaDB 10.0.
To assign values to variables based on each query (per-query) (functions starting after MariaDB 10.1.2), see set statement.
To view server system VARIABLES, see show variables.
Server System Variables lists all System Variables.
Example
SHOW VARIABLES WHERE Variable_name LIKE "aria_group_commit%";+----------------------------+-------+| Variable_name | Value |+----------------------------+-------+| aria_group_commit | none || aria_group_commit_interval | 0 |+----------------------------+-------+SET GLOBAL aria_group_commit="HARD";SET GLOBAL aria_group_commit_interval=100;SHOW VARIABLES WHERE Variable_name LIKE "aria_group_commit%";+----------------------------+-------+| Variable_name | Value |+----------------------------+-------+| aria_group_commit | hard || aria_group_commit_interval | 100 |+----------------------------+-------+
Direct assignment:
SELECT (@a:=1);+---------+| (@a:=1) |+---------+| 1 |+---------+SELECT @a;+------+| @a |+------+| 1 |+------+
Back to Linux series article outline: http://www.cnblogs.com/f-ck-need-u/p/7048359.html
Back to website architecture series article outline: http://www.cnblogs.com/f-ck-need-u/p/7576137.html
Back to database series article outline: http://www.cnblogs.com/f-ck-need-u/p/7586194.html
Reprinted please indicate the source: http://www.cnblogs.com/f-ck-need-u/p/8616226.html
Note: If you think this article is not bad, please click the recommendation in the lower right corner. Your support can stimulate the author's enthusiasm for writing. Thank you very much!