aboutsummaryrefslogtreecommitdiff
path: root/src/json.c
diff options
context:
space:
mode:
authordrh <>2023-11-25 19:28:44 +0000
committerdrh <>2023-11-25 19:28:44 +0000
commitaea2d2312103e2c63c6433977e6e06a32e2244a4 (patch)
tree27975c4deef92f41e2b4a80ad0aba0c69ae360a1 /src/json.c
parentc2474105ca39070a40f53b3c36550c9b169c5469 (diff)
downloadsqlite-aea2d2312103e2c63c6433977e6e06a32e2244a4.tar.gz
sqlite-aea2d2312103e2c63c6433977e6e06a32e2244a4.zip
Almost working. Path is still not exactly right when Root is defined on
json_tree(). FossilOrigin-Name: 92258246916a9c0d72785964513113848a850dec78bdade8b3f274e410df4e7e
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/json.c b/src/json.c
index c8269436e..2de4c61a1 100644
--- a/src/json.c
+++ b/src/json.c
@@ -6249,8 +6249,16 @@ static int jsonEachFilter(
n = jsonbPayloadSize(&p->sParse, i, &sz);
p->iEnd = i+n+sz;
if( (p->sParse.aBlob[i] & 0x0f)>=JSONB_ARRAY && !p->bRecursive ){
- p->i += n;
+ p->i = i + n;
p->eType = p->sParse.aBlob[i] & 0x0f;
+ p->aParent = sqlite3DbMallocZero(p->db, sizeof(JsonParent));
+ if( p->aParent==0 ) return SQLITE_NOMEM;
+ p->nParent = 1;
+ p->nParentAlloc = 1;
+ p->aParent[0].iKey = 0;
+ p->aParent[0].iEnd = p->iEnd;
+ p->aParent[0].iHead = p->i;
+ p->aParent[0].iValue = i;
}
return SQLITE_OK;
}else{