Fix OOM error reporting in the json1_group_object() SQL function. Remove

an unreachable branch from the JSON1 logic.

FossilOrigin-Name: b54098491531cd26ed461275ef4aae3d3ec9065e
This commit is contained in:
drh
2016-11-07 18:18:08 +00:00
parent 27b2d1b88b
commit 6850a63393
3 changed files with 10 additions and 10 deletions
+3 -3
View File
@@ -1662,7 +1662,7 @@ static void jsonObjectFinal(sqlite3_context *ctx){
if( pStr ){
jsonAppendChar(pStr, '}');
if( pStr->bErr ){
if( pStr->bErr==0 ) sqlite3_result_error_nomem(ctx);
if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx);
assert( pStr->bStatic );
}else{
sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed,
@@ -1940,9 +1940,9 @@ static int jsonEachColumn(
/* For json_each() path and root are the same so fall through
** into the root case */
}
case JEACH_ROOT: {
default: {
const char *zRoot = p->zRoot;
if( zRoot==0 ) zRoot = "$";
if( zRoot==0 ) zRoot = "$";
sqlite3_result_text(ctx, zRoot, -1, SQLITE_STATIC);
break;
}