aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2008-04-25 12:25:42 +0000
committerdrh <drh@noemail.net>2008-04-25 12:25:42 +0000
commit82ed1e5b37c72eb7533f0355a47c7799ce945eb5 (patch)
treeda91c36062a1f6fa4ef874d41202314da6c3a9d5 /src
parent05a3e474cb3f835f6642ce8736f5f8cb9323ffc9 (diff)
downloadsqlite-82ed1e5b37c72eb7533f0355a47c7799ce945eb5.tar.gz
sqlite-82ed1e5b37c72eb7533f0355a47c7799ce945eb5.zip
Clarify some comments. No changes to code. (CVS 5049)
FossilOrigin-Name: 7f80539225b17a62e4aa09e6d514e3e9e1b22c36
Diffstat (limited to 'src')
-rw-r--r--src/pager.c11
-rw-r--r--src/vdbe.c14
2 files changed, 22 insertions, 3 deletions
diff --git a/src/pager.c b/src/pager.c
index 6c6fca4c5..bf7da6c93 100644
--- a/src/pager.c
+++ b/src/pager.c
@@ -18,7 +18,7 @@
** file simultaneously, or one process from reading the database while
** another is writing.
**
-** @(#) $Id: pager.c,v 1.434 2008/04/24 12:37:40 danielk1977 Exp $
+** @(#) $Id: pager.c,v 1.435 2008/04/25 12:25:42 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
@@ -3084,6 +3084,15 @@ static PgHdr *pager_get_all_dirty_pages(Pager *pPager){
** database with the same name. Just delete the journal.
**
** Return negative if unable to determine the status of the journal.
+**
+** This routine does not open the journal file to examine its
+** content. Hence, the journal might contain the name of a master
+** journal file that has been deleted, and hence not be hot. Or
+** the header of the journal might be zeroed out. This routine
+** does not discover these cases of a non-hot journal - if the
+** journal file exists and is not empty this routine assumes it
+** is hot. The pager_playback() routine will discover that the
+** journal file is not really hot and will no-op.
*/
static int hasHotJournal(Pager *pPager){
sqlite3_vfs *pVfs = pPager->pVfs;
diff --git a/src/vdbe.c b/src/vdbe.c
index 43eab1b23..78183fcfa 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -43,7 +43,7 @@
** in this file for details. If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code.
**
-** $Id: vdbe.c,v 1.734 2008/04/24 19:15:11 shane Exp $
+** $Id: vdbe.c,v 1.735 2008/04/25 12:25:42 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -2268,11 +2268,21 @@ case OP_MakeRecord: {
/* Opcode: Statement P1 * * * *
**
** Begin an individual statement transaction which is part of a larger
-** BEGIN..COMMIT transaction. This is needed so that the statement
+** transaction. This is needed so that the statement
** can be rolled back after an error without having to roll back the
** entire transaction. The statement transaction will automatically
** commit when the VDBE halts.
**
+** If the database connection is currently in autocommit mode (that
+** is to say, if it is in between BEGIN and COMMIT)
+** and if there are no other active statements on the same database
+** connection, then this operation is a no-op. No statement transaction
+** is needed since any error can use the normal ROLLBACK process to
+** undo changes.
+**
+** If a statement transaction is started, then a statement journal file
+** will be allocated and initialized.
+**
** The statement is begun on the database file with index P1. The main
** database file has an index of 0 and the file used for temporary tables
** has an index of 1.