Changeset: 6a653021571d for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/6a653021571d Modified Files: sql/backends/monet5/vaults/json/json.c Branch: nested Log Message:
fix json loader diffs (24 lines): diff --git a/sql/backends/monet5/vaults/json/json.c b/sql/backends/monet5/vaults/json/json.c --- a/sql/backends/monet5/vaults/json/json.c +++ b/sql/backends/monet5/vaults/json/json.c @@ -116,10 +116,19 @@ append_terms(allocator *sa, JSON *jt, si break; case JSON_OBJECT: v = sa_strndup(sa, t->value, t->valuelen); + int depth = 0; do { offset += 1; next = offset < (size_t)jt->free ? jt->elm + offset : NULL; - } while((next && next->kind != JSON_VALUE)); + prev = jt->elm + (offset - 1); + if ((next && next->kind == JSON_OBJECT) && prev->kind == JSON_ELEMENT) + depth += 1; + if (next && next->kind == JSON_VALUE) { + depth -= 1; + } + if (next && next->kind == JSON_VALUE && prev->kind == JSON_VALUE) + depth = 0; + } while((next && next->kind != JSON_VALUE) || (next && depth > 0)); break; case JSON_ELEMENT: case JSON_STRING: _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org