| 960 | } |
| 961 | |
| 962 | static int |
| 963 | json_norm_build(struct json_norm_value *root, |
| 964 | const char *s, size_t size, CHARSET_INFO *cs, |
| 965 | MEM_ROOT *current_mem_root, |
| 966 | json_engine_t *je, |
| 967 | MEM_ROOT_DYNAMIC_ARRAY *stack) |
| 968 | { |
| 969 | int err= 0; |
| 970 | |
| 971 | DBUG_ASSERT(s); |
| 972 | |
| 973 | memset(root, 0x00, sizeof(struct json_norm_value)); |
| 974 | root->type= JSON_VALUE_UNINITIALIZED; |
| 975 | |
| 976 | err= json_scan_start(je, cs, (const uchar *)s, (const uchar *)(s + size)); |
| 977 | if (json_read_value(je)) |
| 978 | { |
| 979 | return err; |
| 980 | } |
| 981 | err= json_norm_value_init(root, je); |
| 982 | |
| 983 | if (root->type == JSON_VALUE_OBJECT || |
| 984 | root->type == JSON_VALUE_ARRAY) |
| 985 | { |
| 986 | err= json_norm_parse(root, je, current_mem_root, stack); |
| 987 | if (err) |
| 988 | { |
| 989 | return err; |
| 990 | } |
| 991 | } |
| 992 | |
| 993 | return err; |
| 994 | } |
| 995 | |
| 996 | |
| 997 | int |
no test coverage detected