MCPcopy Create free account
hub / github.com/MariaDB/server / json_norm_build

Function json_norm_build

strings/json_normalize.c:962–994  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

960}
961
962static int
963json_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
997int

Callers 1

json_normalizeFunction · 0.85

Calls 4

json_scan_startFunction · 0.85
json_read_valueFunction · 0.85
json_norm_value_initFunction · 0.85
json_norm_parseFunction · 0.85

Tested by

no test coverage detected