/ Check-in [3087a0c3]
Login

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

Overview
Comment:When extending the size of SrcList objects, do not attempt to use extra space on the end of the allocation, as that provides scarcely any performance benefit but does greatly complicate cross-platform testing.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:3087a0c31e9fbfaedb7cf10a2fda59bc22318ff178614aefcc00ac83d9a7bb14
User & Date: drh 2019-02-06 01:18:36
Context
2019-02-06
13:41
Fix a problem preventing testfixture from being built with SQLITE_OMIT_VIRTUALTABLE. check-in: d2cca36a user: dan tags: trunk
01:18
When extending the size of SrcList objects, do not attempt to use extra space on the end of the allocation, as that provides scarcely any performance benefit but does greatly complicate cross-platform testing. check-in: 3087a0c3 user: drh tags: trunk
00:55
If the query flattener detects an error, cause the SELECT code generator to abort immediately. check-in: 3d3b142f user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/build.c.

  3874   3874     assert( pSrc!=0 );
  3875   3875     assert( iStart<=pSrc->nSrc );
  3876   3876   
  3877   3877     /* Allocate additional space if needed */
  3878   3878     if( (u32)pSrc->nSrc+nExtra>pSrc->nAlloc ){
  3879   3879       SrcList *pNew;
  3880   3880       int nAlloc = pSrc->nSrc*2+nExtra;
  3881         -    int nGot;
  3882   3881       sqlite3 *db = pParse->db;
  3883   3882   
  3884   3883       if( pSrc->nSrc+nExtra>=SQLITE_MAX_SRCLIST ){
  3885   3884         sqlite3ErrorMsg(pParse, "too many FROM clause terms, max: %d",
  3886   3885                         SQLITE_MAX_SRCLIST);
  3887   3886         return 0;
  3888   3887       }
................................................................................
  3890   3889       pNew = sqlite3DbRealloc(db, pSrc,
  3891   3890                  sizeof(*pSrc) + (nAlloc-1)*sizeof(pSrc->a[0]) );
  3892   3891       if( pNew==0 ){
  3893   3892         assert( db->mallocFailed );
  3894   3893         return 0;
  3895   3894       }
  3896   3895       pSrc = pNew;
  3897         -    nGot = (sqlite3DbMallocSize(db, pNew) - sizeof(*pSrc))/sizeof(pSrc->a[0])+1;
  3898         -    pSrc->nAlloc = nGot;
         3896  +    pSrc->nAlloc = nAlloc;
  3899   3897     }
  3900   3898   
  3901   3899     /* Move existing slots that come after the newly inserted slots
  3902   3900     ** out of the way */
  3903   3901     for(i=pSrc->nSrc-1; i>=iStart; i--){
  3904   3902       pSrc->a[i+nExtra] = pSrc->a[i];
  3905   3903     }