Note
This parameter is available starting from V5.0.1.
Description
function_round_dialect controls the behavior of the ROUND() function when processing date/datetime type input parameters in MySQL-compatible mode.
Applicability
This parameter is applicable only to OceanBase Database in MySQL-compatible mode.
Privilege requirements
Query the parameter
systenant and all user tenants can query this parameter by using theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview.Modify the parameter
Both
systenant and user tenants can modify this parameter.
Attributes
Attribute |
Description |
|---|---|
| Type | Enum |
| Default value | MYSQL |
| Value range |
|
| Modifiable | Yes. You can use the ALTER SYSTEM SET statement to modify the parameter. |
| Effective upon OBServer node restart | No. The setting takes effect immediately. |
Usage notes
When a user passes a date/datetime type as the first argument of the ROUND() function, the behavior varies by value:
- MYSQL (default): the semantics are consistent with MySQL. The date type is converted to a numeric value before rounding, and a
doubletype is returned. - ORACLE: the semantics are consistent with Oracle. The date value is rounded according to the format string (such as
YYYY-MM-DD HH24:MI:SS), and adateordatetimetype is returned.
Examples
Set the ROUND() function to process date types in Oracle style.
obclient> ALTER SYSTEM SET function_round_dialect = 'ORACLE';
Set the ROUND() function to process date types in MySQL style.
obclient> ALTER SYSTEM SET function_round_dialect = 'MYSQL';
