aboutsummaryrefslogtreecommitdiff
path: root/ext/misc/json1.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2016-11-07 18:18:08 +0000
committerdrh <drh@noemail.net>2016-11-07 18:18:08 +0000
commit6850a633938816b123b52af6a7f2fa45e7f6c252 (patch)
treeabc1013b64de429f684faed8e1455890d6673405 /ext/misc/json1.c
parent27b2d1b88b432d7145bb7ba540e8d6552a91d89f (diff)
downloadsqlite-6850a633938816b123b52af6a7f2fa45e7f6c252.tar.gz
sqlite-6850a633938816b123b52af6a7f2fa45e7f6c252.zip
Fix OOM error reporting in the json1_group_object() SQL function. Remove
an unreachable branch from the JSON1 logic. FossilOrigin-Name: b54098491531cd26ed461275ef4aae3d3ec9065e
Diffstat (limited to 'ext/misc/json1.c')
-rw-r--r--ext/misc/json1.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/misc/json1.c b/ext/misc/json1.c
index df6aa7324..327ad5750 100644
--- a/ext/misc/json1.c
+++ b/ext/misc/json1.c
@@ -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;
}