Merge updates from trunk.

FossilOrigin-Name: 5cbab63756f6f276996f39d16d70b178581f63cd
This commit is contained in:
mistachkin
2016-01-06 20:50:02 +00:00
15 changed files with 75 additions and 71 deletions
+3 -3
View File
@@ -2964,9 +2964,9 @@ struct StrAccum {
sqlite3 *db; /* Optional database for lookaside. Can be NULL */
char *zBase; /* A base allocation. Not from malloc. */
char *zText; /* The string collected so far */
int nChar; /* Length of the string so far */
int nAlloc; /* Amount of space allocated in zText */
int mxAlloc; /* Maximum allowed allocation. 0 for no malloc usage */
u32 nChar; /* Length of the string so far */
u32 nAlloc; /* Amount of space allocated in zText */
u32 mxAlloc; /* Maximum allowed allocation. 0 for no malloc usage */
u8 accError; /* STRACCUM_NOMEM or STRACCUM_TOOBIG */
u8 bMalloced; /* zText points to allocated space */
};
+11 -2
View File
@@ -70,7 +70,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#if SQLITE_OS_UNIX
#if SQLITE_OS_UNIX || defined(__MINGW_H)
# include <unistd.h>
# include <dirent.h>
# ifndef DIRENT
@@ -79,7 +79,9 @@
#endif
#if SQLITE_OS_WIN
# include <io.h>
# include "test_windirent.h"
# if !defined(__MINGW_H)
# include "test_windirent.h"
# endif
# ifndef S_ISREG
# define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
# endif
@@ -231,7 +233,14 @@ static int fsdirNext(sqlite3_vtab_cursor *cur){
if( pCsr->pDir ){
struct DIRENT *pRes = 0;
#if defined(__MINGW_H)
pRes = readdir(pCsr->pDir);
if( pRes!=0 ){
memcpy(&pCsr->entry, pRes, sizeof(struct DIRENT));
}
#else
readdir_r(pCsr->pDir, &pCsr->entry, &pRes);
#endif
if( pRes==0 ){
closedir(pCsr->pDir);
pCsr->pDir = 0;
+1 -1
View File
@@ -2524,7 +2524,7 @@ case OP_Column: {
goto op_column_error;
}
}else{
VVA_ONLY( t = 0; ) /* Only needed by assert() statements */
t = 0;
}
/* If after trying to extract new entries from the header, nHdrParsed is
+14 -6
View File
@@ -1848,19 +1848,27 @@ void sqlite3VdbeMakeReady(
*/
nMem += nCursor;
/* Allocate space for memory registers, SQL variables, VDBE cursors and
** an array to marshal SQL function arguments in.
/* zCsr will initially point to nFree bytes of unused space at the
** end of the opcode array, p->aOp. The computation of nFree is
** conservative - it might be smaller than the true number of free
** bytes, but never larger. nFree must be a multiple of 8 - it is
** rounded down if is not.
*/
zCsr = ((u8*)p->aOp) + ROUND8(sizeof(Op)*p->nOp); /* Available space */
nFree = pParse->szOpAlloc - ROUND8(sizeof(Op)*p->nOp); /* Size of zCsr */
n = ROUND8(sizeof(Op)*p->nOp); /* Bytes of opcode space used */
zCsr = &((u8*)p->aOp)[n]; /* Unused opcode space */
assert( EIGHT_BYTE_ALIGNMENT(zCsr) );
nFree = ROUNDDOWN8(pParse->szOpAlloc - n); /* Bytes of unused space */
assert( nFree>=0 );
if( nFree>0 ){
memset(zCsr, 0, nFree);
assert( EIGHT_BYTE_ALIGNMENT(&zCsr[nFree]) );
}
resolveP2Values(p, &nArg);
p->usesStmtJournal = (u8)(pParse->isMultiWrite && pParse->mayAbort);
if( pParse->explain && nMem<10 ){
nMem = 10;
}
memset(zCsr, 0, nFree);
assert( EIGHT_BYTE_ALIGNMENT(&zCsr[nFree]) );
p->expired = 0;
/* Memory for registers, parameters, cursor, etc, is allocated in two