From: drh Date: Thu, 28 May 2015 11:23:11 +0000 (+0000) Subject: Earlier detection of incompatible sibling pages in balance_nonroot. X-Git-Tag: version-3.8.11~197 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=73d340adffee3cc1ba56495073b3cf17ffe343fe;p=thirdparty%2Fsqlite.git Earlier detection of incompatible sibling pages in balance_nonroot. FossilOrigin-Name: 60a09f17d8b70dbc4b020586a1b81bce76882729 --- diff --git a/manifest b/manifest index 443436ae9e..a3677316ff 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\snew\stest\scases\sto\sthe\sfuzzdata3.db\sset\sof\sdatabase\sfuzz\stests. -D 2015-05-28T03:45:03.864 +C Earlier\sdetection\sof\sincompatible\ssibling\spages\sin\sbalance_nonroot. +D 2015-05-28T11:23:11.109 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 994bab32a3a69e0c35bd148b65cde49879772964 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -192,7 +192,7 @@ F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240 F src/backup.c ff743689c4d6c5cb55ad42ed9d174b2b3e71f1e3 F src/bitvec.c 5eb7958c3bf65210211cbcfc44eff86d0ded7c9d F src/btmutex.c 45a968cc85afed9b5e6cf55bf1f42f8d18107f79 -F src/btree.c 7cd71f5579269590ebc864cb0e196fa02c52339a +F src/btree.c f34b9368934017f9300462c947f24808fc804fe1 F src/btree.h 969adc948e89e449220ff0ff724c94bb2a52e9f1 F src/btreeInt.h 973a22a6fd61350b454ad614832b1f0a5e25a1e4 F src/build.c 85a169a0a22f8b80caf513eaf2944d39b979f571 @@ -654,7 +654,7 @@ F test/fuzz_malloc.test 328f70aaca63adf29b4c6f06505ed0cf57ca7c26 F test/fuzzcheck.c a60f926e3fa86c8d33908406d75eec868c22b9ca F test/fuzzdata1.db b60254eeb6bc11474071b883059662a73c48da7f F test/fuzzdata2.db f03a420d3b822cc82e4f894ca957618fbe9c4973 -F test/fuzzdata3.db 193968945bbb3a868a39ecc6404bce90a28f80bd +F test/fuzzdata3.db 2701a08185d24d8570eb6e765201131fe75eff84 F test/fuzzer1.test d4c52aaf3ef923da293a2653cfab33d02f718a36 F test/fuzzerfault.test 8792cd77fd5bce765b05d0c8e01b9edcf8af8536 F test/genesis.tcl 1e2e2e8e5cc4058549a154ff1892fe5c9de19f98 @@ -1280,7 +1280,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 fe15d1f70360d6fef8ef1a111dd43e060d059623 -R 27bcdda1a0d497f73b3f24c17b0151b9 +P 467b13a40171dd8462dc11d05bb1e9cb588e6a23 +R 28872cdddc660eeb8a0db0c548d4f7c4 U drh -Z dc3126e44bb8d6248c5f80ac680b3240 +Z 7c4a1962ababfd83666abb4833ebdc57 diff --git a/manifest.uuid b/manifest.uuid index 2336b63db8..f6e1824194 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -467b13a40171dd8462dc11d05bb1e9cb588e6a23 \ No newline at end of file +60a09f17d8b70dbc4b020586a1b81bce76882729 \ No newline at end of file diff --git a/src/btree.c b/src/btree.c index 8a3c4eb669..0435c36a67 100644 --- a/src/btree.c +++ b/src/btree.c @@ -6878,6 +6878,14 @@ static int balance_nonroot( int limit; MemPage *pOld = apOld[i]; + /* Verify that all sibling pages are of the same "type" (table-leaf, + ** table-interior, index-leaf, or index-interior). + */ + if( pOld->aData[0]!=apOld[0]->aData[0] ){ + rc = SQLITE_CORRUPT_BKPT; + goto balance_cleanup; + } + limit = pOld->nCell+pOld->nOverflow; if( pOld->nOverflow>0 ){ for(j=0; j