From: drh Date: Mon, 22 Feb 2010 23:17:42 +0000 (+0000) Subject: Fix an assertion-fault/segfault problem that comes up when trying to X-Git-Tag: version-3.7.2~596 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4ec84f35e2bde4d94ac4c6ab0808025085005c1b;p=thirdparty%2Fsqlite.git Fix an assertion-fault/segfault problem that comes up when trying to VACUUM an auto-vacuumed database with a large schema. Ticket [da1151f97df244]. FossilOrigin-Name: 86d50ce57feb78440956192e37a03686ffa1e196 --- diff --git a/manifest b/manifest index 079aeed488..3c9769f42d 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -C Merge\sin\sthe\smassive\sclean-up\sand\sANSI-fication\sof\sLemon\scarried\sout\nby\sRyan\sGordon.\s\sThere\sare\sno\sfunctional\schanges\sto\sSQLite\sitself\s-\sLemon\nstill\sgenerates\sexactly\sthe\ssame\sparsing\sautomaton\sfrom\sexactly\sthe\ssame\ngrammar. -D 2010-02-22T19:37:44 +C Fix\san\sassertion-fault/segfault\sproblem\sthat\scomes\sup\swhen\strying\sto\nVACUUM\san\sauto-vacuumed\sdatabase\swith\sa\slarge\sschema.\s\nTicket\s[da1151f97df244]. +D 2010-02-22T23:17:42 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in c5827ead754ab32b9585487177c93bb00b9497b3 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -154,7 +154,7 @@ F src/os_common.h 240c88b163b02c21a9f21f87d49678a0aa21ff30 F src/os_os2.c 75a8c7b9a00a2cf1a65f9fa4afbc27d46634bb2f F src/os_unix.c 0af0a55e2dd55bc4f4c3ccf04cc8f1f4a2e2e65f F src/os_win.c 5ffab20249a61e0625f869efe157fa009747039b -F src/pager.c 5dee83c3cf4e94b72fcd81dca67abd7617227217 +F src/pager.c d0e53cd301c82d3b67ee69c7b900b56e5b17070d F src/pager.h 1b32faf2e578ac3e7bcf9c9d11217128261c5c54 F src/parse.y ace5c7a125d9f2a410e431ee3209034105045f7e F src/pcache.c 815bcb3cf0e14b23212efd3f4981f667a5fd633e @@ -730,6 +730,7 @@ F test/utf16align.test 54cd35a27c005a9b6e7815d887718780b6a462ae F test/vacuum.test 68e39b2228b4b772166debef4a82accf6ddd32f3 F test/vacuum2.test ec57f21d394b7b72249b11f8e4b5d487bab56539 F test/vacuum3.test f39ad1428347c5808cd2da7578c470f186a4d0ce +F test/vacuum4.test d3f8ecff345f166911568f397d2432c16d2867d9 F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102 F test/veryquick.test e265401afefa994cdf2fe4b6f286b1e87c2f9b9d F test/view.test 45f518205ecdb6dd23a86dd4a99bb4ae945e625d @@ -793,14 +794,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P a8076aede33c07e9a2aaa05be8a888f37b45e41c 721f33e7221c5fc907e9e293ac3242843f4fcfb7 -R 450fcba6aea5b20aec6d511bce230dbe +P 1e8b842039cc06b57a321226633c55b94eb8dcd7 +R 06756ad8541fef8ef0cebc9ff5692f8d U drh -Z f72661ff70306bbed226b0e608b0a014 +Z b557d7fb4d0e234f9fa6b902c44ce00a -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) -iD8DBQFLgt0LoxKgR168RlERAoxeAJ9pMwbfj9A/W4G3C1CtQ290wQ3EXwCcCH1G -03zT6XIKKGdbivHexIMUwAE= -=j4CO +iD8DBQFLgxCZoxKgR168RlERAnKMAJ4sis2aZYWJRDTipYeWbj/CPDSbGwCdFGgm +Uu4h1w5TiR0CYCeH1mIeplU= +=d4Ru -----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index d759e97241..8713b33e94 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1e8b842039cc06b57a321226633c55b94eb8dcd7 \ No newline at end of file +86d50ce57feb78440956192e37a03686ffa1e196 \ No newline at end of file diff --git a/src/pager.c b/src/pager.c index 83f02940ac..b5c7fe4945 100644 --- a/src/pager.c +++ b/src/pager.c @@ -3840,7 +3840,7 @@ int sqlite3PagerAcquire( goto pager_acquire_err; } - if( MEMDB || nMax<(int)pgno || noContent ){ + if( MEMDB || nMax<(int)pgno || noContent || !isOpen(pPager->fd) ){ if( pgno>pPager->mxPgno ){ rc = SQLITE_FULL; goto pager_acquire_err; diff --git a/test/vacuum4.test b/test/vacuum4.test new file mode 100644 index 0000000000..326d037276 --- /dev/null +++ b/test/vacuum4.test @@ -0,0 +1,67 @@ +# 2010 February 21 +# +# 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. +# +#*********************************************************************** +# +# This file implements a test of ticket [da1151f97df244a1]: An +# assertion fault while VACUUMing an auto_vacuumed database with +# large schema. +# + +set testdir [file dirname $argv0] +source $testdir/tester.tcl + +# If the VACUUM statement is disabled in the current build, skip all +# the tests in this file. +# +ifcapable !vacuum { + finish_test + return +} + +do_test vacuum4-1.1 { + db eval { + PRAGMA auto_vacuum=FULL; + CREATE TABLE t1( + c000, c001, c002, c003, c004, c005, c006, c007, c008, c009, + c010, c011, c012, c013, c014, c015, c016, c017, c018, c019, + c020, c021, c022, c023, c024, c025, c026, c027, c028, c029, + c030, c031, c032, c033, c034, c035, c036, c037, c038, c039, + c040, c041, c042, c043, c044, c045, c046, c047, c048, c049, + c050, c051, c052, c053, c054, c055, c056, c057, c058, c059, + c060, c061, c062, c063, c064, c065, c066, c067, c068, c069, + c070, c071, c072, c073, c074, c075, c076, c077, c078, c079, + c080, c081, c082, c083, c084, c085, c086, c087, c088, c089, + c090, c091, c092, c093, c094, c095, c096, c097, c098, c099, + c100, c101, c102, c103, c104, c105, c106, c107, c108, c109, + c110, c111, c112, c113, c114, c115, c116, c117, c118, c119, + c120, c121, c122, c123, c124, c125, c126, c127, c128, c129, + c130, c131, c132, c133, c134, c135, c136, c137, c138, c139, + c140, c141, c142, c143, c144, c145, c146, c147, c148, c149 + ); + CREATE TABLE t2( + c000, c001, c002, c003, c004, c005, c006, c007, c008, c009, + c010, c011, c012, c013, c014, c015, c016, c017, c018, c019, + c020, c021, c022, c023, c024, c025, c026, c027, c028, c029, + c030, c031, c032, c033, c034, c035, c036, c037, c038, c039, + c040, c041, c042, c043, c044, c045, c046, c047, c048, c049, + c050, c051, c052, c053, c054, c055, c056, c057, c058, c059, + c060, c061, c062, c063, c064, c065, c066, c067, c068, c069, + c070, c071, c072, c073, c074, c075, c076, c077, c078, c079, + c080, c081, c082, c083, c084, c085, c086, c087, c088, c089, + c090, c091, c092, c093, c094, c095, c096, c097, c098, c099, + c100, c101, c102, c103, c104, c105, c106, c107, c108, c109, + c110, c111, c112, c113, c114, c115, c116, c117, c118, c119, + c120, c121, c122, c123, c124, c125, c126, c127, c128, c129, + c130, c131, c132, c133, c134, c135, c136, c137, c138, c139, + c140, c141, c142, c143, c144, c145, c146, c147, c148, c149 + ); + VACUUM; + } +} {}