1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Merge in the latest trunk changes, including partial indexes, the MAX_PATH

fix in os_win.c, and the sqlite3_cancel_auto_extension() API.

FossilOrigin-Name: 7e1acb390770d1bd189fac7a3a7f96106f96e3a4
This commit is contained in:
drh
2013-08-02 20:44:48 +00:00
42 changed files with 1323 additions and 470 deletions

View File

@@ -565,7 +565,7 @@ int sqlite3VdbeExec(
int iCompare = 0; /* Result of last OP_Compare operation */
unsigned nVmStep = 0; /* Number of virtual machine steps */
#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
unsigned nProgressOps = 0; /* nVmStep at last progress callback. */
unsigned nProgressLimit; /* Invoke xProgress() when nVmStep reaches this */
#endif
Mem *aMem = p->aMem; /* Copy of p->aMem */
Mem *pIn1 = 0; /* 1st input operand */
@@ -595,6 +595,17 @@ int sqlite3VdbeExec(
db->busyHandler.nBusy = 0;
CHECK_FOR_INTERRUPT;
sqlite3VdbeIOTraceSql(p);
#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
if( db->xProgress ){
assert( 0 < db->nProgressOps );
nProgressLimit = (unsigned)p->aCounter[SQLITE_STMTSTATUS_VM_STEP-1];
if( nProgressLimit==0 ){
nProgressLimit = db->nProgressOps;
}else{
nProgressLimit %= (unsigned)db->nProgressOps;
}
}
#endif
#ifdef SQLITE_DEBUG
sqlite3BeginBenignMalloc();
if( p->pc==0 && (p->db->flags & SQLITE_VdbeListing)!=0 ){
@@ -755,14 +766,16 @@ check_for_interrupt:
** If the progress callback returns non-zero, exit the virtual machine with
** a return code SQLITE_ABORT.
*/
if( db->xProgress!=0 && (nVmStep - nProgressOps)>=db->nProgressOps ){
if( db->xProgress!=0 && nVmStep>=nProgressLimit ){
int prc;
prc = db->xProgress(db->pProgressArg);
if( prc!=0 ){
rc = SQLITE_INTERRUPT;
goto vdbe_error_halt;
}
nProgressOps = nVmStep;
if( db->xProgress!=0 ){
nProgressLimit = nVmStep + db->nProgressOps - (nVmStep%db->nProgressOps);
}
}
#endif
@@ -1430,19 +1443,14 @@ case OP_Function: {
REGISTER_TRACE(pOp->p2+i, pArg);
}
assert( pOp->p4type==P4_FUNCDEF || pOp->p4type==P4_VDBEFUNC );
if( pOp->p4type==P4_FUNCDEF ){
ctx.pFunc = pOp->p4.pFunc;
ctx.pVdbeFunc = 0;
}else{
ctx.pVdbeFunc = (VdbeFunc*)pOp->p4.pVdbeFunc;
ctx.pFunc = ctx.pVdbeFunc->pFunc;
}
assert( pOp->p4type==P4_FUNCDEF );
ctx.pFunc = pOp->p4.pFunc;
ctx.s.flags = MEM_Null;
ctx.s.db = db;
ctx.s.xDel = 0;
ctx.s.zMalloc = 0;
ctx.iOp = pc;
ctx.pVdbe = p;
/* The output cell may already have a buffer allocated. Move
** the pointer to ctx.s so in case the user-function can use
@@ -1465,11 +1473,7 @@ case OP_Function: {
/* If any auxiliary data functions have been called by this user function,
** immediately call the destructor for any non-static values.
*/
if( ctx.pVdbeFunc ){
sqlite3VdbeDeleteAuxData(ctx.pVdbeFunc, pOp->p1);
pOp->p4.pVdbeFunc = ctx.pVdbeFunc;
pOp->p4type = P4_VDBEFUNC;
}
sqlite3VdbeDeleteAuxData(p, pc, pOp->p1);
if( db->mallocFailed ){
/* Even though a malloc() has failed, the implementation of the