1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Update the sessions branch to include the SQLLOG enhancement, the

SQLITE_IOERR_DELETE_NOENT fix, and a fix for the number-of-documents
bug in FTS4.

FossilOrigin-Name: ba8d08b67021a32fda069c18b7eb93523e6f0d1f
This commit is contained in:
drh
2012-11-27 21:56:28 +00:00
14 changed files with 681 additions and 52 deletions

View File

@@ -53,7 +53,7 @@ Vdbe *sqlite3VdbeCreate(sqlite3 *db){
void sqlite3VdbeSetSql(Vdbe *p, const char *z, int n, int isPrepareV2){
assert( isPrepareV2==1 || isPrepareV2==0 );
if( p==0 ) return;
#ifdef SQLITE_OMIT_TRACE
#if defined(SQLITE_OMIT_TRACE) && !defined(SQLITE_ENABLE_SQLLOG)
if( !isPrepareV2 ) return;
#endif
assert( p->zSql==0 );
@@ -2327,6 +2327,27 @@ int sqlite3VdbeTransferError(Vdbe *p){
return rc;
}
#ifdef SQLITE_ENABLE_SQLLOG
/*
** If an SQLITE_CONFIG_SQLLOG hook is registered and the VM has been run,
** invoke it.
*/
static void vdbeInvokeSqllog(Vdbe *v){
if( sqlite3GlobalConfig.xSqllog && v->rc==SQLITE_OK && v->zSql && v->pc>=0 ){
char *zExpanded = sqlite3VdbeExpandSql(v, v->zSql);
assert( v->db->init.busy==0 );
if( zExpanded ){
sqlite3GlobalConfig.xSqllog(
sqlite3GlobalConfig.pSqllogArg, v->db, zExpanded, 1
);
sqlite3DbFree(v->db, zExpanded);
}
}
}
#else
# define vdbeInvokeSqllog(x)
#endif
/*
** Clean up a VDBE after execution but do not delete the VDBE just yet.
** Write any error messages into *pzErrMsg. Return the result code.
@@ -2354,6 +2375,7 @@ int sqlite3VdbeReset(Vdbe *p){
** instructions yet, leave the main database error information unchanged.
*/
if( p->pc>=0 ){
vdbeInvokeSqllog(p);
sqlite3VdbeTransferError(p);
sqlite3DbFree(db, p->zErrMsg);
p->zErrMsg = 0;