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

Add the experimental sqlite3_transaction_hook() API.

FossilOrigin-Name: 093d8cd8e2f3a6af5d40cf810e396f4919eb5cef
This commit is contained in:
dan
2011-03-03 20:05:59 +00:00
parent 46c47d4677
commit 21e8d0126d
11 changed files with 282 additions and 32 deletions

View File

@@ -401,7 +401,15 @@ static int sqlite3Step(Vdbe *p){
#endif
db->activeVdbeCnt++;
if( p->readOnly==0 ) db->writeVdbeCnt++;
if( p->readOnly==0 ){
/* If this statement will open an implicit transaction, invoke the
** transaction-hook here. */
if( db->autoCommit && db->writeVdbeCnt==0 ){
assert( db->nSavepoint==0 );
sqlite3TransactionHook(db, SQLITE_BEGIN, 0);
}
db->writeVdbeCnt++;
}
p->pc = 0;
}
#ifndef SQLITE_OMIT_EXPLAIN