/ Check-in [213a6c5c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a couple instances of OOM handling in the json extension.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 213a6c5ccbcfe4495d45e3608e99a6398751aeed
User & Date: drh 2015-08-22 03:05:54
Context
2015-08-22
19:39
Add the json_valid() function to the json1.c extension. Fix various minor problems in the json1.c extension. check-in: 380a9734 user: drh tags: trunk
07:56
Merge further trunk changes. check-in: c2327a3b user: dan tags: begin-concurrent
03:05
Fix a couple instances of OOM handling in the json extension. check-in: 213a6c5c user: drh tags: trunk
01:32
Do not apply the WHERE-clause pushdown optimization to terms that originate in the ON or USING clause of a LEFT JOIN. Fix for ticket [c2a19d81652f40568c]. check-in: 351bc22f user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/misc/json1.c.

   583    583       for(j=i+1;;j++){
   584    584         while( isspace(pParse->zJson[j]) ){ j++; }
   585    585         x = jsonParseValue(pParse, j);
   586    586         if( x<0 ){
   587    587           if( x==(-2) && pParse->nNode==iThis+1 ) return j+1;
   588    588           return -1;
   589    589         }
          590  +      if( pParse->oom ) return -1;
   590    591         if( pParse->aNode[pParse->nNode-1].eType!=JSON_STRING ) return -1;
   591    592         j = x;
   592    593         while( isspace(pParse->zJson[j]) ){ j++; }
   593    594         if( pParse->zJson[j]!=':' ) return -1;
   594    595         j++;
   595    596         x = jsonParseValue(pParse, j);
   596    597         if( x<0 ) return -1;
................................................................................
   635    636           jnFlags = JNODE_ESCAPE;
   636    637         }else if( c=='"' ){
   637    638           break;
   638    639         }
   639    640         j++;
   640    641       }
   641    642       jsonParseAddNode(pParse, JSON_STRING, j+1-i, &pParse->zJson[i]);
   642         -    pParse->aNode[pParse->nNode-1].jnFlags = jnFlags;
          643  +    if( !pParse->oom ) pParse->aNode[pParse->nNode-1].jnFlags = jnFlags;
   643    644       return j+1;
   644    645     }else if( c=='n'
   645    646            && strncmp(pParse->zJson+i,"null",4)==0
   646    647            && !isalnum(pParse->zJson[i+4]) ){
   647    648       jsonParseAddNode(pParse, JSON_NULL, 0, 0);
   648    649       return i+4;
   649    650     }else if( c=='t'