diff options
author | drh <drh@noemail.net> | 2014-10-14 13:41:32 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2014-10-14 13:41:32 +0000 |
commit | 92fe38ece56c01929b8ad949c94a8b7732db496c (patch) | |
tree | 14273daa821b50e1da797883ca36de3a78329512 /src/btree.c | |
parent | 78aad7cd1d026afa649460cf0ed6508c3d88a16e (diff) | |
parent | 8dd8362d6446e8d83fd621122987f048216197c2 (diff) | |
download | sqlite-92fe38ece56c01929b8ad949c94a8b7732db496c.tar.gz sqlite-92fe38ece56c01929b8ad949c94a8b7732db496c.zip |
Merge recent trunk micro-optimizations and the DESC index GROUP BY ORDER BY
bug fix into the sessions branch.
FossilOrigin-Name: 83d4114f2aa404e670ced33511183baacd813a01
Diffstat (limited to 'src/btree.c')
-rw-r--r-- | src/btree.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/btree.c b/src/btree.c index 12dcb44cb..3553924c0 100644 --- a/src/btree.c +++ b/src/btree.c @@ -776,7 +776,7 @@ static int btreeRestoreCursorPosition(BtCursor *pCur){ ** back to where it ought to be if this routine returns true. */ int sqlite3BtreeCursorHasMoved(BtCursor *pCur){ - return pCur && pCur->eState!=CURSOR_VALID; + return pCur->eState!=CURSOR_VALID; } /* @@ -5845,11 +5845,6 @@ static void dropCell(MemPage *pPage, int idx, int sz, int *pRC){ ** in pTemp or the original pCell) and also record its index. ** Allocating a new entry in pPage->aCell[] implies that ** pPage->nOverflow is incremented. -** -** If nSkip is non-zero, then do not copy the first nSkip bytes of the -** cell. The caller will overwrite them after this function returns. If -** nSkip is non-zero, then pCell may not point to an invalid memory location -** (but pCell+nSkip is always valid). */ static void insertCell( MemPage *pPage, /* Page into which we are copying */ @@ -5866,7 +5861,6 @@ static void insertCell( int ins; /* Index in data[] where new cell pointer is inserted */ int cellOffset; /* Address of first cell pointer in data[] */ u8 *data; /* The content of the whole page */ - int nSkip = (iChild ? 4 : 0); if( *pRC ) return; @@ -5884,7 +5878,7 @@ static void insertCell( assert( sz==cellSizePtr(pPage, pCell) || (sz==8 && iChild>0) ); if( pPage->nOverflow || sz+2>pPage->nFree ){ if( pTemp ){ - memcpy(pTemp+nSkip, pCell+nSkip, sz-nSkip); + memcpy(pTemp, pCell, sz); pCell = pTemp; } if( iChild ){ @@ -5913,7 +5907,7 @@ static void insertCell( assert( idx+sz <= (int)pPage->pBt->usableSize ); pPage->nCell++; pPage->nFree -= (u16)(2 + sz); - memcpy(&data[idx+nSkip], pCell+nSkip, sz-nSkip); + memcpy(&data[idx], pCell, sz); if( iChild ){ put4byte(&data[idx], iChild); } |