Purpose
This function checks whether the input value is valid JSON. It returns 1 if the value is valid JSON, and 0 otherwise.
Syntax
JSON_VALID(val)
Parameters
The val parameter specifies the input value. If the parameter is NULL, the function returns NULL.
Examples
obclient> SELECT JSON_VALID('{"a": 1}');
+------------------------+
| JSON_VALID('{"a": 1}') |
+------------------------+
| 1 |
+------------------------+
1 row in set
obclient> SELECT JSON_VALID('oceanbase'), JSON_VALID('"oceanbase"');
+-------------------------+---------------------------+
| JSON_VALID('oceanbase') | JSON_VALID('"oceanbase"') |
+-------------------------+---------------------------+
| 0 | 1 |
+-------------------------+---------------------------+
1 row in set
