1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Small performance improvement to OP_Column.

FossilOrigin-Name: b6b73a747ad8d0f026074e41c2a4adc529ec2674
This commit is contained in:
drh
2011-08-29 02:16:18 +00:00
parent e6f43fc4f8
commit 5a077b741f
3 changed files with 16 additions and 9 deletions

View File

@@ -2118,6 +2118,7 @@ case OP_Column: {
u32 szField; /* Number of bytes in the content of a field */
int szHdr; /* Size of the header size field at start of record */
int avail; /* Number of bytes of available data */
u32 t; /* A type code from the record header */
Mem *pReg; /* PseudoTable input register */
@@ -2295,8 +2296,14 @@ case OP_Column: {
for(i=0; i<nField; i++){
if( zIdx<zEndHdr ){
aOffset[i] = offset;
zIdx += getVarint32(zIdx, aType[i]);
szField = sqlite3VdbeSerialTypeLen(aType[i]);
if( zIdx[0]<0x80 ){
t = zIdx[0];
zIdx++;
}else{
zIdx += sqlite3GetVarint32(zIdx, &t);
}
aType[i] = t;
szField = sqlite3VdbeSerialTypeLen(t);
offset += szField;
if( offset<szField ){ /* True if offset overflows */
zIdx = &zEndHdr[1]; /* Forces SQLITE_CORRUPT return below */