1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

json helpers

This commit is contained in:
Sergei Golubchik
2018-11-28 18:16:46 +01:00
parent a76aadf7bc
commit d68d7e50f9
3 changed files with 87 additions and 8 deletions

View File

@ -374,17 +374,11 @@ static int path_setup_nwc(json_path_t *p, CHARSET_INFO *i_cs,
longlong Item_func_json_valid::val_int()
{
String *js= args[0]->val_json(&tmp_value);
json_engine_t je;
if ((null_value= args[0]->null_value))
return 0;
json_scan_start(&je, js->charset(), (const uchar *) js->ptr(),
(const uchar *) js->ptr()+js->length());
while (json_scan_next(&je) == 0) {}
return je.s.error == 0;
return json_valid(js->ptr(), js->length(), js->charset());
}