From: drh Date: Fri, 5 Feb 2010 14:12:53 +0000 (+0000) Subject: Remove the use of 64-bit math in the offset computations of X-Git-Tag: version-3.7.2~619 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6658cd9a74b31cf286ebc546aac09f8c63df8efc;p=thirdparty%2Fsqlite.git Remove the use of 64-bit math in the offset computations of the OP_Column opcode for a small performance improvement. FossilOrigin-Name: 61a2c8d4d64c28119e9f06eb42f9c0437ba7a7bd --- diff --git a/manifest b/manifest index f3fb3c92b0..55655e2664 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -C Fix\sa\sperformance\sglitch\sthat\sappears\sfor\slarge\stransactions. -D 2010-02-04T17:38:32 +C Remove\sthe\suse\sof\s64-bit\smath\sin\sthe\soffset\scomputations\sof\s\nthe\sOP_Column\sopcode\sfor\sa\ssmall\sperformance\simprovement. +D 2010-02-05T14:12:54 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in c5827ead754ab32b9585487177c93bb00b9497b3 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -212,7 +212,7 @@ F src/update.c c0dc6b75ad28b76b619042d934f337b02acee208 F src/utf.c dad16adcc0c35ef2437dca125a4b07419d361052 F src/util.c aa0b1da8f71edff84b4b41dbe05fe6ac75d819c6 F src/vacuum.c 28ee5a4963d16cf2477075d85966c0f461cd79de -F src/vdbe.c b0c18b5c5ab4745a09b8f164e5db36413d98872e +F src/vdbe.c 78f2167915a8a9611e79eeaf13318d247abed185 F src/vdbe.h bea1f0cd530775bdb58a340265f3cf3ee920e9b2 F src/vdbeInt.h e276691b6835da5c0008cc5beaaecedcd7bdba8e F src/vdbeapi.c a8b6a6617fc9a0492e4f7d6626d3afe994ddd3f2 @@ -789,14 +789,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 1b6e6094c88214e02c9e3638932997ac20bfe413 -R a169746145d95681a0eb74b572825817 +P 26cb1df73504d5d883cf0967e57b46aa062d0b00 +R 1958cacd7f583aec4ab73bfa77d04590 U drh -Z 2e5d2a4ce8f32874758dbc577421eb49 +Z fc01b4de0eee88e8eb53af6f3beff67e -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) -iD8DBQFLawYboxKgR168RlERAqIiAJ9m+MAjJTz7+kI+tNhVlPG+dvXwEwCffivJ -RRcggDk+1C8swBXLSBSOFXQ= -=83UN +iD8DBQFLbCdpoxKgR168RlERAleAAJ9zp4nXhvCTHxqvWnr21SgA/iUicACdEllu +mfGoLjhZumCpTb2x8CplRYs= +=/N/5 -----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index 6460b52c48..52cc347d92 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -26cb1df73504d5d883cf0967e57b46aa062d0b00 \ No newline at end of file +61a2c8d4d64c28119e9f06eb42f9c0437ba7a7bd \ No newline at end of file diff --git a/src/vdbe.c b/src/vdbe.c index af7e7ce9e1..35a35ddb8a 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -2068,7 +2068,7 @@ case OP_Column: { u8 *zIdx; /* Index into header */ u8 *zEndHdr; /* Pointer to first byte after the header */ u32 offset; /* Offset into the data */ - u64 offset64; /* 64-bit offset. 64 bits needed to catch overflow */ + 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 */ Mem *pReg; /* PseudoTable input register */ @@ -2243,12 +2243,16 @@ case OP_Column: { ** 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 */ - offset64 = offset; for(i=0; i zEndHdr)|| (offset64 > payloadSize) - || (zIdx==zEndHdr && offset64!=(u64)payloadSize) ){ + if( (zIdx > zEndHdr) || (offset > payloadSize) + || (zIdx==zEndHdr && offset!=payloadSize) ){ rc = SQLITE_CORRUPT_BKPT; goto op_column_out; }