From eb43e5c7b7e43b73fff887728ee982a1394c0fb7 Mon Sep 17 00:00:00 2001 From: drh Date: Sun, 22 May 2005 20:30:39 +0000 Subject: [PATCH] The cache_size pragma should not reset the synchronous pragma. Ticket #1260. (CVS 2474) FossilOrigin-Name: 2db2b32f269062b006ae5c4a302d116cdab8f9ec --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/pager.c | 16 +--------------- test/pragma.test | 5 +++-- 4 files changed, 12 insertions(+), 25 deletions(-) diff --git a/manifest b/manifest index 0bdc945000..47e3162e1c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Never\suser\sa\spointer\sto\sstandard\slibrary\sroutines\smalloc()\sand\sfree().\r\nThis\srule\sis\sto\r\nwork\saround\slimitations\sof\sMSVC\sand\sthe\s_fastcall\scalling\sconvention.\r\nTicket\s#1256.\s(CVS\s2473) -D 2005-05-22T20:12:37 +C The\scache_size\spragma\sshould\snot\sreset\sthe\ssynchronous\spragma.\s\sTicket\s#1260.\s(CVS\s2474) +D 2005-05-22T20:30:39 F Makefile.in 5c00d0037104de2a50ac7647a5f12769795957a3 F Makefile.linux-gcc 06be33b2a9ad4f005a5f42b22c4a19dab3cbb5c7 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -52,7 +52,7 @@ F src/os_unix.c cb8a39901b8eb920372c2e42f7ea9ab40f2e47ae F src/os_unix.h 39a393252e69e72b06715c9958df05ddbc4aa971 F src/os_win.c 2bbbe6fbb010763c3fa79d5e951afca9b138c6b5 F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b -F src/pager.c c91b599f64118c1b3046d8029b15c7f8f0fe9310 +F src/pager.c f86d79d37eb4e30d8e2201dbe12497370719320c F src/pager.h 0d9153d6269d60d04af3dd84a0cc0a96253cf4a4 F src/parse.y 3e314b3a96b199b0501ed426f2cee3392ffce806 F src/pragma.c 0ed94a1aa982802a9cf2a932c48d99b60683fa53 @@ -171,7 +171,7 @@ F test/pager.test 1579e8f07291ae8e24db62ffade5c101c3e76597 F test/pager2.test 49c0f57c7da0b060f0486b85fdd074025caa694e F test/pager3.test 2323bf27fd5bd887b580247e5bce500ceee994b4 F test/pagesize.test cbc6a312b6f6c0f02619b189985df2a14164b690 -F test/pragma.test effcf2f0dea35223cbaa6bf40c47d0796ba39e40 +F test/pragma.test 95ea907adf68459e1be6f310c9ae94d1d59c465b F test/printf.test 92ba4c510b4fc61120ffa4a01820446ed917ae57 F test/progress.test 16496001da445e6534afb94562c286708316d82f x F test/quick.test a94d12658a2b590c1a5be580bef09bbb04c1266b @@ -279,7 +279,7 @@ F www/tclsqlite.tcl 425be741b8ae664f55cb1ef2371aab0a75109cf9 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/whentouse.tcl 528299b8316726dbcc5548e9aa0648c8b1bd055b -P 254ac2213e695ead065ba3807d5d285046212fe1 -R d1ea6d9ebc828607ed9bd32c6c8038d0 +P a39c446726099e4915a1ad72c019d3c2cfe065bb +R a02eb89de3c808a027e63910ec80249c U drh -Z 3ea66755830174fb2ac88e49c4d8b8fd +Z 6e6c338bc9d8194056883c794c6e0cec diff --git a/manifest.uuid b/manifest.uuid index 221a6dc939..68fe6b7a91 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a39c446726099e4915a1ad72c019d3c2cfe065bb \ No newline at end of file +2db2b32f269062b006ae5c4a302d116cdab8f9ec \ No newline at end of file diff --git a/src/pager.c b/src/pager.c index 578be3d5de..239232e514 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.205 2005/05/21 02:48:09 drh Exp $ +** @(#) $Id: pager.c,v 1.206 2005/05/22 20:30:39 drh Exp $ */ #ifndef SQLITE_OMIT_DISKIO #include "sqliteInt.h" @@ -1495,22 +1495,8 @@ end_stmt_playback: /* ** Change the maximum number of in-memory pages that are allowed. -** -** The maximum number is the absolute value of the mxPage parameter. -** If mxPage is negative, the noSync flag is also set. noSync bypasses -** calls to sqlite3OsSync(). The pager runs much faster with noSync on, -** but if the operating system crashes or there is an abrupt power -** failure, the database file might be left in an inconsistent and -** unrepairable state. */ void sqlite3pager_set_cachesize(Pager *pPager, int mxPage){ - if( mxPage>=0 ){ - pPager->noSync = pPager->tempFile; - if( pPager->noSync ) pPager->needSync = 0; - }else{ - pPager->noSync = 1; - mxPage = -mxPage; - } if( mxPage>10 ){ pPager->mxPage = mxPage; }else{ diff --git a/test/pragma.test b/test/pragma.test index 63dd2e54f7..0aba19acc6 100644 --- a/test/pragma.test +++ b/test/pragma.test @@ -12,7 +12,7 @@ # # This file implements tests for the PRAGMA command. # -# $Id: pragma.test,v 1.35 2005/03/29 03:11:00 danielk1977 Exp $ +# $Id: pragma.test,v 1.36 2005/05/22 20:30:39 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -50,12 +50,13 @@ do_test pragma-1.1 { } {2000 2000 2} do_test pragma-1.2 { execsql { + PRAGMA synchronous=OFF; PRAGMA cache_size=1234; PRAGMA cache_size; PRAGMA default_cache_size; PRAGMA synchronous; } -} {1234 2000 2} +} {1234 2000 0} do_test pragma-1.3 { db close sqlite3 db test.db