Check the data is in JSON format for MariaDB or MySQL
JSON_VALID() is the function that will let us know that the column value has valid JSON data by returning 1 other wise return 0 for non-JSON format data.
--Check the JSON data
SELECT JSON_VALID('{"id": "1"}') AS Result;
Result:
-------
1
--Check the NON-JSON data
SELECT JSON_VALID('abc') AS Result;
Result:
------
0
Validate that the data in the column of the table is in JSON format
-- Check the bad data which not in json format
select datajson from customerdoc where JSON_VALID(datajson) = 0