diff options
author | drh <drh@noemail.net> | 2015-08-24 02:32:04 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2015-08-24 02:32:04 +0000 |
commit | 442a7c601505dc0aec141b1b05450ddb530562e4 (patch) | |
tree | 24be0f46bb7d41961fbda80327c91eefff8d3d62 /ext/misc/json1.c | |
parent | e792b5b4206a50fcd3ba96cc653329e9f27dc9bc (diff) | |
download | sqlite-442a7c601505dc0aec141b1b05450ddb530562e4.tar.gz sqlite-442a7c601505dc0aec141b1b05450ddb530562e4.zip |
Fix corner-case problems in the type and atom columns of json_each() and
json_tree().
FossilOrigin-Name: f0aba0e120074430cd7ad93291fcc97b8a25a054
Diffstat (limited to 'ext/misc/json1.c')
-rw-r--r-- | ext/misc/json1.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/misc/json1.c b/ext/misc/json1.c index ca2292830..4945826b9 100644 --- a/ext/misc/json1.c +++ b/ext/misc/json1.c @@ -1513,12 +1513,12 @@ static int jsonEachColumn( break; } case JEACH_TYPE: { - if( p->eType==JSON_OBJECT ) pThis++; + if( p->eType==JSON_OBJECT && p->i>0 ) pThis++; sqlite3_result_text(ctx, jsonType[pThis->eType], -1, SQLITE_STATIC); break; } case JEACH_ATOM: { - if( p->eType==JSON_OBJECT ) pThis++; + if( p->eType==JSON_OBJECT && p->i>0 ) pThis++; if( pThis->eType>=JSON_ARRAY ) break; jsonReturn(pThis, ctx, 0); break; |