diff --git a/manifest b/manifest index a9e401b96b..a8fda48d5f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\stypos\sin\scomments\sused\sto\shelp\sgenerate\sdocumentation.\s\sNo\schanges\sto\scode. -D 2014-08-14T13:06:25.245 +C Fix\san\sassert\sthat\scan\sfail\sif\sthe\sdatabase\sfile\sis\scorrupted. +D 2014-08-14T19:53:37.748 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5eb79e334a5de69c87740edd56af6527dd219308 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -167,7 +167,7 @@ F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34 F src/backup.c a729e63cf5cd1829507cb7b8e89f99b95141bb53 F src/bitvec.c 19a4ba637bd85f8f63fc8c9bae5ade9fb05ec1cb F src/btmutex.c 976f45a12e37293e32cae0281b15a21d48a8aaa7 -F src/btree.c 99d162e57af6e72ffd7db5bf79568a134cd87d5b +F src/btree.c fa057e30794bfd867963b44a3a42710a45c335a1 F src/btree.h 4245a349bfe09611d7ff887dbc3a80cee8b7955a F src/btreeInt.h cf180d86b2e9e418f638d65baa425c4c69c0e0e3 F src/build.c 5abf794fe8a605f2005b422e98a3cedad9b9ef5b @@ -413,7 +413,7 @@ F test/corruptE.test 193b4ca4e927e77c1d5f4f56203ddc998432a7ee F test/corruptF.test be9fde98e4c93648f1ba52b74e5318edc8f59fe4 F test/corruptG.test 1ab3bf97ee7bdba70e0ff3ba2320657df55d1804 F test/corruptH.test 88ed71a086e13591c917aac6de32750e7c7281cb -F test/corruptI.test b3e4203d420490fc3d3062711597bc1dea06a789 +F test/corruptI.test 0afbba50bfae006094cc548b4605f521c1179502 F test/cost.test 19d314526616ce4473eb4e4e450fcb94499ce318 F test/count.test 42a251178e32f617eda33f76236a7f79825a50b5 F test/coveridxscan.test cdb47d01acc4a634a34fd25abe85189e0d0f1e62 @@ -1186,7 +1186,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P f5cce9db109a2bbe9a05b4c01b076a51d5fad8ba -R b4842944a4c3679f5b3af787e9b322df -U drh -Z 52db703ea373cd617fd2c598672c0ab8 +P 13a2d90a2869c53b79754de39045bbbdbc7688e3 +R be8bb3bca247e348b90f7388fee24972 +U dan +Z 1fbc222a1bef7c1b8874e0319a4338ee diff --git a/manifest.uuid b/manifest.uuid index 5d1e011162..8166d1d7f4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -13a2d90a2869c53b79754de39045bbbdbc7688e3 \ No newline at end of file +3f45b8192dad7fb1f027cbaa694046e3c1b3e278 \ No newline at end of file diff --git a/src/btree.c b/src/btree.c index 17719caf91..60bc7de41e 100644 --- a/src/btree.c +++ b/src/btree.c @@ -5741,7 +5741,8 @@ static void insertCell( if( *pRC ) return; assert( i>=0 && i<=pPage->nCell+pPage->nOverflow ); - assert( pPage->nCell<=MX_CELL(pPage->pBt) && MX_CELL(pPage->pBt)<=10921 ); + assert( MX_CELL(pPage->pBt)<=10921 ); + assert( pPage->nCell<=MX_CELL(pPage->pBt) || CORRUPT_DB ); assert( pPage->nOverflow<=ArraySize(pPage->apOvfl) ); assert( ArraySize(pPage->apOvfl)==ArraySize(pPage->aiOvfl) ); assert( sqlite3_mutex_held(pPage->pBt->mutex) ); diff --git a/test/corruptI.test b/test/corruptI.test index ed34c0f8c3..41200c5409 100644 --- a/test/corruptI.test +++ b/test/corruptI.test @@ -75,5 +75,31 @@ do_test 2.2 { catchsql { SELECT * FROM r WHERE x >= 10 } } {1 {database disk image is malformed}} +reset_db + +do_execsql_test 3.1 { + PRAGMA page_size = 512; + CREATE TABLE t1(a INTEGER PRIMARY KEY, b); + WITH s(a, b) AS ( + SELECT 2, 'abcdefghij' + UNION ALL + SELECT a+2, b FROM s WHERe a < 40 + ) + INSERT INTO t1 SELECT * FROM s; +} {} + +do_test 3.2 { + hexio_write test.db [expr 512+3] 0054 + db close + sqlite3 db test.db + execsql { INSERT INTO t1 VALUES(5, 'klmnopqrst') } + execsql { INSERT INTO t1 VALUES(7, 'klmnopqrst') } +} {} + +db close +sqlite3 db test.db +do_catchsql_test 3.2 { + INSERT INTO t1 VALUES(9, 'klmnopqrst'); +} {1 {database disk image is malformed}} finish_test