aboutsummaryrefslogtreecommitdiff
path: root/src/json.c
diff options
context:
space:
mode:
authordrh <>2024-03-05 16:47:48 +0000
committerdrh <>2024-03-05 16:47:48 +0000
commit28001204f4afcd2bba65ba7a5704d2e60b405ba6 (patch)
tree0733882a7d82a149a1a051f24f3c875e66435ccb /src/json.c
parent891aa0545071329a1898815e8304d67299dee758 (diff)
downloadsqlite-28001204f4afcd2bba65ba7a5704d2e60b405ba6.tar.gz
sqlite-28001204f4afcd2bba65ba7a5704d2e60b405ba6.zip
The value returned by the json_each.json field needs to survive longer than
the json_each virtual table itself, in the event that the value is used in an aggregate expression. dbsqlfuzz 5120bd0b3bb0b73eebbcb79ac37c6b0663fccad6 FossilOrigin-Name: 952ed71b9b61e79fe807ac3134bdfa7c94a415e02f13f94440a34d6d548d171e
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/json.c b/src/json.c
index 1227ada78..fe7f93888 100644
--- a/src/json.c
+++ b/src/json.c
@@ -4993,9 +4993,9 @@ static int jsonEachColumn(
case JEACH_JSON: {
if( p->sParse.zJson==0 ){
sqlite3_result_blob(ctx, p->sParse.aBlob, p->sParse.nBlob,
- SQLITE_STATIC);
+ SQLITE_TRANSIENT);
}else{
- sqlite3_result_text(ctx, p->sParse.zJson, -1, SQLITE_STATIC);
+ sqlite3_result_text(ctx, p->sParse.zJson, -1, SQLITE_TRANSIENT);
}
break;
}