]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Added comments and testcase() macros to error cases in the btree search.
authordrh <drh@noemail.net>
Thu, 28 May 2015 15:14:32 +0000 (15:14 +0000)
committerdrh <drh@noemail.net>
Thu, 28 May 2015 15:14:32 +0000 (15:14 +0000)
FossilOrigin-Name: 7da7dc714bf1fe34b38fc33a923490dfd3e4f070

manifest
manifest.uuid
src/btree.c

index a3677316ff59e50a442f7003f6b2a721ec8e348c..b6541666950ac7252ffef8b7315d201aa86fa983 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Earlier\sdetection\sof\sincompatible\ssibling\spages\sin\sbalance_nonroot.
-D 2015-05-28T11:23:11.109
+C Added\scomments\sand\stestcase()\smacros\sto\serror\scases\sin\sthe\sbtree\ssearch.
+D 2015-05-28T15:14:32.636
 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 f34b9368934017f9300462c947f24808fc804fe1
+F src/btree.c a1f510492027253e016d347d78d3c94ea0376595
 F src/btree.h 969adc948e89e449220ff0ff724c94bb2a52e9f1
 F src/btreeInt.h 973a22a6fd61350b454ad614832b1f0a5e25a1e4
 F src/build.c 85a169a0a22f8b80caf513eaf2944d39b979f571
@@ -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 467b13a40171dd8462dc11d05bb1e9cb588e6a23
-R 28872cdddc660eeb8a0db0c548d4f7c4
+P 60a09f17d8b70dbc4b020586a1b81bce76882729
+R f6f606a9ee18565706ed9fa4a93542b7
 U drh
-Z 7c4a1962ababfd83666abb4833ebdc57
+Z daad2a296f17463ceed0e3de94772244
index f6e182419499e79419eb363d0dec7a1302de703a..4a80343e9f1953960305fe84b0a1e7a0fd6d5948 100644 (file)
@@ -1 +1 @@
-60a09f17d8b70dbc4b020586a1b81bce76882729
\ No newline at end of file
+7da7dc714bf1fe34b38fc33a923490dfd3e4f070
\ No newline at end of file
index 0435c36a6765f7e09b5c9e82aaedd48444536fba..ca774708251c35113c9975b2846b800c9bfd67b2 100644 (file)
@@ -4943,7 +4943,7 @@ int sqlite3BtreeMovetoUnpacked(
       }
     }else{
       for(;;){
-        int nCell;
+        int nCell;  /* Size of the pCell cell in bytes */
         pCell = findCell(pPage, idx) + pPage->childPtrSize;
 
         /* The maximum supported page-size is 65536 bytes. This means that
@@ -4982,7 +4982,10 @@ int sqlite3BtreeMovetoUnpacked(
           u8 * const pCellBody = pCell - pPage->childPtrSize;
           btreeParseCellPtr(pPage, pCellBody, &pCur->info);
           nCell = (int)pCur->info.nKey;
-          testcase( nCell<0 );
+          testcase( nCell<0 );   /* True if key size is 2^32 or more */
+          testcase( nCell==0 );  /* Invalid key size:  0x80 0x80 0x00 */
+          testcase( nCell==1 );  /* Invalid key size:  0x80 0x80 0x01 */
+          testcase( nCell==2 );  /* Minimum legal index key size */
           if( nCell<2 ){
             rc = SQLITE_CORRUPT_BKPT;
             goto moveto_finish;