I would like to validate json string before inserting it into mysql database so that JSON_VALID constraint is not violated. Using json_decode like
json_decode($string, true, 512, JSON_THROW_ON_ERROR);
is not enough because
json_decode('["\u001f?\b\u0000\u0000\u0000\u0000\u0000\u0002\u0003KL)NKLI\u0003\u0000z,?o\u0007\u0000\u0000\u0000"]', true, 512, JSON_THROW_ON_ERROR);
throws no error but
select JSON_VALID('["\u001f?\b\u0000\u0000\u0000\u0000\u0000\u0002\u0003KL)NKLI\u0003\u0000z,?o\u0007\u0000\u0000\u0000"]') as result;
returns false. How can I achieve my goal?