-C Fix\scompiler\swarnings\sin\spager.c\s(CVS\s6102)
-D 2009-01-02T18:10:42
+C Reinitialize\spage\s1\sof\sthe\sdatabase\sfile\sfollowing\sa\sROLLBACK\sTO\sof\sa\ntransactional\sSAVEPOINT\son\san\sinitially\sempty\sdatabase.\s(CVS\s6103)
+D 2009-01-02T21:08:09
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 05461a9b5803d5ad10c79f989801e9fd2cc3e592
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/auth.c c8b2ab5c8bad4bd90ed7c294694f48269162c627
F src/bitvec.c 4300d311b17fb3c1476623fd895a8feac02a0b08
F src/btmutex.c 63c5cc4ad5715690767ffcb741e185d7bc35ec1a
-F src/btree.c 2a89b28a87a821cf27b04820161cf3cc2dd99725
+F src/btree.c b0cf3e7273ba20fe280fc7c889f972419562076d
F src/btree.h 4f141cf748d2ee7c6d7fc175f64f87a45cd44113
F src/btreeInt.h 8fea5cd7021cb8848fc2183a3e909469659daa0a
F src/build.c 6eb9d20e99db8da8c7c6e7316096a6ff3d9acab9
F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5
F src/os_unix.c e6eacc7ec735ded605fefcbaf250058baa8feb12
F src/os_win.c 496e3ceb499aedc63622a89ef76f7af2dd902709
-F src/pager.c 22f2896d2a539ca7285eab0fb667d1bdeea66ffa
+F src/pager.c 151cc07325103ac217cd483e2aa67cb128aae1eb
F src/pager.h 75396879910768a0af03a4af8413e798d84c096f
F src/parse.y 4d0e33a702dc3ea7b69d8ae1914b3fbd32e46057
F src/pcache.c 16dc8da6e6ba6250f8dfd9ee46036db1cbceedc6
F src/utf.c 1da9c832dba0fa8f865b5b902d93f420a1ee4245
F src/util.c ea62608f66f33a7e8322de83024ae37c415c0c7f
F src/vacuum.c 383d6297bddc011ab04a9eed110db6eaf523e8e9
-F src/vdbe.c aa4674ce5de9bb928c03692ae8a680263937fe81
+F src/vdbe.c 687e481528acc92a42959accafa8e41dfa46f95d
F src/vdbe.h 03516f28bf5aca00a53c4dccd6c313f96adb94f6
F src/vdbeInt.h e6e80a99ce634983b7cc2498843b4d2e5540900a
F src/vdbeapi.c 85c33cfbfa56249cbe627831610afafba754477d
F test/savepoint2.test 18f6c75d5c133b93838019df8988b8cdf379d3de
F test/savepoint3.test 1a0b1c0f59c6ae4402bfbca7cec29d4b1b272ff0
F test/savepoint4.test fd8850063e3c40565545f5c291e7f79a30591670
+F test/savepoint5.test 0735db177e0ebbaedc39812c8d065075d563c4fd
F test/schema.test a8b000723375fd42c68d310091bdbd744fde647c
F test/schema2.test 35e1c9696443d6694c8980c411497c2b5190d32e
F test/select1.test d0a4cad954fd41c030ec16ffbd2d08a4c0548742
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P f047758de9b499866aa4ddf16011498b12a7b963
-R bc499a9b609b8aa680130c2bc94cb8ac
+P 78dd7909da15a9b2cbcdb9cbe86798cfc24f3230
+R 43c17ab6466f886c67eb16e151d17eac
U drh
-Z d740db87b2b43b18f6a418266f6c36a4
+Z 7692693fe330733d99a3256112d00dbb
-78dd7909da15a9b2cbcdb9cbe86798cfc24f3230
\ No newline at end of file
+3e9efb763875b20c856d748c19e449080a3ae97c
\ No newline at end of file
** May you share freely, never taking more than you give.
**
*************************************************************************
-** $Id: btree.c,v 1.554 2009/01/02 18:10:42 drh Exp $
+** $Id: btree.c,v 1.555 2009/01/02 21:08:09 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
sqlite3BtreeEnter(p);
pBt->db = p->db;
rc = sqlite3PagerSavepoint(pBt->pPager, op, iSavepoint);
+ if( rc==SQLITE_OK ){
+ rc = newDatabase(pBt);
+ }
sqlite3BtreeLeave(p);
}
return rc;
** file simultaneously, or one process from reading the database while
** another is writing.
**
-** @(#) $Id: pager.c,v 1.526 2009/01/02 18:10:42 drh Exp $
+** @(#) $Id: pager.c,v 1.527 2009/01/02 21:08:09 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
char dbFileVers[16]; /* Changes whenever database file changes */
i64 journalSizeLimit; /* Size limit for persistent journal files */
PCache *pPCache; /* Pointer to page cache object */
-
- PagerSavepoint *aSavepoint;
- int nSavepoint;
+ PagerSavepoint *aSavepoint; /* Array of active savepoints */
+ int nSavepoint; /* Number of elements in aSavepoint[] */
};
/*
** 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.807 2008/12/29 10:39:54 danielk1977 Exp $
+** $Id: vdbe.c,v 1.808 2009/01/02 21:08:09 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
goto abort_due_to_error;
}
}
- if( p1==SAVEPOINT_ROLLBACK && db->flags&SQLITE_InternChanges ){
+ if( p1==SAVEPOINT_ROLLBACK && (db->flags&SQLITE_InternChanges)!=0 ){
sqlite3ExpirePreparedStatements(db);
sqlite3ResetInternalSchema(db, 0);
}
--- /dev/null
+# 2009 January 2
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+# Verify that a SAVEPOINT on a new, empty database followed by a
+# ROLLBACK TO that savepoint starts over again with another new
+# empty database.
+#
+# $Id: savepoint5.test,v 1.1 2009/01/02 21:08:09 drh Exp $
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+
+do_test savepoint5-1.1 {
+ db eval {
+ SAVEPOINT sp1;
+ CREATE TABLE t1(x);
+ INSERT INTO t1 VALUES(1);
+ SELECT count(*) FROM sqlite_master;
+ SELECT * FROM t1;
+ }
+} {1 1}
+do_test savepoint5-1.2 {
+ db eval {
+ ROLLBACK TO sp1;
+ SELECT count(*) FROM sqlite_master;
+ }
+} {0}
+do_test savepoint5-1.3 {
+ db eval {
+ CREATE TABLE t1(x);
+ INSERT INTO t1 VALUES(1);
+ SELECT count(*) FROM sqlite_master;
+ SELECT * FROM t1;
+ }
+} {1 1}
+
+
+finish_test