/ Check-in [ebf6eb6e]
Login

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

Overview
Comment:Forward port the 8-byte alignment fix from branch-3.7.9.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ebf6eb6ed756c0a3158b4cb5fb4b460c79d93c29
User & Date: drh 2011-11-14 03:00:28
Context
2011-11-16
08:18
Update memsubsys1.test to account for the recently increased size of the MemPage structure in btreeInt.h. check-in: 4fb3ca75 user: dan tags: trunk
2011-11-14
03:00
Forward port the 8-byte alignment fix from branch-3.7.9. check-in: ebf6eb6e user: drh tags: trunk
02:53
Fix a 8-byte alignment problem that causes a SIGBUS on Sparc. check-in: 54cc1198 user: drh tags: branch-3.7.9
2011-11-12
16:46
Remove a couple of incorrect assert statements so that the test suite will run with -DSQLITE_DEFAULT_CACHE_SIZE=0. check-in: 87614b62 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/build.c.

  2657   2657   
  2658   2658     /* 
  2659   2659     ** Allocate the index structure. 
  2660   2660     */
  2661   2661     nName = sqlite3Strlen30(zName);
  2662   2662     nCol = pList->nExpr;
  2663   2663     pIndex = sqlite3DbMallocZero(db, 
  2664         -      sizeof(Index) +              /* Index structure  */
  2665         -      sizeof(tRowcnt)*(nCol+1) +   /* Index.aiRowEst   */
  2666         -      sizeof(int)*nCol +           /* Index.aiColumn   */
  2667         -      sizeof(char *)*nCol +        /* Index.azColl     */
  2668         -      sizeof(u8)*nCol +            /* Index.aSortOrder */
  2669         -      nName + 1 +                  /* Index.zName      */
  2670         -      nExtra                       /* Collation sequence names */
         2664  +      sizeof(Index) +                      /* Index structure  */
         2665  +      ROUND8(sizeof(tRowcnt)*(nCol+1)) +   /* Index.aiRowEst   */
         2666  +      sizeof(char *)*nCol +                /* Index.azColl     */
         2667  +      sizeof(int)*nCol +                   /* Index.aiColumn   */
         2668  +      sizeof(u8)*nCol +                    /* Index.aSortOrder */
         2669  +      nName + 1 +                          /* Index.zName      */
         2670  +      nExtra                               /* Collation sequence names */
  2671   2671     );
  2672   2672     if( db->mallocFailed ){
  2673   2673       goto exit_create_index;
  2674   2674     }
  2675   2675     pIndex->aiRowEst = (tRowcnt*)(&pIndex[1]);
  2676         -  pIndex->azColl = (char**)(&pIndex->aiRowEst[nCol+1]);
         2676  +  pIndex->azColl = (char**)
         2677  +     ((char*)pIndex->aiRowEst + ROUND8(sizeof(tRowcnt)*nCol+1));
         2678  +  assert( EIGHT_BYTE_ALIGNMENT(pIndex->aiRowEst) );
         2679  +  assert( EIGHT_BYTE_ALIGNMENT(pIndex->azColl) );
  2677   2680     pIndex->aiColumn = (int *)(&pIndex->azColl[nCol]);
  2678   2681     pIndex->aSortOrder = (u8 *)(&pIndex->aiColumn[nCol]);
  2679   2682     pIndex->zName = (char *)(&pIndex->aSortOrder[nCol]);
  2680   2683     zExtra = (char *)(&pIndex->zName[nName+1]);
  2681   2684     memcpy(pIndex->zName, zName, nName+1);
  2682   2685     pIndex->pTable = pTab;
  2683   2686     pIndex->nColumn = pList->nExpr;