diff options
author | drh <drh@noemail.net> | 2016-02-05 01:55:27 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2016-02-05 01:55:27 +0000 |
commit | 4a642b60607e55a2c25f663b472af3609c76b214 (patch) | |
tree | d4af5d6c69d8cde0c32bfcc7a427eb34c2815080 /ext/misc/json1.c | |
parent | e514f651d0fb5364e6495b9d6c4dd80ca51a227f (diff) | |
download | sqlite-4a642b60607e55a2c25f663b472af3609c76b214.tar.gz sqlite-4a642b60607e55a2c25f663b472af3609c76b214.zip |
Improvements to the way that OOM errors are processed.
FossilOrigin-Name: c3ef03478a5788c855b3aef385d43ae7f494f440
Diffstat (limited to 'ext/misc/json1.c')
-rw-r--r-- | ext/misc/json1.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/misc/json1.c b/ext/misc/json1.c index e4ea4fb9f..3c63b6e94 100644 --- a/ext/misc/json1.c +++ b/ext/misc/json1.c @@ -343,7 +343,7 @@ static void jsonAppendValue( default: { if( p->bErr==0 ){ sqlite3_result_error(p->pCtx, "JSON cannot hold BLOB values", -1); - p->bErr = 1; + p->bErr = 2; jsonReset(p); } break; @@ -1571,7 +1571,7 @@ static void jsonArrayFinal(sqlite3_context *ctx){ pStr->pCtx = ctx; jsonAppendChar(pStr, ']'); if( pStr->bErr ){ - 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, @@ -1619,7 +1619,7 @@ static void jsonObjectFinal(sqlite3_context *ctx){ if( pStr ){ jsonAppendChar(pStr, '}'); if( pStr->bErr ){ - sqlite3_result_error_nomem(ctx); + if( pStr->bErr==0 ) sqlite3_result_error_nomem(ctx); assert( pStr->bStatic ); }else{ sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed, |