/ Check-in [7e60347e]
Login

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

Overview
Comment:Fix harmless compiler warnings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | ftsWarnings
Files: files | file ages | folders
SHA1: 7e60347e21a7473974061965a8d1f2eadde987e2
User & Date: mistachkin 2014-05-16 23:38:59
Context
2014-05-17
16:56
Internally, use a 64-bit integers for segment level numbers. check-in: 8180e320 user: dan tags: trunk
2014-05-16
23:38
Fix harmless compiler warnings. Closed-Leaf check-in: 7e60347e user: mistachkin tags: ftsWarnings
23:15
Work around compilation issue with MSVC. check-in: 9623a29c user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts3/fts3_write.c.

  3040   3040   
  3041   3041   /*
  3042   3042   ** A segment of size nByte bytes has just been written to absolute level
  3043   3043   ** iAbsLevel. Promote any segments that should be promoted as a result.
  3044   3044   */
  3045   3045   static int fts3PromoteSegments(
  3046   3046     Fts3Table *p,                   /* FTS table handle */
  3047         -  int iAbsLevel,                  /* Absolute level just updated */
         3047  +  sqlite3_int64 iAbsLevel,        /* Absolute level just updated */
  3048   3048     sqlite3_int64 nByte             /* Size of new segment at iAbsLevel */
  3049   3049   ){
  3050   3050     int rc = SQLITE_OK;
  3051   3051     sqlite3_stmt *pRange;
  3052   3052   
  3053   3053     rc = fts3SqlStmt(p, SQL_SELECT_LEVEL_RANGE2, &pRange, 0);
  3054   3054   
  3055   3055     if( rc==SQLITE_OK ){
  3056   3056       int bOk = 0;
  3057         -    int iLast = (iAbsLevel/FTS3_SEGDIR_MAXLEVEL + 1) * FTS3_SEGDIR_MAXLEVEL - 1;
         3057  +    i64 iLast = (iAbsLevel/FTS3_SEGDIR_MAXLEVEL + 1) * FTS3_SEGDIR_MAXLEVEL - 1;
  3058   3058       i64 nLimit = (nByte*3)/2;
  3059   3059   
  3060   3060       /* Loop through all entries in the %_segdir table corresponding to 
  3061   3061       ** segments in this index on levels greater than iAbsLevel. If there is
  3062   3062       ** at least one such segment, and it is possible to determine that all 
  3063   3063       ** such segments are smaller than nLimit bytes in size, they will be 
  3064   3064       ** promoted to level iAbsLevel.  */
  3065         -    sqlite3_bind_int(pRange, 1, iAbsLevel+1);
  3066         -    sqlite3_bind_int(pRange, 2, iLast);
         3065  +    sqlite3_bind_int64(pRange, 1, iAbsLevel+1);
         3066  +    sqlite3_bind_int64(pRange, 2, iLast);
  3067   3067       while( SQLITE_ROW==sqlite3_step(pRange) ){
  3068   3068         i64 nSize, dummy;
  3069   3069         fts3ReadEndBlockField(pRange, 2, &dummy, &nSize);
  3070   3070         if( nSize<=0 || nSize>nLimit ){
  3071   3071           /* If nSize==0, then the %_segdir.end_block field does not not 
  3072   3072           ** contain a size value. This happens if it was written by an
  3073   3073           ** old version of FTS. In this case it is not possible to determine
................................................................................
  3099   3099           ** updated it to set (level = -1) and (idx = N), where N is 0 for the
  3100   3100           ** oldest segment in the range, 1 for the next oldest, and so on.
  3101   3101           **
  3102   3102           ** In other words, move all segments being promoted to level -1,
  3103   3103           ** setting the "idx" fields as appropriate to keep them in the same
  3104   3104           ** order. The contents of level -1 (which is never used, except
  3105   3105           ** transiently here), will be moved back to level iAbsLevel below.  */
  3106         -        sqlite3_bind_int(pRange, 1, iAbsLevel);
         3106  +        sqlite3_bind_int64(pRange, 1, iAbsLevel);
  3107   3107           while( SQLITE_ROW==sqlite3_step(pRange) ){
  3108   3108             sqlite3_bind_int(pUpdate1, 1, iIdx++);
  3109   3109             sqlite3_bind_int(pUpdate1, 2, sqlite3_column_int(pRange, 0));
  3110   3110             sqlite3_bind_int(pUpdate1, 3, sqlite3_column_int(pRange, 1));
  3111   3111             sqlite3_step(pUpdate1);
  3112   3112             rc = sqlite3_reset(pUpdate1);
  3113   3113             if( rc!=SQLITE_OK ){
................................................................................
  3118   3118         }
  3119   3119         if( rc==SQLITE_OK ){
  3120   3120           rc = sqlite3_reset(pRange);
  3121   3121         }
  3122   3122   
  3123   3123         /* Move level -1 to level iAbsLevel */
  3124   3124         if( rc==SQLITE_OK ){
  3125         -        sqlite3_bind_int(pUpdate2, 1, iAbsLevel);
         3125  +        sqlite3_bind_int64(pUpdate2, 1, iAbsLevel);
  3126   3126           sqlite3_step(pUpdate2);
  3127   3127           rc = sqlite3_reset(pUpdate2);
  3128   3128         }
  3129   3129       }
  3130   3130     }
  3131   3131   
  3132   3132