From: drh Date: Thu, 25 Feb 2010 01:54:06 +0000 (+0000) Subject: Merge in the fix for VACUUM on auto_vacuumed databases with large schemas. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9b7e9ff6a0fb17b05139ba2f8ff4d4b1139fed88;p=thirdparty%2Fsqlite.git Merge in the fix for VACUUM on auto_vacuumed databases with large schemas. Check-in [86d50ce57f]. Ticket [da1151f97df]. FossilOrigin-Name: ce624e39c2f7c5480937a8d2007e7ebd684665dc --- diff --git a/manifest b/manifest index d32d613ea5..19aa3c4044 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -C Start\sa\snew\sbranch\sfor\srelease\s3.6.22\splus\slimited\senhancements\sand\sfixes.\nThis\sfirst\scheck-in\sincludes\sthe\sperformance\senhancements\sof\scheck-ins\n[26cb1df735],\s[61a2c8d4d6],\sand\s[27dc5b1c52] -D 2010-02-25T01:47:15 +C Merge\sin\sthe\sfix\sfor\sVACUUM\son\sauto_vacuumed\sdatabases\swith\slarge\sschemas.\nCheck-in\s[86d50ce57f].\s\sTicket\s[da1151f97df]. +D 2010-02-25T01:54:07 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in c5827ead754ab32b9585487177c93bb00b9497b3 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -153,7 +153,7 @@ F src/os_common.h 240c88b163b02c21a9f21f87d49678a0aa21ff30 F src/os_os2.c 75a8c7b9a00a2cf1a65f9fa4afbc27d46634bb2f F src/os_unix.c b24510792108ffee0c8175c1d2fc644913b241d2 F src/os_win.c 5ffab20249a61e0625f869efe157fa009747039b -F src/pager.c 4cf8da7cf454d09086400c3b2943b41e6e46e829 +F src/pager.c 3250440da3ba886123d7f5976818d89e35b758f6 F src/pager.h 1b32faf2e578ac3e7bcf9c9d11217128261c5c54 F src/parse.y ace5c7a125d9f2a410e431ee3209034105045f7e F src/pcache.c 815bcb3cf0e14b23212efd3f4981f667a5fd633e @@ -724,6 +724,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 @@ -786,19 +787,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 28d0d7710761114a44a1a3a425a6883c661f06e7 -R e608221d1b513ecccc862a625a27a77f -T *bgcolor * #bfd970 -T *branch * branch-3.6.22 -T *sym-branch-3.6.22 * -T -sym-release * -T -sym-trunk * +P 9588259882541e215813f48ccfa9180d8013a876 +R 1b3ce005dad313bc765273a4b8d0c293 U drh -Z 134c3f3d253c63c36ebbeda1827f6c9d +Z 0aac407dd204ae64ed5ea6a13a82db48 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) -iD8DBQFLhdanoxKgR168RlERAof5AJ9uQvTNx+3jUFJt/A5BxxpZ0rRqdACgijY7 -OFhF60IkoiKCXeuk36DDNL8= -=XhXU +iD8DBQFLhdhDoxKgR168RlERAv2+AKCH9bpqmnpE0c2/f+XzXmMVOvZDAgCeJ5Ke +xndxhZ01ISXHfrjACQDvM9A= +=H/md -----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index caa8a728d5..0c1bd86f05 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9588259882541e215813f48ccfa9180d8013a876 \ No newline at end of file +ce624e39c2f7c5480937a8d2007e7ebd684665dc \ No newline at end of file diff --git a/src/pager.c b/src/pager.c index 62d9775e10..a79537ab13 100644 --- a/src/pager.c +++ b/src/pager.c @@ -3842,7 +3842,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; + } +} {}