From fdf304d39956e866d8107456f1e8788bf03f5548 Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 19 May 2011 07:53:23 +0000 Subject: [PATCH 01/16] Add another test for [2d1a5c67df]. FossilOrigin-Name: 97fcd9e88891abd44037004e47862bcecfa1b0c9 --- manifest | 14 +++++------ manifest.uuid | 2 +- test/tkt-2d1a5c67d.test | 54 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index a2fbca16d7..661fb78b3c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C When\scommitting\sa\sWAL\stransaction,\smake\ssure\sat\sleast\sone\spage\sis\nwritten\sto\sthe\sWAL\sfile\sso\sthat\sthe\sWAL\ssubsystem\swill\shave\sa\spage\non\swhich\sto\sset\sthe\scommit\sflag.\nTicket\s[2d1a5c67dfc236]. -D 2011-05-19T01:21:42.431 +C Add\sanother\stest\sfor\s[2d1a5c67df]. +D 2011-05-19T07:53:23.122 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 11dcc00a8d0e5202def00e81732784fb0cc4fe1d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -705,7 +705,7 @@ F test/threadtest2.c ace893054fa134af3fc8d6e7cfecddb8e3acefb9 F test/threadtest3.c 0ed13e09690f6204d7455fac3b0e8ece490f6eef F test/tkt-02a8e81d44.test 58494de77be2cf249228ada3f313fa399821c6ab F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660 -F test/tkt-2d1a5c67d.test 39d2368072315923021700a216379fcf23ac3a5c +F test/tkt-2d1a5c67d.test 450b3cf86ca9a3b1fd0a9e136978142be3bff7e0 F test/tkt-2ea2425d34.test 1cf13e6f75d149b3209a0cb32927a82d3d79fb28 F test/tkt-31338dca7e.test 5741cd48de500347a437ba1be58c8335e83c5a5e F test/tkt-313723c356.test c47f8a9330523e6f35698bf4489bcb29609b53ac @@ -938,7 +938,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P de58cb28387f44c35b1a81bdab853cafd938c1a6 -R e623b89a5e0b9474dd0884ecf24382fc -U drh -Z 83669a82fd950b01af57955dbca1c918 +P 67bf1c9a888b0d84d252d6c4c754c2c51994d208 +R 84c84662daf4fcfa430ab94eb0e5302f +U dan +Z b2a115bcb644bb929ad33751c5f52805 diff --git a/manifest.uuid b/manifest.uuid index ad5e538784..f2ab280f7f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -67bf1c9a888b0d84d252d6c4c754c2c51994d208 \ No newline at end of file +97fcd9e88891abd44037004e47862bcecfa1b0c9 \ No newline at end of file diff --git a/test/tkt-2d1a5c67d.test b/test/tkt-2d1a5c67d.test index 676e60b057..5db364bd79 100644 --- a/test/tkt-2d1a5c67d.test +++ b/test/tkt-2d1a5c67d.test @@ -17,6 +17,7 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl +set testprefix tkt-2d1a5c67d ifcapable !wal {finish_test; return} @@ -70,4 +71,57 @@ for {set ii 1} {$ii<=10} {incr ii} { } {1000000 1 2} } +db close +sqlite3 db test.db + + +do_execsql_test 3.1 { + PRAGMA cache_size = 10; + CREATE TABLE t3(a INTEGER PRIMARY KEY, b); + CREATE TABLE t4(a); +} + +do_execsql_test 3.2 { + INSERT INTO t3 VALUES(NULL, randomblob(500)); + INSERT INTO t3 SELECT NULL, b||b FROM t3; -- 2 + INSERT INTO t3 SELECT NULL, b||b FROM t3; -- 4 + INSERT INTO t3 SELECT NULL, b||b FROM t3; -- 8 + INSERT INTO t3 SELECT NULL, b||b FROM t3; -- 16 + INSERT INTO t3 SELECT NULL, b||b FROM t3; -- 32 + INSERT INTO t3 SELECT NULL, b||b FROM t3; -- 64 + INSERT INTO t3 SELECT NULL, b||b FROM t3; -- 128 +} + +do_execsql_test 3.3 { + BEGIN; + INSERT INTO t4 VALUES('xyz'); +} + +do_test 3.4 { + set blobs [list] + for {set i 1} {$i<100} {incr i} { + set b [db incrblob -readonly t3 b $i] + read $b + lappend blobs $b + } + + execsql COMMIT + execsql { SELECT * FROM t4 WHERE a = 'xyz' } +} {xyz} + +do_test 3.5 { + foreach b $blobs { close $b } + execsql { SELECT * FROM t4 WHERE a = 'xyz' } +} {xyz} + +# Check that recovery works on the WAL file. +# +forcedelete test.db2-wal test.db2 +do_test 3.6 { + file copy test.db-wal test.db2-wal + file copy test.db test.db2 + sqlite3 db2 test.db2 + execsql { SELECT * FROM t4 WHERE a = 'xyz' } db2 +} {xyz} + finish_test From 14438d12b14b6ddf73876436264fb2e0c6b53730 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 20 May 2011 01:49:30 +0000 Subject: [PATCH 02/16] Mark an unreachable branch in the recent WAL problem as unreachable. FossilOrigin-Name: 3e8a29ff8953054cb3b88db5997b5bae38ba09dd --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/pager.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index 661fb78b3c..4ded5d5da8 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sanother\stest\sfor\s[2d1a5c67df]. -D 2011-05-19T07:53:23.122 +C Mark\san\sunreachable\sbranch\sin\sthe\srecent\sWAL\sproblem\sas\sunreachable. +D 2011-05-20T01:49:30.995 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 11dcc00a8d0e5202def00e81732784fb0cc4fe1d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -165,7 +165,7 @@ F src/os_common.h a8f95b81eca8a1ab8593d23e94f8a35f35d4078f F src/os_os2.c 4a75888ba3dfc820ad5e8177025972d74d7f2440 F src/os_unix.c 6d4a58d81ad4b782406519f3790202f330e89bb7 F src/os_win.c 218b899469e570d46eb8147c2383075f7c026230 -F src/pager.c 4b2358556c88660a94a4560de95dd728911e00fd +F src/pager.c 120550e7ef01dafaa2cbb4a0528c0d87c8f12b41 F src/pager.h 3f8c783de1d4706b40b1ac15b64f5f896bcc78d1 F src/parse.y 12b7ebd61ea54f0e1b1083ff69cc2c8ce9353d58 F src/pcache.c 09d38c44ab275db581f7a2f6ff8b9bc7f8c0faaa @@ -938,7 +938,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 67bf1c9a888b0d84d252d6c4c754c2c51994d208 -R 84c84662daf4fcfa430ab94eb0e5302f -U dan -Z b2a115bcb644bb929ad33751c5f52805 +P 97fcd9e88891abd44037004e47862bcecfa1b0c9 +R dfc39482dc1485cfb422ba7a47f95a18 +U drh +Z 170a5ac08de306ec947114fc9ba724a8 diff --git a/manifest.uuid b/manifest.uuid index f2ab280f7f..e36365ca26 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -97fcd9e88891abd44037004e47862bcecfa1b0c9 \ No newline at end of file +3e8a29ff8953054cb3b88db5997b5bae38ba09dd \ No newline at end of file diff --git a/src/pager.c b/src/pager.c index 6bddd7fd1f..7ff9a9a000 100644 --- a/src/pager.c +++ b/src/pager.c @@ -5755,8 +5755,8 @@ int sqlite3PagerCommitPhaseOne( pList = pPageOne; pList->pDirty = 0; } - assert( pList!=0 || rc!=SQLITE_OK ); - if( pList ){ + assert( rc==SQLITE_OK ); + if( ALWAYS(pList) ){ rc = pagerWalFrames(pPager, pList, pPager->dbSize, 1, (pPager->fullSync ? pPager->syncFlags : 0) ); From 812d6088be28ab5bf2d44b4411df417dfb29b8d8 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 20 May 2011 01:50:01 +0000 Subject: [PATCH 03/16] Fix the URI test script so that it works even if there is a subdirectory named "test". FossilOrigin-Name: 2018d4e108872f2436df046636401b89cfde589d --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/uri.test | 9 +++++---- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index 4ded5d5da8..f751acadc1 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Mark\san\sunreachable\sbranch\sin\sthe\srecent\sWAL\sproblem\sas\sunreachable. -D 2011-05-20T01:49:30.995 +C Fix\sthe\sURI\stest\sscript\sso\sthat\sit\sworks\seven\sif\sthere\sis\sa\ssubdirectory\nnamed\s"test". +D 2011-05-20T01:50:01.794 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 11dcc00a8d0e5202def00e81732784fb0cc4fe1d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -843,7 +843,7 @@ F test/unique.test 083c7fff74695bcc27a71d75699deba3595bc9c2 F test/unixexcl.test 9d80a54d86d2261f660758928959368ffc36151e F test/unordered.test e81169ce2a8f31b2c6b66af691887e1376ab3ced F test/update.test 8bc86fd7ef1a00014f76dc6a6a7c974df4aef172 -F test/uri.test 2d08a6f77bf93ca925743a65802c4aa23aaaf373 +F test/uri.test 53de9a2549cbda9c343223236918ef502f6a9051 F test/utf16align.test 54cd35a27c005a9b6e7815d887718780b6a462ae F test/vacuum.test 29b60e8cc9e573b39676df6c4a75fe9e02d04a09 F test/vacuum2.test 91a84c9b08adfc4472097d2e8deb0150214e0e76 @@ -938,7 +938,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 97fcd9e88891abd44037004e47862bcecfa1b0c9 -R dfc39482dc1485cfb422ba7a47f95a18 +P 3e8a29ff8953054cb3b88db5997b5bae38ba09dd +R 5fea414460a5e5fa1ee92fc36723f05a U drh -Z 170a5ac08de306ec947114fc9ba724a8 +Z c112edb8a27a2fc78ca0bd2c77513025 diff --git a/manifest.uuid b/manifest.uuid index e36365ca26..aac5e1d8c2 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3e8a29ff8953054cb3b88db5997b5bae38ba09dd \ No newline at end of file +2018d4e108872f2436df046636401b89cfde589d \ No newline at end of file diff --git a/test/uri.test b/test/uri.test index 42cbc66d77..f361e92917 100644 --- a/test/uri.test +++ b/test/uri.test @@ -46,7 +46,7 @@ foreach {tn uri file} { 11 file file 12 http:test.db http:test.db 13 file:test.db%00extra test.db - 14 file:test%00.db%00extra test + 14 file:testdb%00.db%00extra testdb 15 test.db?mork=1#boris test.db?mork=1#boris 16 file://localhostPWD/test.db%3Fhello test.db?hello @@ -59,6 +59,7 @@ foreach {tn uri file} { set uri [string map [list PWD [pwd]] $uri] } + if {[file isdir $file]} {error "$file is a directory"} forcedelete $file do_test 1.$tn.1 { file exists $file } 0 set DB [sqlite3_open $uri] @@ -90,9 +91,9 @@ foreach {tn uri kvlist} { 3 file:test.db?hello=1&world=2&vfs=tvfs {hello 1 world 2 vfs tvfs} 4 file:test.db?hello=1&world=2&vfs=tvfs2 {} 5 file:test.db?%68%65%6C%6C%6F=%77%6F%72%6C%64 {hello world} - 6 file:test%00.db?hello%00extra=world%00ex {hello world} - 7 file:test%00.db?hello%00=world%00 {hello world} - 8 file:test%00.db?=world&xyz=abc {xyz abc} + 6 file:testdb%00.db?hello%00extra=world%00ex {hello world} + 7 file:testdb%00.db?hello%00=world%00 {hello world} + 8 file:testdb%00.db?=world&xyz=abc {xyz abc} 9 file:test.db?%00hello=world&xyz=abc {xyz abc} 10 file:test.db?hello=%00world&xyz= {hello {} xyz {}} 11 file:test.db?=#ravada {} From cf8112bef9901e14de9ad313661f33f2d883771b Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 20 May 2011 13:26:58 +0000 Subject: [PATCH 04/16] Add a big comment to the top of test_vfstrace.c to explain how to compile and use that module. FossilOrigin-Name: a6a0fefbe503a2c81aa1847ced3bac21850d8faa --- manifest | 12 +++--- manifest.uuid | 2 +- src/test_vfstrace.c | 94 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index f751acadc1..1e4ee00bc5 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\sURI\stest\sscript\sso\sthat\sit\sworks\seven\sif\sthere\sis\sa\ssubdirectory\nnamed\s"test". -D 2011-05-20T01:50:01.794 +C Add\sa\sbig\scomment\sto\sthe\stop\sof\stest_vfstrace.c\sto\sexplain\show\sto\scompile\nand\suse\sthat\smodule. +D 2011-05-20T13:26:58.320 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 11dcc00a8d0e5202def00e81732784fb0cc4fe1d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -227,7 +227,7 @@ F src/test_syscall.c 162c4ec0137a549c009bb9ecab550527743cfc5d F src/test_tclvar.c f4dc67d5f780707210d6bb0eb6016a431c04c7fa F src/test_thread.c 361ae0a0f1cbf5a28ad0388a258b104017a370c0 F src/test_vfs.c 0ac5b2e3da61bc385c1017890687c359746be2fd -F src/test_vfstrace.c 2265c9895f350c8d3c39b079998fbe7481505cc1 +F src/test_vfstrace.c 0b884e06094a746da729119a2cabdc7aa790063d F src/test_wholenumber.c 6129adfbe7c7444f2e60cc785927f3aa74e12290 F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9 F src/tokenize.c 604607d6813e9551cf5189d899e0a25c12681080 @@ -938,7 +938,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 3e8a29ff8953054cb3b88db5997b5bae38ba09dd -R 5fea414460a5e5fa1ee92fc36723f05a +P 2018d4e108872f2436df046636401b89cfde589d +R 255b37749f43768ed482b58df21cb526 U drh -Z c112edb8a27a2fc78ca0bd2c77513025 +Z b3fd4754e05513cf46b48a7229f1cea7 diff --git a/manifest.uuid b/manifest.uuid index aac5e1d8c2..2e71a6e1d6 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2018d4e108872f2436df046636401b89cfde589d \ No newline at end of file +a6a0fefbe503a2c81aa1847ced3bac21850d8faa \ No newline at end of file diff --git a/src/test_vfstrace.c b/src/test_vfstrace.c index 073eab631b..5e94f5cf06 100644 --- a/src/test_vfstrace.c +++ b/src/test_vfstrace.c @@ -12,6 +12,100 @@ ** ** This file contains code implements a VFS shim that writes diagnostic ** output for each VFS call, similar to "strace". +** +** USAGE: +** +** This source file exports a single symbol which is the name of a +** function: +** +** int vfstrace_register( +** const char *zTraceName, // Name of the newly constructed VFS +** const char *zOldVfsName, // Name of the underlying VFS +** int (*xOut)(const char*,void*), // Output routine. ex: fputs +** void *pOutArg, // 2nd argument to xOut. ex: stderr +** int makeDefault // Make the new VFS the default +** ); +** +** Applications that want to trace their VFS usage must provide a callback +** function with this prototype: +** +** int traceOutput(const char *zMessage, void *pAppData); +** +** This function will "output" the trace messages, where "output" can +** mean different things to different applications. The traceOutput function +** for the command-line shell (see shell.c) is "fputs" from the standard +** library, which means that all trace output is written on the stream +** specified by the second argument. In the case of the command-line shell +** the second argument is stderr. Other applications might choose to output +** trace information to a file, over a socket, or write it into a buffer. +** +** The vfstrace_register() function creates a new "shim" VFS named by +** the zTraceName parameter. A "shim" VFS is an SQLite backend that does +** not really perform the duties of a true backend, but simply filters or +** interprets VFS calls before passing them off to another VFS which does +** the actual work. In this case the other VFS - the one that does the +** real work - is identified by the second parameter, zOldVfsName. If +** the the 2nd parameter is NULL then the default VFS is used. The common +** case is for the 2nd parameter to be NULL. +** +** The third and fourth parameters are the pointer to the output function +** and the second argument to the output function. For the SQLite +** command-line shell, when the -vfstrace option is used, these parameters +** are fputs and stderr, respectively. +** +** The fifth argument is true (non-zero) to cause the newly created VFS +** to become the default VFS. The common case is for the fifth parameter +** to be true. +** +** The call to vfstrace_register() simply creates the shim VFS that does +** tracing. The application must also arrange to use the new VFS for +** all database connections that are created and for which tracing is +** desired. This can be done by specifying the trace VFS using URI filename +** notation, or by specifying the trace VFS as the 4th parameter to +** sqlite3_open_v2() or by making the trace VFS be the default (by setting +** the 5th parameter of vfstrace_register() to 1). +** +** +** ENABLING VFSTRACE IN A COMMAND-LINE SHELL +** +** The SQLite command line shell implemented by the shell.c source file +** can be used with this module. To compile in -vfstrace support, first +** gather this file (test_vfstrace.c), the shell source file (shell.c), +** and the SQLite amalgamation source files (sqlite3.c, sqlite3.h) into +** the working directory. Then compile using a command like the following: +** +** gcc -o sqlite3 -Os -I. -DSQLITE_ENABLE_VFSTRACE \ +** -DSQLITE_THREADSAFE=0 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE \ +** -DHAVE_READLINE -DHAVE_USLEEP=1 \ +** shell.c test_vfstrace.c sqlite3.c -ldl -lreadline -lncurses +** +** The gcc command above works on Linux and provides (in addition to the +** -vfstrace option) support for FTS3 and FTS4, RTREE, and command-line +** editing using the readline library. The command-line shell does not +** use threads so we added -DSQLITE_THREADSAFE=0 just to make the code +** run a little faster. For compiling on a Mac, you'll probably need +** to omit the -DHAVE_READLINE, the -lreadline, and the -lncurses options. +** The compilation could be simplified to just this: +** +** gcc -DSQLITE_ENABLE_VFSTRACE \ +** shell.c test_vfstrace.c sqlite3.c -ldl -lpthread +** +** In this second example, all unnecessary options have been removed +** Note that since the code is now threadsafe, we had to add the -lpthread +** option to pull in the pthreads library. +** +** To cross-compile for windows using MinGW, a command like this might +** work: +** +** /opt/mingw/bin/i386-mingw32msvc-gcc -o sqlite3.exe -Os -I \ +** -DSQLITE_THREADSAFE=0 -DSQLITE_ENABLE_VFSTRACE \ +** shell.c test_vfstrace.c sqlite3.c +** +** Similar compiler commands will work on different systems. The key +** invariants are (1) you must have -DSQLITE_ENABLE_VFSTRACE so that +** the shell.c source file will know to include the -vfstrace command-line +** option and (2) you must compile and link the three source files +** shell,c, test_vfstrace.c, and sqlite3.c. */ #include #include From 1c48530a13d2943141ca20641e300a3c6de23682 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 20 May 2011 20:42:11 +0000 Subject: [PATCH 05/16] Adjustments to documentation hyperlinks to accommodate the new VFS documentation. FossilOrigin-Name: 139a8f53ae1979591734a8244fb33655a6499193 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/sqlite.h.in | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 1e4ee00bc5..b8b2ce242c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sa\sbig\scomment\sto\sthe\stop\sof\stest_vfstrace.c\sto\sexplain\show\sto\scompile\nand\suse\sthat\smodule. -D 2011-05-20T13:26:58.320 +C Adjustments\sto\sdocumentation\shyperlinks\sto\saccommodate\sthe\snew\sVFS\ndocumentation. +D 2011-05-20T20:42:11.435 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 11dcc00a8d0e5202def00e81732784fb0cc4fe1d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -179,7 +179,7 @@ F src/resolve.c 1c0f32b64f8e3f555fe1f732f9d6f501a7f05706 F src/rowset.c 69afa95a97c524ba6faf3805e717b5b7ae85a697 F src/select.c d9d440809025a58547e39f4f268c2a296bfb56ff F src/shell.c decd04236a7ef26be5ef46d4ea963044bfad9a48 -F src/sqlite.h.in 8bbf8d9bc5f1a9474a633a2de7014506f1f06b90 +F src/sqlite.h.in 91c63a69eeddbd62182ec00dbfee390016972bdb F src/sqlite3ext.h c90bd5507099f62043832d73f6425d8d5c5da754 F src/sqliteInt.h 771087591052966d36ac1fcd3c8bb7a8c6cf9a38 F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d @@ -938,7 +938,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 2018d4e108872f2436df046636401b89cfde589d -R 255b37749f43768ed482b58df21cb526 +P a6a0fefbe503a2c81aa1847ced3bac21850d8faa +R 1c4aa7e39f492e96b1f4f46ead44733c U drh -Z b3fd4754e05513cf46b48a7229f1cea7 +Z 31318bdaf7f46736283d7518e5463d58 diff --git a/manifest.uuid b/manifest.uuid index 2e71a6e1d6..372beb9a2c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a6a0fefbe503a2c81aa1847ced3bac21850d8faa \ No newline at end of file +139a8f53ae1979591734a8244fb33655a6499193 \ No newline at end of file diff --git a/src/sqlite.h.in b/src/sqlite.h.in index f955d63741..445a247a19 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -759,11 +759,11 @@ typedef struct sqlite3_mutex sqlite3_mutex; /* ** CAPI3REF: OS Interface Object -** KEYWORDS: VFS VFSes ** ** An instance of the sqlite3_vfs object defines the interface between ** the SQLite core and the underlying operating system. The "vfs" -** in the name of the object stands for "virtual file system". +** in the name of the object stands for "virtual file system". See +** the [VFS | VFS documentation] for further information. ** ** The value of the iVersion field is initially 1 but may be larger in ** future versions of SQLite. Additional fields may be appended to this From a12b6fa392a7d81d5c4720f199d542671b9c9afd Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 23 May 2011 18:37:42 +0000 Subject: [PATCH 06/16] Minor cleanups to the header comments on various test_*.c file, to make the suitable for programmer-level documentation. FossilOrigin-Name: a65d043a2ad895b931871c67e0ef397a1dc614a6 --- manifest | 18 +++++++++--------- manifest.uuid | 2 +- src/test_demovfs.c | 12 +++++------- src/test_journal.c | 12 +++++------- src/test_multiplex.c | 33 ++++++++++++++++++++++++++++----- src/test_vfs.c | 5 +---- 6 files changed, 49 insertions(+), 33 deletions(-) diff --git a/manifest b/manifest index b8b2ce242c..eb200a5f8a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Adjustments\sto\sdocumentation\shyperlinks\sto\saccommodate\sthe\snew\sVFS\ndocumentation. -D 2011-05-20T20:42:11.435 +C Minor\scleanups\sto\sthe\sheader\scomments\son\svarious\stest_*.c\sfile,\sto\smake\nthe\ssuitable\sfor\sprogrammer-level\sdocumentation. +D 2011-05-23T18:37:42.742 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 11dcc00a8d0e5202def00e81732784fb0cc4fe1d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -200,7 +200,7 @@ F src/test_autoext.c 30e7bd98ab6d70a62bb9ba572e4c7df347fe645e F src/test_backup.c c129c91127e9b46e335715ae2e75756e25ba27de F src/test_btree.c 47cd771250f09cdc6e12dda5bc71bc0b3abc96e2 F src/test_config.c 9a6aa8301a56906612b5e70f5b38e80cfb8af8e7 -F src/test_demovfs.c 938d0f595f8bd310076e1c06cf7885a01ce7ce01 +F src/test_demovfs.c 20a4975127993f4959890016ae9ce5535a880094 F src/test_devsym.c e7498904e72ba7491d142d5c83b476c4e76993bc F src/test_func.c cbdec5cededa0761daedde5baf06004a9bf416b5 F src/test_fuzzer.c f884f6f32e8513d34248d6e1ac8a32047fead254 @@ -208,10 +208,10 @@ F src/test_hexio.c c4773049603151704a6ab25ac5e936b5109caf5a F src/test_init.c 5d624ffd0409d424cf9adbfe1f056b200270077c F src/test_intarray.c d879bbf8e4ce085ab966d1f3c896a7c8b4f5fc99 F src/test_intarray.h 489edb9068bb926583445cb02589344961054207 -F src/test_journal.c 785edd54f963aefb3c1628124170a56697c68c70 +F src/test_journal.c 03313c693cca72959dcaaf79f8d76f21c01e19ff F src/test_loadext.c df586c27176e3c2cb2e099c78da67bf14379a56e F src/test_malloc.c 7ca7be34e0e09ef0ed6619544552ed95732e41f6 -F src/test_multiplex.c 8e67617b80b532315293761970589581745a52a0 +F src/test_multiplex.c a7457a1ac46964b7f897d75ecfd447410ec067e6 F src/test_multiplex.h e99c571bc4968b7a9363b661481f3934bfead61d F src/test_mutex.c a6bd7b9cf6e19d989e31392b06ac8d189f0d573e F src/test_onefile.c 40cf9e212a377a6511469384a64b01e6e34b2eec @@ -226,7 +226,7 @@ F src/test_superlock.c 2b97936ca127d13962c3605dbc9a4ef269c424cd F src/test_syscall.c 162c4ec0137a549c009bb9ecab550527743cfc5d F src/test_tclvar.c f4dc67d5f780707210d6bb0eb6016a431c04c7fa F src/test_thread.c 361ae0a0f1cbf5a28ad0388a258b104017a370c0 -F src/test_vfs.c 0ac5b2e3da61bc385c1017890687c359746be2fd +F src/test_vfs.c e7855568dfa1e0ba73668d273b65605d9f8b77e8 F src/test_vfstrace.c 0b884e06094a746da729119a2cabdc7aa790063d F src/test_wholenumber.c 6129adfbe7c7444f2e60cc785927f3aa74e12290 F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9 @@ -938,7 +938,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P a6a0fefbe503a2c81aa1847ced3bac21850d8faa -R 1c4aa7e39f492e96b1f4f46ead44733c +P 139a8f53ae1979591734a8244fb33655a6499193 +R 135e5df582474459d4ad1ce32ee0336a U drh -Z 31318bdaf7f46736283d7518e5463d58 +Z 551eea5e1688e783dfd89f144647d748 diff --git a/manifest.uuid b/manifest.uuid index 372beb9a2c..196319ab0a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -139a8f53ae1979591734a8244fb33655a6499193 \ No newline at end of file +a65d043a2ad895b931871c67e0ef397a1dc614a6 \ No newline at end of file diff --git a/src/test_demovfs.c b/src/test_demovfs.c index d7bcd1f908..637627071d 100644 --- a/src/test_demovfs.c +++ b/src/test_demovfs.c @@ -10,14 +10,12 @@ ** ************************************************************************* ** -** An example of a simple VFS implementation that omits complex features -** often not required or not possible on embedded platforms. Also includes -** code to buffer writes to the journal file, which can be a significant -** performance improvement on some embedded platforms. +** This file implements an example of a simple VFS implementation that +** omits complex features often not required or not possible on embedded +** platforms. Code is included to buffer writes to the journal file, +** which can be a significant performance improvement on some embedded +** platforms. ** -*/ - -/* ** OVERVIEW ** ** The code in this file implements a minimal SQLite VFS that can be diff --git a/src/test_journal.c b/src/test_journal.c index ca4c5c3884..68869723b3 100644 --- a/src/test_journal.c +++ b/src/test_journal.c @@ -14,13 +14,7 @@ ** an existing VFS. The code in this file attempts to verify that SQLite ** correctly populates and syncs a journal file before writing to a ** corresponding database file. -*/ -#if SQLITE_TEST /* This file is used for testing only */ - -#include "sqlite3.h" -#include "sqliteInt.h" - -/* +** ** INTERFACE ** ** The public interface to this wrapper VFS is two functions: @@ -99,6 +93,10 @@ ** ** c) The journal file is deleted using xDelete. */ +#if SQLITE_TEST /* This file is used for testing only */ + +#include "sqlite3.h" +#include "sqliteInt.h" /* ** Maximum pathname length supported by the jt backend. diff --git a/src/test_multiplex.c b/src/test_multiplex.c index 32e63ae889..f709c9a99f 100644 --- a/src/test_multiplex.c +++ b/src/test_multiplex.c @@ -11,13 +11,36 @@ ************************************************************************* ** ** This file contains a VFS "shim" - a layer that sits in between the -** pager and the real VFS. +** pager and the real VFS - that breaks up a very large database file +** into two or more smaller files on disk. This is useful, for example, +** in order to support large, multi-gigabyte databases on older filesystems +** that limit the maximum file size to 2 GiB. ** -** This particular shim enforces a multiplex system on DB files. -** This shim shards/partitions a single DB file into smaller -** "chunks" such that the total DB file size may exceed the maximum -** file size of the underlying file system. +** USAGE: ** +** Compile this source file and link it with your application. Then +** at start-time, invoke the following procedure: +** +** int sqlite3_multiplex_initialize( +** const char *zOrigVfsName, // The underlying real VFS +** int makeDefault // True to make multiplex the default VFS +** ); +** +** The procedure call above will create and register a new VFS shim named +** "multiplex". The multiplex VFS will use the VFS named by zOrigVfsName to +** do the actual disk I/O. (The zOrigVfsName parameter may be NULL, in +** which case the default VFS at the moment sqlite3_multiplex_initialize() +** is called will be used as the underlying real VFS.) +** +** If the makeDefault parameter is TRUE then multiplex becomes the new +** default VFS. Otherwise, you can use the multiplex VFS by specifying +** "multiplex" as the 4th parameter to sqlite3_open_v2() or by employing +** URI filenames and adding "vfs=multiplex" as a parameter to the filename +** URI. +** +** The multiplex VFS allows databases up to 32 GiB in size. But it splits +** the files up into 1 GiB pieces, so that they will work even on filesystems +** that do not support large files. */ #include "sqlite3.h" #include diff --git a/src/test_vfs.c b/src/test_vfs.c index ba078a0f9b..696321d26e 100644 --- a/src/test_vfs.c +++ b/src/test_vfs.c @@ -10,10 +10,6 @@ ** ****************************************************************************** ** -*/ -#if SQLITE_TEST /* This file is used for testing only */ - -/* ** This file contains the implementation of the Tcl [testvfs] command, ** used to create SQLite VFS implementations with various properties and ** instrumentation to support testing SQLite. @@ -28,6 +24,7 @@ ** -mxpathname INTEGER (Value for sqlite3_vfs.mxPathname) ** -iversion INTEGER (Value for sqlite3_vfs.iVersion) */ +#if SQLITE_TEST /* This file is used for testing only */ #include "sqlite3.h" #include "sqliteInt.h" From a24bc9ced33a7b20c27d3e538c9f244161908168 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 24 May 2011 00:35:56 +0000 Subject: [PATCH 07/16] Make sure the savepoint index is correct one calls to sqlite3VtabSavepoint with SAVEPOINT_BEGIN. FossilOrigin-Name: a9d095660ca0e99b226e0fe669c11a0be6c49710 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/vdbe.c | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index eb200a5f8a..1ca83606c1 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Minor\scleanups\sto\sthe\sheader\scomments\son\svarious\stest_*.c\sfile,\sto\smake\nthe\ssuitable\sfor\sprogrammer-level\sdocumentation. -D 2011-05-23T18:37:42.742 +C Make\ssure\sthe\ssavepoint\sindex\sis\scorrect\sone\scalls\sto\ssqlite3VtabSavepoint\nwith\sSAVEPOINT_BEGIN. +D 2011-05-24T00:35:56.199 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 11dcc00a8d0e5202def00e81732784fb0cc4fe1d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -236,7 +236,7 @@ F src/update.c 5bcb56e5c7380a2eecb0e71891dbd4ad7437748f F src/utf.c d83650c3ea08f7407bd9d0839d9885241c209c60 F src/util.c 0f33bbbdfcc4a2d8cf20c3b2a16ffc3b57c58a70 F src/vacuum.c 05513dca036a1e7848fe18d5ed1265ac0b32365e -F src/vdbe.c 343a068e8daeb8475e66776feb9f2974046e95c5 +F src/vdbe.c 408cc051fab3f16af2ccfe5a5eb0c86499ebb10c F src/vdbe.h 8a675fefdf7119441fe817c800a9a52440c2e797 F src/vdbeInt.h fe8f58d305e629fff02f61f655aca1d299f1f6ae F src/vdbeapi.c e0e2672e0a96ae3f8575c8ecd02912a3e8a554a1 @@ -938,7 +938,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 139a8f53ae1979591734a8244fb33655a6499193 -R 135e5df582474459d4ad1ce32ee0336a +P a65d043a2ad895b931871c67e0ef397a1dc614a6 +R 94ee8b905e59bc1d32642c15b01f0858 U drh -Z 551eea5e1688e783dfd89f144647d748 +Z 1f18a51d1c1bfd3a78b89267e4416239 diff --git a/manifest.uuid b/manifest.uuid index 196319ab0a..86e9ebce7f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a65d043a2ad895b931871c67e0ef397a1dc614a6 \ No newline at end of file +a9d095660ca0e99b226e0fe669c11a0be6c49710 \ No newline at end of file diff --git a/src/vdbe.c b/src/vdbe.c index cac0906998..5b421a65e5 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -2589,7 +2589,8 @@ case OP_Savepoint: { ** If this is a transaction savepoint being opened, it is guaranteed ** that the db->aVTrans[] array is empty. */ assert( db->autoCommit==0 || db->nVTrans==0 ); - rc = sqlite3VtabSavepoint(db, SAVEPOINT_BEGIN, p->iStatement); + rc = sqlite3VtabSavepoint(db, SAVEPOINT_BEGIN, + db->nStatement+db->nSavepoint); if( rc!=SQLITE_OK ) goto abort_due_to_error; /* Create a new savepoint structure. */ From e4855224621a5d1a0323cb6e777618266897628f Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 24 May 2011 15:36:01 +0000 Subject: [PATCH 08/16] Do not invoke the xRollbackTo or xRelease methods of a virtual table without having first invoked an appropriate xSavepoint method. Add assert() statements to FTS3/4 to verify that this is happening in all cases. FossilOrigin-Name: 651ef24249d8c22c4f13e4c0bb98a60099cfd23a --- ext/fts3/fts3.c | 36 +++++++++++++++++++++++++++++++----- ext/fts3/fts3Int.h | 30 ++++++++++++++++++++++++++++++ manifest | 18 +++++++++--------- manifest.uuid | 2 +- src/sqliteInt.h | 1 + src/vtab.c | 6 ++++-- 6 files changed, 76 insertions(+), 17 deletions(-) diff --git a/ext/fts3/fts3.c b/ext/fts3/fts3.c index ea430627cd..fecf092148 100644 --- a/ext/fts3/fts3.c +++ b/ext/fts3/fts3.c @@ -977,6 +977,8 @@ static int fts3InitVtab( p->nMaxPendingData = FTS3_MAX_PENDING_DATA; p->bHasDocsize = (isFts4 && bNoDocsize==0); p->bHasStat = isFts4; + TESTONLY( p->inTransaction = -1 ); + TESTONLY( p->mxSavepoint = -1 ); fts3HashInit(&p->pendingTerms, FTS3_HASH_STRING, 1); /* Fill in the zName and zDb fields of the vtab structure. */ @@ -3274,7 +3276,11 @@ static int fts3SyncMethod(sqlite3_vtab *pVtab){ */ static int fts3BeginMethod(sqlite3_vtab *pVtab){ UNUSED_PARAMETER(pVtab); - assert( ((Fts3Table *)pVtab)->nPendingData==0 ); + TESTONLY( Fts3Table *p = (Fts3Table*)pVtab ); + assert( p->nPendingData==0 ); + assert( p->inTransaction!=1 ); + TESTONLY( p->inTransaction = 1 ); + TESTONLY( p->mxSavepoint = -1; ); return SQLITE_OK; } @@ -3285,7 +3291,11 @@ static int fts3BeginMethod(sqlite3_vtab *pVtab){ */ static int fts3CommitMethod(sqlite3_vtab *pVtab){ UNUSED_PARAMETER(pVtab); - assert( ((Fts3Table *)pVtab)->nPendingData==0 ); + TESTONLY( Fts3Table *p = (Fts3Table*)pVtab ); + assert( p->nPendingData==0 ); + assert( p->inTransaction!=0 ); + TESTONLY( p->inTransaction = 0 ); + TESTONLY( p->mxSavepoint = -1; ); return SQLITE_OK; } @@ -3294,7 +3304,11 @@ static int fts3CommitMethod(sqlite3_vtab *pVtab){ ** hash-table. Any changes made to the database are reverted by SQLite. */ static int fts3RollbackMethod(sqlite3_vtab *pVtab){ - sqlite3Fts3PendingTermsClear((Fts3Table *)pVtab); + Fts3Table *p = (Fts3Table*)pVtab; + sqlite3Fts3PendingTermsClear(p); + assert( p->inTransaction!=0 ); + TESTONLY( p->inTransaction = 0 ); + TESTONLY( p->mxSavepoint = -1; ); return SQLITE_OK; } @@ -3650,13 +3664,25 @@ static int fts3RenameMethod( } static int fts3SavepointMethod(sqlite3_vtab *pVtab, int iSavepoint){ - return sqlite3Fts3PendingTermsFlush((Fts3Table *)pVtab); + Fts3Table *p = (Fts3Table*)pVtab; + assert( p->inTransaction ); + assert( p->mxSavepoint < iSavepoint ); + TESTONLY( p->mxSavepoint = iSavepoint ); + return sqlite3Fts3PendingTermsFlush(p); } static int fts3ReleaseMethod(sqlite3_vtab *pVtab, int iSavepoint){ + TESTONLY( Fts3Table *p = (Fts3Table*)pVtab ); + assert( p->inTransaction ); + assert( p->mxSavepoint >= iSavepoint ); + TESTONLY( p->mxSavepoint = iSavepoint>0 ? iSavepoint-1 : 0 ); return SQLITE_OK; } static int fts3RollbackToMethod(sqlite3_vtab *pVtab, int iSavepoint){ - sqlite3Fts3PendingTermsClear((Fts3Table *)pVtab); + Fts3Table *p = (Fts3Table*)pVtab; + assert( p->inTransaction ); + assert( p->mxSavepoint >= iSavepoint ); + TESTONLY( p->mxSavepoint = iSavepoint ); + sqlite3Fts3PendingTermsClear(p); return SQLITE_OK; } diff --git a/ext/fts3/fts3Int.h b/ext/fts3/fts3Int.h index 8d1e15737d..bb21165ffc 100644 --- a/ext/fts3/fts3Int.h +++ b/ext/fts3/fts3Int.h @@ -92,12 +92,32 @@ typedef unsigned char u8; /* 1-byte (or larger) unsigned integer */ typedef short int i16; /* 2-byte (or larger) signed integer */ typedef unsigned int u32; /* 4-byte unsigned integer */ typedef sqlite3_uint64 u64; /* 8-byte unsigned integer */ + /* ** Macro used to suppress compiler warnings for unused parameters. */ #define UNUSED_PARAMETER(x) (void)(x) + +/* +** Activate assert() only if SQLITE_TEST is enabled. +*/ +#if !defined(NDEBUG) && !defined(SQLITE_DEBUG) +# define NDEBUG 1 #endif +/* +** The TESTONLY macro is used to enclose variable declarations or +** other bits of code that are needed to support the arguments +** within testcase() and assert() macros. +*/ +#if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST) +# define TESTONLY(X) X +#else +# define TESTONLY(X) +#endif + +#endif /* SQLITE_AMALGAMATION */ + typedef struct Fts3Table Fts3Table; typedef struct Fts3Cursor Fts3Cursor; typedef struct Fts3Expr Fts3Expr; @@ -151,6 +171,16 @@ struct Fts3Table { int nPendingData; sqlite_int64 iPrevDocid; Fts3Hash pendingTerms; + +#if defined(SQLITE_DEBUG) + /* State variables used for validating that the transaction control + ** methods of the virtual table are called at appropriate times. These + ** values do not contribution to the FTS computation; they are used for + ** verifying the SQLite core. + */ + int inTransaction; /* True after xBegin but before xCommit/xRollback */ + int mxSavepoint; /* Largest valid xSavepoint integer */ +#endif }; /* diff --git a/manifest b/manifest index 1ca83606c1..51c28b73df 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Make\ssure\sthe\ssavepoint\sindex\sis\scorrect\sone\scalls\sto\ssqlite3VtabSavepoint\nwith\sSAVEPOINT_BEGIN. -D 2011-05-24T00:35:56.199 +C Do\snot\sinvoke\sthe\sxRollbackTo\sor\sxRelease\smethods\sof\sa\svirtual\stable\swithout\nhaving\sfirst\sinvoked\san\sappropriate\sxSavepoint\smethod.\s\sAdd\sassert()\sstatements\nto\sFTS3/4\sto\sverify\sthat\sthis\sis\shappening\sin\sall\scases. +D 2011-05-24T15:36:01.532 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 11dcc00a8d0e5202def00e81732784fb0cc4fe1d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -61,9 +61,9 @@ F ext/fts2/mkfts2amal.tcl 974d5d438cb3f7c4a652639262f82418c1e4cff0 F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a F ext/fts3/README.tokenizers 998756696647400de63d5ba60e9655036cb966e9 F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d -F ext/fts3/fts3.c 18c2a079ba2b9154b7485fd39d1a6d12b5872a76 +F ext/fts3/fts3.c e7600e285b58027657ebb46c6132b7d5a100accb F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe -F ext/fts3/fts3Int.h 05d145152620e7849c452bd919f2cc3e2d75309f +F ext/fts3/fts3Int.h c8c0011c5e5b3a7703376ea6cd7deb91cfb96a06 F ext/fts3/fts3_aux.c 9e931f55eed8498dafe7bc1160f10cbb1a652fdf F ext/fts3/fts3_expr.c 5f49e0deaf723724b08100bb3ff40aab02ad0c93 F ext/fts3/fts3_hash.c 3c8f6387a4a7f5305588b203fa7c887d753e1f1c @@ -181,7 +181,7 @@ F src/select.c d9d440809025a58547e39f4f268c2a296bfb56ff F src/shell.c decd04236a7ef26be5ef46d4ea963044bfad9a48 F src/sqlite.h.in 91c63a69eeddbd62182ec00dbfee390016972bdb F src/sqlite3ext.h c90bd5507099f62043832d73f6425d8d5c5da754 -F src/sqliteInt.h 771087591052966d36ac1fcd3c8bb7a8c6cf9a38 +F src/sqliteInt.h 558170329f2b9cc3ac1a697fda69d6136b1052a1 F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 7ac64842c86cec2fc1a1d0e5c16d3beb8ad332bf F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e @@ -244,7 +244,7 @@ F src/vdbeaux.c 535851211df61d83213c83d5ffd3c6ce9ecbdc18 F src/vdbeblob.c c3ccb7c8732858c680f442932e66ad06bb036562 F src/vdbemem.c 0498796b6ffbe45e32960d6a1f5adfb6e419883b F src/vdbetrace.c 5d0dc3d5fd54878cc8d6d28eb41deb8d5885b114 -F src/vtab.c 48dcef8bc757c2e7b488f68b5ddebb1650da2450 +F src/vtab.c abc63828276619d7eb8f45ab265ebc2204c85ddd F src/wal.c de27c34c8016c00be348fc6bed588816557ceb66 F src/wal.h 66b40bd91bc29a5be1c88ddd1f5ade8f3f48728a F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f @@ -938,7 +938,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P a65d043a2ad895b931871c67e0ef397a1dc614a6 -R 94ee8b905e59bc1d32642c15b01f0858 +P a9d095660ca0e99b226e0fe669c11a0be6c49710 +R 19875cc50e6351fd8eaf432c5942eda7 U drh -Z 1f18a51d1c1bfd3a78b89267e4416239 +Z f15ff60c160c7edadf458f2c05939bd4 diff --git a/manifest.uuid b/manifest.uuid index 86e9ebce7f..47cc55cc06 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a9d095660ca0e99b226e0fe669c11a0be6c49710 \ No newline at end of file +651ef24249d8c22c4f13e4c0bb98a60099cfd23a \ No newline at end of file diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 6932e0b455..a6fac4f854 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -1235,6 +1235,7 @@ struct VTable { sqlite3_vtab *pVtab; /* Pointer to vtab instance */ int nRef; /* Number of pointers to this structure */ u8 bConstraint; /* True if constraints are supported */ + u8 bInSavepoint; /* True if within a SAVEPOINT */ VTable *pNext; /* Next in linked list (see above) */ }; diff --git a/src/vtab.c b/src/vtab.c index c64c897d07..1de0baec91 100644 --- a/src/vtab.c +++ b/src/vtab.c @@ -873,12 +873,14 @@ int sqlite3VtabSavepoint(sqlite3 *db, int op, int iSavepoint){ if( db->aVTrans ){ int i; for(i=0; rc==SQLITE_OK && inVTrans; i++){ - const sqlite3_module *pMod = db->aVTrans[i]->pMod->pModule; - if( pMod->iVersion>=2 ){ + VTable *pVTab = db->aVTrans[i]; + const sqlite3_module *pMod = pVTab->pMod->pModule; + if( pMod->iVersion>=2 && (pVTab->bInSavepoint || op==SAVEPOINT_BEGIN) ){ int (*xMethod)(sqlite3_vtab *, int); switch( op ){ case SAVEPOINT_BEGIN: xMethod = pMod->xSavepoint; + pVTab->bInSavepoint = 1; break; case SAVEPOINT_ROLLBACK: xMethod = pMod->xRollbackTo; From 346506f97b5cae2252569fd00739b5c34f44735a Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 25 May 2011 01:16:42 +0000 Subject: [PATCH 09/16] Changes to savepoint in virtual tables for simpler and more consistent operation. FossilOrigin-Name: 92f26a8b8f18832cb1f8ba7dd8e5b020e71a5883 --- ext/fts3/fts3.c | 2 +- manifest | 20 ++++++++++---------- manifest.uuid | 2 +- src/sqliteInt.h | 2 +- src/vdbe.c | 2 +- src/vdbeaux.c | 8 +------- src/vtab.c | 10 +++++++--- 7 files changed, 22 insertions(+), 24 deletions(-) diff --git a/ext/fts3/fts3.c b/ext/fts3/fts3.c index fecf092148..5e2472753e 100644 --- a/ext/fts3/fts3.c +++ b/ext/fts3/fts3.c @@ -3674,7 +3674,7 @@ static int fts3ReleaseMethod(sqlite3_vtab *pVtab, int iSavepoint){ TESTONLY( Fts3Table *p = (Fts3Table*)pVtab ); assert( p->inTransaction ); assert( p->mxSavepoint >= iSavepoint ); - TESTONLY( p->mxSavepoint = iSavepoint>0 ? iSavepoint-1 : 0 ); + TESTONLY( p->mxSavepoint = iSavepoint-1 ); return SQLITE_OK; } static int fts3RollbackToMethod(sqlite3_vtab *pVtab, int iSavepoint){ diff --git a/manifest b/manifest index 51c28b73df..70bd6447db 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Do\snot\sinvoke\sthe\sxRollbackTo\sor\sxRelease\smethods\sof\sa\svirtual\stable\swithout\nhaving\sfirst\sinvoked\san\sappropriate\sxSavepoint\smethod.\s\sAdd\sassert()\sstatements\nto\sFTS3/4\sto\sverify\sthat\sthis\sis\shappening\sin\sall\scases. -D 2011-05-24T15:36:01.532 +C Changes\sto\ssavepoint\sin\svirtual\stables\sfor\ssimpler\sand\smore\sconsistent\noperation. +D 2011-05-25T01:16:42.774 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 11dcc00a8d0e5202def00e81732784fb0cc4fe1d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -61,7 +61,7 @@ F ext/fts2/mkfts2amal.tcl 974d5d438cb3f7c4a652639262f82418c1e4cff0 F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a F ext/fts3/README.tokenizers 998756696647400de63d5ba60e9655036cb966e9 F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d -F ext/fts3/fts3.c e7600e285b58027657ebb46c6132b7d5a100accb +F ext/fts3/fts3.c 0a2ae110f2d1806687ee0de837ac1eff106843b4 F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe F ext/fts3/fts3Int.h c8c0011c5e5b3a7703376ea6cd7deb91cfb96a06 F ext/fts3/fts3_aux.c 9e931f55eed8498dafe7bc1160f10cbb1a652fdf @@ -181,7 +181,7 @@ F src/select.c d9d440809025a58547e39f4f268c2a296bfb56ff F src/shell.c decd04236a7ef26be5ef46d4ea963044bfad9a48 F src/sqlite.h.in 91c63a69eeddbd62182ec00dbfee390016972bdb F src/sqlite3ext.h c90bd5507099f62043832d73f6425d8d5c5da754 -F src/sqliteInt.h 558170329f2b9cc3ac1a697fda69d6136b1052a1 +F src/sqliteInt.h aba3cb057fabf6ff9fa634d677e750dfa946a856 F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 7ac64842c86cec2fc1a1d0e5c16d3beb8ad332bf F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e @@ -236,15 +236,15 @@ F src/update.c 5bcb56e5c7380a2eecb0e71891dbd4ad7437748f F src/utf.c d83650c3ea08f7407bd9d0839d9885241c209c60 F src/util.c 0f33bbbdfcc4a2d8cf20c3b2a16ffc3b57c58a70 F src/vacuum.c 05513dca036a1e7848fe18d5ed1265ac0b32365e -F src/vdbe.c 408cc051fab3f16af2ccfe5a5eb0c86499ebb10c +F src/vdbe.c 4812f0e5813b3969307ec466d26d9b32b7b814e9 F src/vdbe.h 8a675fefdf7119441fe817c800a9a52440c2e797 F src/vdbeInt.h fe8f58d305e629fff02f61f655aca1d299f1f6ae F src/vdbeapi.c e0e2672e0a96ae3f8575c8ecd02912a3e8a554a1 -F src/vdbeaux.c 535851211df61d83213c83d5ffd3c6ce9ecbdc18 +F src/vdbeaux.c 07a5226ae6e9c6e54b5fcd3c395b86e7ffdba3a4 F src/vdbeblob.c c3ccb7c8732858c680f442932e66ad06bb036562 F src/vdbemem.c 0498796b6ffbe45e32960d6a1f5adfb6e419883b F src/vdbetrace.c 5d0dc3d5fd54878cc8d6d28eb41deb8d5885b114 -F src/vtab.c abc63828276619d7eb8f45ab265ebc2204c85ddd +F src/vtab.c 6bff354033de8eff72f42565411a72a84fd2b26b F src/wal.c de27c34c8016c00be348fc6bed588816557ceb66 F src/wal.h 66b40bd91bc29a5be1c88ddd1f5ade8f3f48728a F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f @@ -938,7 +938,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P a9d095660ca0e99b226e0fe669c11a0be6c49710 -R 19875cc50e6351fd8eaf432c5942eda7 +P 651ef24249d8c22c4f13e4c0bb98a60099cfd23a +R d659c94b5cac09c043b35685a3ce715d U drh -Z f15ff60c160c7edadf458f2c05939bd4 +Z 45421066265cfeebb2a0b357f6a7553d diff --git a/manifest.uuid b/manifest.uuid index 47cc55cc06..ddcd4dc4ff 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -651ef24249d8c22c4f13e4c0bb98a60099cfd23a \ No newline at end of file +92f26a8b8f18832cb1f8ba7dd8e5b020e71a5883 \ No newline at end of file diff --git a/src/sqliteInt.h b/src/sqliteInt.h index a6fac4f854..753c0fcefb 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -1235,7 +1235,7 @@ struct VTable { sqlite3_vtab *pVtab; /* Pointer to vtab instance */ int nRef; /* Number of pointers to this structure */ u8 bConstraint; /* True if constraints are supported */ - u8 bInSavepoint; /* True if within a SAVEPOINT */ + u32 iSavepoint; /* Depth of the SAVEPOINT stack */ VTable *pNext; /* Next in linked list (see above) */ }; diff --git a/src/vdbe.c b/src/vdbe.c index 5b421a65e5..add643f176 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -2840,7 +2840,7 @@ case OP_Transaction: { p->iStatement = db->nSavepoint + db->nStatement; } - rc = sqlite3VtabSavepoint(db, SAVEPOINT_BEGIN, p->iStatement); + rc = sqlite3VtabSavepoint(db, SAVEPOINT_BEGIN, p->iStatement-1); if( rc==SQLITE_OK ){ rc = sqlite3BtreeBeginStmt(pBt, p->iStatement); } diff --git a/src/vdbeaux.c b/src/vdbeaux.c index e89a87b522..e9764a5096 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -2202,17 +2202,11 @@ int sqlite3VdbeHalt(Vdbe *p){ ** do so. If this operation returns an error, and the current statement ** error code is SQLITE_OK or SQLITE_CONSTRAINT, then promote the ** current statement error code. - ** - ** Note that sqlite3VdbeCloseStatement() can only fail if eStatementOp - ** is SAVEPOINT_ROLLBACK. But if p->rc==SQLITE_OK then eStatementOp - ** must be SAVEPOINT_RELEASE. Hence the NEVER(p->rc==SQLITE_OK) in - ** the following code. */ if( eStatementOp ){ rc = sqlite3VdbeCloseStatement(p, eStatementOp); if( rc ){ - assert( eStatementOp==SAVEPOINT_ROLLBACK ); - if( NEVER(p->rc==SQLITE_OK) || p->rc==SQLITE_CONSTRAINT ){ + if( p->rc==SQLITE_OK || p->rc==SQLITE_CONSTRAINT ){ p->rc = rc; sqlite3DbFree(db, p->zErrMsg); p->zErrMsg = 0; diff --git a/src/vtab.c b/src/vtab.c index 1de0baec91..0a4c9ea0a4 100644 --- a/src/vtab.c +++ b/src/vtab.c @@ -753,6 +753,7 @@ static void callFinaliser(sqlite3 *db, int offset){ x = *(int (**)(sqlite3_vtab *))((char *)p->pModule + offset); if( x ) x(p); } + pVTab->iSavepoint = 0; sqlite3VtabUnlock(pVTab); } sqlite3DbFree(db, db->aVTrans); @@ -870,17 +871,18 @@ int sqlite3VtabSavepoint(sqlite3 *db, int op, int iSavepoint){ int rc = SQLITE_OK; assert( op==SAVEPOINT_RELEASE||op==SAVEPOINT_ROLLBACK||op==SAVEPOINT_BEGIN ); + assert( iSavepoint>=0 ); if( db->aVTrans ){ int i; for(i=0; rc==SQLITE_OK && inVTrans; i++){ VTable *pVTab = db->aVTrans[i]; const sqlite3_module *pMod = pVTab->pMod->pModule; - if( pMod->iVersion>=2 && (pVTab->bInSavepoint || op==SAVEPOINT_BEGIN) ){ + if( pMod->iVersion>=2 ){ int (*xMethod)(sqlite3_vtab *, int); switch( op ){ case SAVEPOINT_BEGIN: xMethod = pMod->xSavepoint; - pVTab->bInSavepoint = 1; + pVTab->iSavepoint = iSavepoint+1; break; case SAVEPOINT_ROLLBACK: xMethod = pMod->xRollbackTo; @@ -889,7 +891,9 @@ int sqlite3VtabSavepoint(sqlite3 *db, int op, int iSavepoint){ xMethod = pMod->xRelease; break; } - if( xMethod ) rc = xMethod(db->aVTrans[i]->pVtab, iSavepoint); + if( xMethod && pVTab->iSavepoint>iSavepoint ){ + rc = xMethod(db->aVTrans[i]->pVtab, iSavepoint); + } } } } From addd8f872949d25653d925d728011bcceb27be0a Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 25 May 2011 15:54:09 +0000 Subject: [PATCH 10/16] Fix a compiler warning. FossilOrigin-Name: 6df99e52dabf2a243ad635529649b86c21735e91 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/sqliteInt.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 70bd6447db..a7124cf8a8 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Changes\sto\ssavepoint\sin\svirtual\stables\sfor\ssimpler\sand\smore\sconsistent\noperation. -D 2011-05-25T01:16:42.774 +C Fix\sa\scompiler\swarning. +D 2011-05-25T15:54:09.204 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 11dcc00a8d0e5202def00e81732784fb0cc4fe1d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -181,7 +181,7 @@ F src/select.c d9d440809025a58547e39f4f268c2a296bfb56ff F src/shell.c decd04236a7ef26be5ef46d4ea963044bfad9a48 F src/sqlite.h.in 91c63a69eeddbd62182ec00dbfee390016972bdb F src/sqlite3ext.h c90bd5507099f62043832d73f6425d8d5c5da754 -F src/sqliteInt.h aba3cb057fabf6ff9fa634d677e750dfa946a856 +F src/sqliteInt.h d9ff5f198b5bac7ee0c6e1ea55f76897ba4dda87 F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 7ac64842c86cec2fc1a1d0e5c16d3beb8ad332bf F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e @@ -938,7 +938,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 651ef24249d8c22c4f13e4c0bb98a60099cfd23a -R d659c94b5cac09c043b35685a3ce715d +P 92f26a8b8f18832cb1f8ba7dd8e5b020e71a5883 +R 1179d31eff61655636edf672584723cf U drh -Z 45421066265cfeebb2a0b357f6a7553d +Z c44adff51be44d9f0cc2862535697c61 diff --git a/manifest.uuid b/manifest.uuid index ddcd4dc4ff..e2dc48d525 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -92f26a8b8f18832cb1f8ba7dd8e5b020e71a5883 \ No newline at end of file +6df99e52dabf2a243ad635529649b86c21735e91 \ No newline at end of file diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 753c0fcefb..bba0b3c441 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -1235,7 +1235,7 @@ struct VTable { sqlite3_vtab *pVtab; /* Pointer to vtab instance */ int nRef; /* Number of pointers to this structure */ u8 bConstraint; /* True if constraints are supported */ - u32 iSavepoint; /* Depth of the SAVEPOINT stack */ + int iSavepoint; /* Depth of the SAVEPOINT stack */ VTable *pNext; /* Next in linked list (see above) */ }; From 2cac2078f6afd8fb6d262293029e12f9c235a130 Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 25 May 2011 18:46:22 +0000 Subject: [PATCH 11/16] Fix a case where a malloc() error could lead to mismatched virtual-table xBegin/xCommit/xRollback callbacks. FossilOrigin-Name: d807304a695fc85402b86e1cd32a6e3bbb2823c8 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/vtab.c | 30 ++++++++++++++++++++++-------- 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/manifest b/manifest index a7124cf8a8..1074285b3f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\scompiler\swarning. -D 2011-05-25T15:54:09.204 +C Fix\sa\scase\swhere\sa\smalloc()\serror\scould\slead\sto\smismatched\svirtual-table\sxBegin/xCommit/xRollback\scallbacks. +D 2011-05-25T18:46:22.024 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 11dcc00a8d0e5202def00e81732784fb0cc4fe1d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -244,7 +244,7 @@ F src/vdbeaux.c 07a5226ae6e9c6e54b5fcd3c395b86e7ffdba3a4 F src/vdbeblob.c c3ccb7c8732858c680f442932e66ad06bb036562 F src/vdbemem.c 0498796b6ffbe45e32960d6a1f5adfb6e419883b F src/vdbetrace.c 5d0dc3d5fd54878cc8d6d28eb41deb8d5885b114 -F src/vtab.c 6bff354033de8eff72f42565411a72a84fd2b26b +F src/vtab.c 9ba8c7fdb7d39260c033a402f6032d3e7bc5d336 F src/wal.c de27c34c8016c00be348fc6bed588816557ceb66 F src/wal.h 66b40bd91bc29a5be1c88ddd1f5ade8f3f48728a F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f @@ -938,7 +938,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 92f26a8b8f18832cb1f8ba7dd8e5b020e71a5883 -R 1179d31eff61655636edf672584723cf -U drh -Z c44adff51be44d9f0cc2862535697c61 +P 6df99e52dabf2a243ad635529649b86c21735e91 +R 02c26b8fd230a540c57276590c974e79 +U dan +Z e2a23225f8e5abceac6a8fe1d14982ec diff --git a/manifest.uuid b/manifest.uuid index e2dc48d525..5b49fb4d2d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6df99e52dabf2a243ad635529649b86c21735e91 \ No newline at end of file +d807304a695fc85402b86e1cd32a6e3bbb2823c8 \ No newline at end of file diff --git a/src/vtab.c b/src/vtab.c index 0a4c9ea0a4..dffd6a2664 100644 --- a/src/vtab.c +++ b/src/vtab.c @@ -577,11 +577,11 @@ int sqlite3VtabCallConnect(Parse *pParse, Table *pTab){ return rc; } - /* -** Add the virtual table pVTab to the array sqlite3.aVTrans[]. +** Grow the db->aVTrans[] array so that there is room for at least one +** more v-table. Return SQLITE_NOMEM if a malloc fails, or SQLITE_OK otherwise. */ -static int addToVTrans(sqlite3 *db, VTable *pVTab){ +static int growVTrans(sqlite3 *db){ const int ARRAY_INCR = 5; /* Grow the sqlite3.aVTrans array if required */ @@ -596,10 +596,17 @@ static int addToVTrans(sqlite3 *db, VTable *pVTab){ db->aVTrans = aVTrans; } + return SQLITE_OK; +} + +/* +** Add the virtual table pVTab to the array sqlite3.aVTrans[]. Space should +** have already been reserved using growVTrans(). +*/ +static void addToVTrans(sqlite3 *db, VTable *pVTab){ /* Add pVtab to the end of sqlite3.aVTrans */ db->aVTrans[db->nVTrans++] = pVTab; sqlite3VtabLock(pVTab); - return SQLITE_OK; } /* @@ -637,7 +644,10 @@ int sqlite3VtabCallCreate(sqlite3 *db, int iDb, const char *zTab, char **pzErr){ /* Justification of ALWAYS(): The xConstructor method is required to ** create a valid sqlite3_vtab if it returns SQLITE_OK. */ if( rc==SQLITE_OK && ALWAYS(sqlite3GetVTable(db, pTab)) ){ - rc = addToVTrans(db, sqlite3GetVTable(db, pTab)); + rc = growVTrans(db); + if( rc==SQLITE_OK ){ + addToVTrans(db, sqlite3GetVTable(db, pTab)); + } } return rc; @@ -843,10 +853,14 @@ int sqlite3VtabBegin(sqlite3 *db, VTable *pVTab){ } } - /* Invoke the xBegin method */ - rc = pModule->xBegin(pVTab->pVtab); + /* Invoke the xBegin method. If successful, add the vtab to the + ** sqlite3.aVTrans[] array. */ + rc = growVTrans(db); if( rc==SQLITE_OK ){ - rc = addToVTrans(db, pVTab); + rc = pModule->xBegin(pVTab->pVtab); + if( rc==SQLITE_OK ){ + addToVTrans(db, pVTab); + } } } return rc; From ef05c39d12cf13bdad52c9f63f3154a588aaeb74 Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 25 May 2011 20:25:10 +0000 Subject: [PATCH 12/16] Ignore malloc failures within the WAL file truncation attempt for journal_size_limit. FossilOrigin-Name: dd19105aa9521ffc0edcf16b84c064d5ebad55d7 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/wal.c | 2 ++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 1074285b3f..bd65c3d5e3 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\scase\swhere\sa\smalloc()\serror\scould\slead\sto\smismatched\svirtual-table\sxBegin/xCommit/xRollback\scallbacks. -D 2011-05-25T18:46:22.024 +C Ignore\smalloc\sfailures\swithin\sthe\sWAL\sfile\struncation\sattempt\sfor\njournal_size_limit. +D 2011-05-25T20:25:10.559 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 11dcc00a8d0e5202def00e81732784fb0cc4fe1d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -245,7 +245,7 @@ F src/vdbeblob.c c3ccb7c8732858c680f442932e66ad06bb036562 F src/vdbemem.c 0498796b6ffbe45e32960d6a1f5adfb6e419883b F src/vdbetrace.c 5d0dc3d5fd54878cc8d6d28eb41deb8d5885b114 F src/vtab.c 9ba8c7fdb7d39260c033a402f6032d3e7bc5d336 -F src/wal.c de27c34c8016c00be348fc6bed588816557ceb66 +F src/wal.c ab1d8c5abf904fd6396f90499cbd8c54b8d6961b F src/wal.h 66b40bd91bc29a5be1c88ddd1f5ade8f3f48728a F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f F src/where.c 55403ce19c506be6a321c7f129aff693d6103db5 @@ -938,7 +938,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 6df99e52dabf2a243ad635529649b86c21735e91 -R 02c26b8fd230a540c57276590c974e79 -U dan -Z e2a23225f8e5abceac6a8fe1d14982ec +P d807304a695fc85402b86e1cd32a6e3bbb2823c8 +R 40f4c0754c95b7a51c08aa03886ff26c +U drh +Z c74bad4333e073e26c4db5e166f8f584 diff --git a/manifest.uuid b/manifest.uuid index 5b49fb4d2d..f139bfb8f7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d807304a695fc85402b86e1cd32a6e3bbb2823c8 \ No newline at end of file +dd19105aa9521ffc0edcf16b84c064d5ebad55d7 \ No newline at end of file diff --git a/src/wal.c b/src/wal.c index 1222660985..d90fb05d8b 100644 --- a/src/wal.c +++ b/src/wal.c @@ -2539,10 +2539,12 @@ static int walRestartLog(Wal *pWal){ if( pWal->mxWalSize>=0 ){ i64 sz; int rx; + sqlite3BeginBenignMalloc(); rx = sqlite3OsFileSize(pWal->pWalFd, &sz); if( rx==SQLITE_OK && (sz > pWal->mxWalSize) ){ rx = sqlite3OsTruncate(pWal->pWalFd, pWal->mxWalSize); } + sqlite3EndBenignMalloc(); if( rx ){ sqlite3_log(rx, "cannot limit WAL size: %s", pWal->zWalName); } From 7ee4fdd7ba0366a929adb5c94297f9debcf4a4b3 Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 25 May 2011 23:18:02 +0000 Subject: [PATCH 13/16] Fix some minor and harmless compiler warnings. FossilOrigin-Name: a4755e7088c3cc7c5ea191ce37f3950472f523ec --- ext/fts3/fts3.c | 4 ++++ ext/fts3/fts3_aux.c | 6 +++++- ext/rtree/rtree.c | 7 +++++-- manifest | 16 ++++++++-------- manifest.uuid | 2 +- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/ext/fts3/fts3.c b/ext/fts3/fts3.c index 5e2472753e..0aba0546c3 100644 --- a/ext/fts3/fts3.c +++ b/ext/fts3/fts3.c @@ -3665,6 +3665,7 @@ static int fts3RenameMethod( static int fts3SavepointMethod(sqlite3_vtab *pVtab, int iSavepoint){ Fts3Table *p = (Fts3Table*)pVtab; + UNUSED_PARAMETER(iSavepoint); assert( p->inTransaction ); assert( p->mxSavepoint < iSavepoint ); TESTONLY( p->mxSavepoint = iSavepoint ); @@ -3672,6 +3673,8 @@ static int fts3SavepointMethod(sqlite3_vtab *pVtab, int iSavepoint){ } static int fts3ReleaseMethod(sqlite3_vtab *pVtab, int iSavepoint){ TESTONLY( Fts3Table *p = (Fts3Table*)pVtab ); + UNUSED_PARAMETER(iSavepoint); + UNUSED_PARAMETER(pVtab); assert( p->inTransaction ); assert( p->mxSavepoint >= iSavepoint ); TESTONLY( p->mxSavepoint = iSavepoint-1 ); @@ -3679,6 +3682,7 @@ static int fts3ReleaseMethod(sqlite3_vtab *pVtab, int iSavepoint){ } static int fts3RollbackToMethod(sqlite3_vtab *pVtab, int iSavepoint){ Fts3Table *p = (Fts3Table*)pVtab; + UNUSED_PARAMETER(iSavepoint); assert( p->inTransaction ); assert( p->mxSavepoint >= iSavepoint ); TESTONLY( p->mxSavepoint = iSavepoint ); diff --git a/ext/fts3/fts3_aux.c b/ext/fts3/fts3_aux.c index 6108689ae1..cd035d2a30 100644 --- a/ext/fts3/fts3_aux.c +++ b/ext/fts3/fts3_aux.c @@ -342,6 +342,7 @@ static int fts3auxFilterMethod( int isScan; UNUSED_PARAMETER(nVal); + UNUSED_PARAMETER(idxStr); assert( idxStr==0 ); assert( idxNum==FTS4AUX_EQ_CONSTRAINT || idxNum==0 @@ -459,7 +460,10 @@ int sqlite3Fts3InitAux(sqlite3 *db){ 0, /* xCommit */ 0, /* xRollback */ 0, /* xFindFunction */ - 0 /* xRename */ + 0, /* xRename */ + 0, /* xSavepoint */ + 0, /* xRelease */ + 0 /* xRollbackTo */ }; int rc; /* Return code */ diff --git a/ext/rtree/rtree.c b/ext/rtree/rtree.c index 6e00827b46..66a10df1c3 100644 --- a/ext/rtree/rtree.c +++ b/ext/rtree/rtree.c @@ -2849,7 +2849,7 @@ static int rtreeRename(sqlite3_vtab *pVtab, const char *zNewName){ } static sqlite3_module rtreeModule = { - 0, /* iVersion */ + 0, /* iVersion */ rtreeCreate, /* xCreate - create a table */ rtreeConnect, /* xConnect - connect to an existing table */ rtreeBestIndex, /* xBestIndex - Determine search strategy */ @@ -2868,7 +2868,10 @@ static sqlite3_module rtreeModule = { 0, /* xCommit - commit transaction */ 0, /* xRollback - rollback transaction */ 0, /* xFindFunction - function overloading */ - rtreeRename /* xRename - rename the table */ + rtreeRename, /* xRename - rename the table */ + 0, /* xSavepoint */ + 0, /* xRelease */ + 0 /* xRollbackTo */ }; static int rtreeSqlInit( diff --git a/manifest b/manifest index bd65c3d5e3..bd8d6e5ef2 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Ignore\smalloc\sfailures\swithin\sthe\sWAL\sfile\struncation\sattempt\sfor\njournal_size_limit. -D 2011-05-25T20:25:10.559 +C Fix\ssome\sminor\sand\sharmless\scompiler\swarnings. +D 2011-05-25T23:18:02.794 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 11dcc00a8d0e5202def00e81732784fb0cc4fe1d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -61,10 +61,10 @@ F ext/fts2/mkfts2amal.tcl 974d5d438cb3f7c4a652639262f82418c1e4cff0 F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a F ext/fts3/README.tokenizers 998756696647400de63d5ba60e9655036cb966e9 F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d -F ext/fts3/fts3.c 0a2ae110f2d1806687ee0de837ac1eff106843b4 +F ext/fts3/fts3.c b3a10a1a320aaeb56a1dd6710bf09eb5c2370839 F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe F ext/fts3/fts3Int.h c8c0011c5e5b3a7703376ea6cd7deb91cfb96a06 -F ext/fts3/fts3_aux.c 9e931f55eed8498dafe7bc1160f10cbb1a652fdf +F ext/fts3/fts3_aux.c 97c960b1b0d371c08eae6b8565dfac619eb9d979 F ext/fts3/fts3_expr.c 5f49e0deaf723724b08100bb3ff40aab02ad0c93 F ext/fts3/fts3_hash.c 3c8f6387a4a7f5305588b203fa7c887d753e1f1c F ext/fts3/fts3_hash.h 8331fb2206c609f9fc4c4735b9ab5ad6137c88ec @@ -82,7 +82,7 @@ F ext/icu/README.txt bf8461d8cdc6b8f514c080e4e10dc3b2bbdfefa9 F ext/icu/icu.c eb9ae1d79046bd7871aa97ee6da51eb770134b5a F ext/icu/sqliteicu.h 728867a802baa5a96de7495e9689a8e01715ef37 F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761 -F ext/rtree/rtree.c 2445bec932f58f8f4fe9de49a63bd6bf24db82d6 +F ext/rtree/rtree.c 4b8438444927191b55de18e00df43b2e02aacbda F ext/rtree/rtree.h 834dbcb82dc85b2481cde6a07cdadfddc99e9b9e F ext/rtree/rtree1.test 28e1b8da4da98093ce3210187434dd760a8d89d8 F ext/rtree/rtree2.test acbb3a4ce0f4fbc2c304d2b4b784cfa161856bba @@ -938,7 +938,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P d807304a695fc85402b86e1cd32a6e3bbb2823c8 -R 40f4c0754c95b7a51c08aa03886ff26c +P dd19105aa9521ffc0edcf16b84c064d5ebad55d7 +R 008aea5da6bfc4eb7e4a2c09eb3620eb U drh -Z c74bad4333e073e26c4db5e166f8f584 +Z e8c2f21e52caf9d88919dc2348e8bfe9 diff --git a/manifest.uuid b/manifest.uuid index f139bfb8f7..310e58b317 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -dd19105aa9521ffc0edcf16b84c064d5ebad55d7 \ No newline at end of file +a4755e7088c3cc7c5ea191ce37f3950472f523ec \ No newline at end of file From 305ebab7cc7b12e17a502865a01c9d20658495fe Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 26 May 2011 14:19:14 +0000 Subject: [PATCH 14/16] Changes to work with SQLITE_OMIT_VIRTUAL_TABLE. FossilOrigin-Name: 03f7d36a8a24825b7542b5fed651af1622ae4eb5 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/vdbe.c | 2 ++ test/tkt-2d1a5c67d.test | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index bd8d6e5ef2..3f4e379ddd 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\ssome\sminor\sand\sharmless\scompiler\swarnings. -D 2011-05-25T23:18:02.794 +C Changes\sto\swork\swith\sSQLITE_OMIT_VIRTUAL_TABLE. +D 2011-05-26T14:19:14.865 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 11dcc00a8d0e5202def00e81732784fb0cc4fe1d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -236,7 +236,7 @@ F src/update.c 5bcb56e5c7380a2eecb0e71891dbd4ad7437748f F src/utf.c d83650c3ea08f7407bd9d0839d9885241c209c60 F src/util.c 0f33bbbdfcc4a2d8cf20c3b2a16ffc3b57c58a70 F src/vacuum.c 05513dca036a1e7848fe18d5ed1265ac0b32365e -F src/vdbe.c 4812f0e5813b3969307ec466d26d9b32b7b814e9 +F src/vdbe.c a8ff6724d4f1ca8c45ef778d67633d1fb4d9bdbf F src/vdbe.h 8a675fefdf7119441fe817c800a9a52440c2e797 F src/vdbeInt.h fe8f58d305e629fff02f61f655aca1d299f1f6ae F src/vdbeapi.c e0e2672e0a96ae3f8575c8ecd02912a3e8a554a1 @@ -705,7 +705,7 @@ F test/threadtest2.c ace893054fa134af3fc8d6e7cfecddb8e3acefb9 F test/threadtest3.c 0ed13e09690f6204d7455fac3b0e8ece490f6eef F test/tkt-02a8e81d44.test 58494de77be2cf249228ada3f313fa399821c6ab F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660 -F test/tkt-2d1a5c67d.test 450b3cf86ca9a3b1fd0a9e136978142be3bff7e0 +F test/tkt-2d1a5c67d.test 73574c758502bf23260c17f97fcd9316dfb5a060 F test/tkt-2ea2425d34.test 1cf13e6f75d149b3209a0cb32927a82d3d79fb28 F test/tkt-31338dca7e.test 5741cd48de500347a437ba1be58c8335e83c5a5e F test/tkt-313723c356.test c47f8a9330523e6f35698bf4489bcb29609b53ac @@ -938,7 +938,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P dd19105aa9521ffc0edcf16b84c064d5ebad55d7 -R 008aea5da6bfc4eb7e4a2c09eb3620eb +P a4755e7088c3cc7c5ea191ce37f3950472f523ec +R 730ee7bc721983cbb8520125b21bb17e U drh -Z e8c2f21e52caf9d88919dc2348e8bfe9 +Z d447764bdbeb7397b78d42ae4b389d7c diff --git a/manifest.uuid b/manifest.uuid index 310e58b317..ff053854df 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a4755e7088c3cc7c5ea191ce37f3950472f523ec \ No newline at end of file +03f7d36a8a24825b7542b5fed651af1622ae4eb5 \ No newline at end of file diff --git a/src/vdbe.c b/src/vdbe.c index add643f176..c55927e663 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -2584,6 +2584,7 @@ case OP_Savepoint: { }else{ nName = sqlite3Strlen30(zName); +#ifdef SQLITE_OMIT_VIRTUAL_TABLE /* This call is Ok even if this savepoint is actually a transaction ** savepoint (and therefore should not prompt xSavepoint()) callbacks. ** If this is a transaction savepoint being opened, it is guaranteed @@ -2592,6 +2593,7 @@ case OP_Savepoint: { rc = sqlite3VtabSavepoint(db, SAVEPOINT_BEGIN, db->nStatement+db->nSavepoint); if( rc!=SQLITE_OK ) goto abort_due_to_error; +#endif /* Create a new savepoint structure. */ pNew = sqlite3DbMallocRaw(db, sizeof(Savepoint)+nName+1); diff --git a/test/tkt-2d1a5c67d.test b/test/tkt-2d1a5c67d.test index 5db364bd79..278e1d38bc 100644 --- a/test/tkt-2d1a5c67d.test +++ b/test/tkt-2d1a5c67d.test @@ -19,7 +19,7 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix tkt-2d1a5c67d -ifcapable !wal {finish_test; return} +ifcapable {!wal || !vtab} {finish_test; return} for {set ii 1} {$ii<=10} {incr ii} { do_test tkt-2d1a5c67d.1.$ii { From c97125eb72437be15c8499782bb00c786671cd4a Mon Sep 17 00:00:00 2001 From: drh Date: Sat, 28 May 2011 15:53:07 +0000 Subject: [PATCH 15/16] Print a log message on each cache spill if compiled with SQLITE_LOG_CACHE_SPILL. FossilOrigin-Name: 5f15579f8ca747f0fa0a7867ceffc8c7b8f904e6 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/pcache.c | 7 +++++++ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index 3f4e379ddd..ef773de94f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Changes\sto\swork\swith\sSQLITE_OMIT_VIRTUAL_TABLE. -D 2011-05-26T14:19:14.865 +C Print\sa\slog\smessage\son\seach\scache\sspill\sif\scompiled\swith\nSQLITE_LOG_CACHE_SPILL. +D 2011-05-28T15:53:07.056 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 11dcc00a8d0e5202def00e81732784fb0cc4fe1d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -168,7 +168,7 @@ F src/os_win.c 218b899469e570d46eb8147c2383075f7c026230 F src/pager.c 120550e7ef01dafaa2cbb4a0528c0d87c8f12b41 F src/pager.h 3f8c783de1d4706b40b1ac15b64f5f896bcc78d1 F src/parse.y 12b7ebd61ea54f0e1b1083ff69cc2c8ce9353d58 -F src/pcache.c 09d38c44ab275db581f7a2f6ff8b9bc7f8c0faaa +F src/pcache.c 49e718c095810c6b3334e3a6d89970aceaddefce F src/pcache.h c683390d50f856d4cd8e24342ae62027d1bb6050 F src/pcache1.c d548e31beafa792d1994b663a29a5303569efc4e F src/pragma.c 9e778decc3ee9bcaf88904b4a3b0a4360aaf0eab @@ -938,7 +938,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P a4755e7088c3cc7c5ea191ce37f3950472f523ec -R 730ee7bc721983cbb8520125b21bb17e +P 03f7d36a8a24825b7542b5fed651af1622ae4eb5 +R ecca10c4aa82cb4b740a494236bdb180 U drh -Z d447764bdbeb7397b78d42ae4b389d7c +Z 7233c15025f0530a32ecee3359d1f724 diff --git a/manifest.uuid b/manifest.uuid index ff053854df..42def11d4f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -03f7d36a8a24825b7542b5fed651af1622ae4eb5 \ No newline at end of file +5f15579f8ca747f0fa0a7867ceffc8c7b8f904e6 \ No newline at end of file diff --git a/src/pcache.c b/src/pcache.c index 242f3071d9..f37511e9e4 100644 --- a/src/pcache.c +++ b/src/pcache.c @@ -253,6 +253,13 @@ int sqlite3PcacheFetch( } if( pPg ){ int rc; +#ifdef SQLITE_LOG_CACHE_SPILL + sqlite3_log(SQLITE_FULL, + "spill page %d making room for %d - cache used: %d/%d", + pPg->pgno, pgno, + sqlite3GlobalConfig.pcache.xPagecount(pCache->pCache), + pCache->nMax); +#endif rc = pCache->xStress(pCache->pStress, pPg); if( rc!=SQLITE_OK && rc!=SQLITE_BUSY ){ return rc; From 21f80f0478ae4570dfd9f803fecd15a05abc5b54 Mon Sep 17 00:00:00 2001 From: drh Date: Sat, 28 May 2011 19:24:15 +0000 Subject: [PATCH 16/16] Fix a "#ifdef" from check-in [03f7d36a8a] that should have been "#ifndef". FossilOrigin-Name: edb865c35415f9553f8279028120f7b8de2bf7e2 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/vdbe.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index ef773de94f..701dc47e95 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Print\sa\slog\smessage\son\seach\scache\sspill\sif\scompiled\swith\nSQLITE_LOG_CACHE_SPILL. -D 2011-05-28T15:53:07.056 +C Fix\sa\s"#ifdef"\sfrom\scheck-in\s[03f7d36a8a]\sthat\sshould\shave\sbeen\s"#ifndef". +D 2011-05-28T19:24:15.852 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 11dcc00a8d0e5202def00e81732784fb0cc4fe1d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -236,7 +236,7 @@ F src/update.c 5bcb56e5c7380a2eecb0e71891dbd4ad7437748f F src/utf.c d83650c3ea08f7407bd9d0839d9885241c209c60 F src/util.c 0f33bbbdfcc4a2d8cf20c3b2a16ffc3b57c58a70 F src/vacuum.c 05513dca036a1e7848fe18d5ed1265ac0b32365e -F src/vdbe.c a8ff6724d4f1ca8c45ef778d67633d1fb4d9bdbf +F src/vdbe.c 380dddc404c1e4a9260a4194daa728b94ed102d7 F src/vdbe.h 8a675fefdf7119441fe817c800a9a52440c2e797 F src/vdbeInt.h fe8f58d305e629fff02f61f655aca1d299f1f6ae F src/vdbeapi.c e0e2672e0a96ae3f8575c8ecd02912a3e8a554a1 @@ -938,7 +938,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 03f7d36a8a24825b7542b5fed651af1622ae4eb5 -R ecca10c4aa82cb4b740a494236bdb180 +P 5f15579f8ca747f0fa0a7867ceffc8c7b8f904e6 +R a63903941bea8f77658823b8763468e2 U drh -Z 7233c15025f0530a32ecee3359d1f724 +Z 62e9bfe1cc7669e25feec8cecb39066d diff --git a/manifest.uuid b/manifest.uuid index 42def11d4f..60ef9e438e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -5f15579f8ca747f0fa0a7867ceffc8c7b8f904e6 \ No newline at end of file +edb865c35415f9553f8279028120f7b8de2bf7e2 \ No newline at end of file diff --git a/src/vdbe.c b/src/vdbe.c index c55927e663..d28f73d1b1 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -2584,7 +2584,7 @@ case OP_Savepoint: { }else{ nName = sqlite3Strlen30(zName); -#ifdef SQLITE_OMIT_VIRTUAL_TABLE +#ifndef SQLITE_OMIT_VIRTUAL_TABLE /* This call is Ok even if this savepoint is actually a transaction ** savepoint (and therefore should not prompt xSavepoint()) callbacks. ** If this is a transaction savepoint being opened, it is guaranteed