Index: src/analyze.c ================================================================== --- src/analyze.c +++ src/analyze.c @@ -337,11 +337,11 @@ } } if( !doInsert ) return; if( p->nSample==p->mxSample ){ if( iMinnSample ){ - memcpy(&p->a[iMin], &p->a[iMin+1], sizeof(p->a[0])*(p->nSample-iMin)); + memmove(&p->a[iMin], &p->a[iMin+1], sizeof(p->a[0])*(p->nSample-iMin-1)); } pSample = &p->a[p->nSample-1]; }else{ pSample = &p->a[p->nSample++]; } Index: src/where.c ================================================================== --- src/where.c +++ src/where.c @@ -2923,11 +2923,11 @@ */ for(; pProbe; pIdx=pProbe=pProbe->pNext){ const tRowcnt * const aiRowEst = pProbe->aiRowEst; double cost; /* Cost of using pProbe */ double nRow; /* Estimated number of rows in result set */ - double log10N; /* base-10 logarithm of nRow (inexact) */ + double log10N = (double)1; /* base-10 logarithm of nRow (inexact) */ int rev; /* True to scan in reverse order */ int wsFlags = 0; Bitmask used = 0; /* The following variables are populated based on the properties of