/ Check-in [cd9efeb3]
Login

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

Overview
Comment:Fix an accidental fork on branch-3.7.9.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-3.7.9
Files: files | file ages | folders
SHA1: cd9efeb3eb28efc6a92904bb426c3a50f95fc936
User & Date: drh 2012-10-05 18:38:26
Context
2012-10-05
19:10
Add QNX-specific performance tweaks to the unix VFS. check-in: b02849e7 user: drh tags: branch-3.7.9
18:38
Fix an accidental fork on branch-3.7.9. check-in: cd9efeb3 user: drh tags: branch-3.7.9
18:35
Backport fixes to shared-cache mode, from the shared-cache-fix branch, to version 3.7.9 check-in: ac81ae49 user: drh tags: branch-3.7.9
2011-11-14
02:53
Fix a 8-byte alignment problem that causes a SIGBUS on Sparc. check-in: 54cc1198 user: drh tags: branch-3.7.9
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/build.c.

  2680   2680   
  2681   2681     /* 
  2682   2682     ** Allocate the index structure. 
  2683   2683     */
  2684   2684     nName = sqlite3Strlen30(zName);
  2685   2685     nCol = pList->nExpr;
  2686   2686     pIndex = sqlite3DbMallocZero(db, 
  2687         -      sizeof(Index) +              /* Index structure  */
  2688         -      sizeof(tRowcnt)*(nCol+1) +   /* Index.aiRowEst   */
  2689         -      sizeof(int)*nCol +           /* Index.aiColumn   */
  2690         -      sizeof(char *)*nCol +        /* Index.azColl     */
  2691         -      sizeof(u8)*nCol +            /* Index.aSortOrder */
  2692         -      nName + 1 +                  /* Index.zName      */
  2693         -      nExtra                       /* Collation sequence names */
         2687  +      sizeof(Index) +                      /* Index structure  */
         2688  +      ROUND8(sizeof(tRowcnt)*(nCol+1)) +   /* Index.aiRowEst   */
         2689  +      sizeof(char *)*nCol +                /* Index.azColl     */
         2690  +      sizeof(int)*nCol +                   /* Index.aiColumn   */
         2691  +      sizeof(u8)*nCol +                    /* Index.aSortOrder */
         2692  +      nName + 1 +                          /* Index.zName      */
         2693  +      nExtra                               /* Collation sequence names */
  2694   2694     );
  2695   2695     if( db->mallocFailed ){
  2696   2696       goto exit_create_index;
  2697   2697     }
  2698   2698     pIndex->aiRowEst = (tRowcnt*)(&pIndex[1]);
  2699         -  pIndex->azColl = (char**)(&pIndex->aiRowEst[nCol+1]);
         2699  +  pIndex->azColl = (char**)
         2700  +     ((char*)pIndex->aiRowEst + ROUND8(sizeof(tRowcnt)*nCol+1));
         2701  +  assert( EIGHT_BYTE_ALIGNMENT(pIndex->aiRowEst) );
         2702  +  assert( EIGHT_BYTE_ALIGNMENT(pIndex->azColl) );
  2700   2703     pIndex->aiColumn = (int *)(&pIndex->azColl[nCol]);
  2701   2704     pIndex->aSortOrder = (u8 *)(&pIndex->aiColumn[nCol]);
  2702   2705     pIndex->zName = (char *)(&pIndex->aSortOrder[nCol]);
  2703   2706     zExtra = (char *)(&pIndex->zName[nName+1]);
  2704   2707     memcpy(pIndex->zName, zName, nName+1);
  2705   2708     pIndex->pTable = pTab;
  2706   2709     pIndex->nColumn = pList->nExpr;