Purpose
This function determines whether the input value is valid JSON. If it is valid JSON, it returns 1; otherwise, it returns 0.
Syntax
JSON_VALID(val)
Description
The val parameter is the input value. If the parameter is NULL, NULL is returned.
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