diff --git a/manifest b/manifest index 7d91834c49..5eb7c6ec22 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Avoid\sparsing\san\sentire\srecord\sheader\swhen\sit\sis\snot\srequired.\s(CVS\s2940) -D 2006-01-13T15:58:43 +C Tweaks\sto\smake\sOP_Column\srun\sa\sfraction\sfaster.\s(CVS\s2941) +D 2006-01-13T17:12:01 F Makefile.in ab3ffd8d469cef4477257169b82810030a6bb967 F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -87,7 +87,7 @@ F src/update.c 261d75c702c2852d1a64274d7c414485e6f2d177 F src/utf.c 5ab8ca05d4e9ec81174b010f01ab12a232f0087d F src/util.c b26be916edd1c991450cccc6503356c4f776598b F src/vacuum.c 21a3c7f6f7be86bb1182fbc3df416ad702435b9e -F src/vdbe.c e2f081425c3b2be6e7ff25fbb2f3f70fa95413ee +F src/vdbe.c bf64026224ade859b32e6c01fcf292fbf069cb95 F src/vdbe.h 8729a4ee16ff9aeab2af9667df3cf300ff978e13 F src/vdbeInt.h 5451cf71f229e366ac543607c0a17f36e5737ea9 F src/vdbeapi.c afd3837cea0dec93dcb4724d073c84fa0da68e23 @@ -340,7 +340,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 55b7dfaf4d3a6d01fffdaf1707e88bcd215d7333 -R 07d8c70ff570eb317ee47042ddb86743 +P 0de729d9144afba144811799f65e32140c14ef8a +R 4fc53b80c7e70cf5aaa2736ccda17872 U danielk1977 -Z 7bb864839753b74a0c8dfa1447111caa +Z 8db44b8359d9daca4aa7858d0ea683db diff --git a/manifest.uuid b/manifest.uuid index a05cca946c..83b708ac5a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0de729d9144afba144811799f65e32140c14ef8a \ No newline at end of file +2d74cc22de2aa59329b1ea5c26acd6ebe46e16c2 \ No newline at end of file diff --git a/src/vdbe.c b/src/vdbe.c index 563fd7561a..2859eb9f0a 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -43,7 +43,7 @@ ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** -** $Id: vdbe.c,v 1.528 2006/01/13 15:58:43 danielk1977 Exp $ +** $Id: vdbe.c,v 1.529 2006/01/13 17:12:01 danielk1977 Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -1883,10 +1883,7 @@ case OP_Column: { u32 *aType; /* aType[i] holds the numeric type of the i-th column */ u32 *aOffset; /* aOffset[i] is offset to start of data for i-th column */ u32 nField; /* number of fields in the record */ - u32 szHdr; /* Number of bytes in the record header */ int len; /* The length of the serialized data for the column */ - int offset = 0; /* Offset into the data */ - int idx; /* Index into the header */ int i; /* Loop counter */ char *zData; /* Part of the record being decoded */ Mem sMem; /* For storing the record being decoded */ @@ -1975,7 +1972,10 @@ case OP_Column: { aType = pC->aType; aOffset = pC->aOffset; }else{ - int avail; /* Number of bytes of available data */ + u8 *zIdx; /* Index into header */ + u8 *zEndHdr; /* Pointer to first byte after the header */ + u32 offset; /* Offset into the data */ + int avail; /* Number of bytes of available data */ if( pC && pC->aType ){ aType = pC->aType; }else{ @@ -2007,8 +2007,7 @@ case OP_Column: { pC->aRow = 0; } } - idx = GetVarint((u8*)zData, szHdr); - + zIdx = (u8 *)GetVarint((u8*)zData, offset); /* The KeyFetch() or DataFetch() above are fast and will get the entire ** record header in most cases. But they will fail to get the complete @@ -2016,46 +2015,44 @@ case OP_Column: { ** in the B-Tree. When that happens, use sqlite3VdbeMemFromBtree() to ** acquire the complete header text. */ - if( !zRec && availisIndex, &sMem); + if( !zRec && availisIndex, &sMem); if( rc!=SQLITE_OK ){ goto op_column_out; } zData = sMem.z; } + zEndHdr = (u8 *)zData + offset; + zIdx = zData + (int)zIdx; /* Scan the header and use it to fill in the aType[] and aOffset[] ** arrays. aType[i] will contain the type integer for the i-th ** column and aOffset[i] will contain the offset from the beginning ** of the record to the start of the data for the i-th column */ - offset = szHdr; - assert( offset>0 ); - i = 0; - while( idxszHdr || offset>payloadSize ){ + if( zIdx>zEndHdr || offset>payloadSize ){ rc = SQLITE_CORRUPT_BKPT; goto op_column_out; }