Note
This variable is available starting with V4.2.0 GA. It takes effect only in MySQL-compatible mode.
Description
sql_select_limit specifies the maximum number of rows that a SELECT query can return. If a SELECT query contains a LIMIT clause, the value specified in the LIMIT clause takes precedence over the value of sql_select_limit. By default, the number of rows returned by a SELECT query is not limited.
Privilege requirements
Query variables
Global level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theinformation_schema.GLOBAL_VARIABLESview (MySQL-compatible mode) to view the value of a Global system variable.Session level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theinformation_schema.SESSION_VARIABLESview (MySQL-compatible mode) to view the value of a Session system variable.
Modify variables
Global level
The
systenant can directly modify the value of a Global system variable.A MySQL user tenant must have the
SUPERorALTER SYSTEMprivilege to modify the value of a Global system variable.
Session level
The
systenant and all user tenants can directly modify the value of a Session system variable.
Attributes
| Attribute | Description |
|---|---|
| Type | Int |
| Default value | 9223372036854775807 |
| Value range | [0, 9223372036854775807] |
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Examples
Set the maximum number of rows that a SELECT query can return to 100.
Session level
obclient> SET sql_select_limit= 100;Global level
obclient> SET GLOBAL sql_select_limit= 100;