mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
It is an error to try to insert a BLOB value into JSON.
FossilOrigin-Name: 28c6e964b1e2257527df02b352f02e135f7c4b764b8b41eda6461f9538f5d042
This commit is contained in:
15
src/json.c
15
src/json.c
@@ -733,10 +733,12 @@ static void jsonReturnJson(
|
||||
sqlite3_result_error_nomem(pCtx);
|
||||
return;
|
||||
}
|
||||
jsonInit(&s, pCtx);
|
||||
jsonRenderNode(pParse, pNode, &s);
|
||||
jsonResult(&s);
|
||||
sqlite3_result_subtype(pCtx, JSON_SUBTYPE);
|
||||
if( pParse->nErr==0 ){
|
||||
jsonInit(&s, pCtx);
|
||||
jsonRenderNode(pParse, pNode, &s);
|
||||
jsonResult(&s);
|
||||
sqlite3_result_subtype(pCtx, JSON_SUBTYPE);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2705,6 +2707,11 @@ static void jsonReplaceNode(
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SQLITE_BLOB: {
|
||||
sqlite3_result_error(pCtx, "JSON cannot hold BLOB values", -1);
|
||||
p->nErr++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user