]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Remove a local variable from the OP_Column implementation, resulting in a
authordrh <drh@noemail.net>
Fri, 19 Sep 2014 16:56:45 +0000 (16:56 +0000)
committerdrh <drh@noemail.net>
Fri, 19 Sep 2014 16:56:45 +0000 (16:56 +0000)
modest size reduction and a performance increase.

FossilOrigin-Name: 6199760d1340858d97c845177986b783da915d9e

manifest
manifest.uuid
src/vdbe.c

index ddd7321ef0c30a255a1ccc270f98c26e2302299f..bb272d2568d56a0e1a32cf3d12c03ad5bb490365 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Small\ssize\sreduction\sand\sperformance\sincrease\sfor\sreleaseMemArray().
-D 2014-09-19T16:13:12.685
+C Remove\sa\slocal\svariable\sfrom\sthe\sOP_Column\simplementation,\sresulting\sin\sa\nmodest\ssize\sreduction\sand\sa\sperformance\sincrease.
+D 2014-09-19T16:56:45.748
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in cf57f673d77606ab0f2d9627ca52a9ba1464146a
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -288,7 +288,7 @@ F src/update.c 729f6f18fc27740591d085e1172cebe311144bf0
 F src/utf.c fc6b889ba0779b7722634cdeaa25f1930d93820c
 F src/util.c 4006c01772bd8d8ac4306d523bbcee41d3e392d8
 F src/vacuum.c 59f03f92bcff57faa6a8ca256eb29ccddfb0614a
-F src/vdbe.c 9f2a0a2dfa06e99feabd754e9be3a436ac3cf97d
+F src/vdbe.c c90b7ebe856beb75077cf4486efc1863de219f34
 F src/vdbe.h 09f5b4e3719fa454f252322b1cdab5cf1f361327
 F src/vdbeInt.h f177bed1ec8d4eb5c7089f012aeb95f374745735
 F src/vdbeapi.c e9e33b59834e3edc8790209765e069874c269d9d
@@ -1198,7 +1198,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 9b42c3da6b2593a10b8fe4b2fcc3d650132625c1
-R 351b243201f0eb22d3adcd68e13fd4a5
+P 24cd32d681df58f687b2afbe4b13d579e3efdd4b
+R dfacf0845df6af56f07b0acf2e71dc1f
 U drh
-Z 9538899cfe34e917b2f35980fa39505f
+Z 845eafc57b4e53556b2c7ee6a79ebdad
index 5c4c41d72c6b0c557ff42261b0b5575fa001158b..67c66e8f0f99828a4281f55acaea0affd4c21e8b 100644 (file)
@@ -1 +1 @@
-24cd32d681df58f687b2afbe4b13d579e3efdd4b
\ No newline at end of file
+6199760d1340858d97c845177986b783da915d9e
\ No newline at end of file
index 0baacef4c03914498c6b019b93f4478585b80ea3..9b679c534b173b63f007e854ab6eca53e0469d9a 100644 (file)
@@ -2257,7 +2257,6 @@ case OP_Column: {
   int p2;            /* column number to retrieve */
   VdbeCursor *pC;    /* The VDBE cursor */
   BtCursor *pCrsr;   /* The BTree cursor */
-  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 */
   int len;           /* The length of the serialized data for the column */
   int i;             /* Loop counter */
@@ -2270,6 +2269,7 @@ case OP_Column: {
   u32 szField;       /* Number of bytes in the content of a field */
   u32 avail;         /* Number of bytes of available data */
   u32 t;             /* A type code from the record header */
+  u16 fx;            /* pDest->flags value */
   Mem *pReg;         /* PseudoTable input register */
 
   p2 = pOp->p2;
@@ -2280,8 +2280,7 @@ case OP_Column: {
   pC = p->apCsr[pOp->p1];
   assert( pC!=0 );
   assert( p2<pC->nField );
-  aType = pC->aType;
-  aOffset = aType + pC->nField;
+  aOffset = pC->aType + pC->nField;
 #ifndef SQLITE_OMIT_VIRTUALTABLE
   assert( pC->pVtabCursor==0 ); /* OP_Column never called on virtual table */
 #endif
@@ -2362,7 +2361,7 @@ case OP_Column: {
   }
 
   /* Make sure at least the first p2+1 entries of the header have been
-  ** parsed and valid information is in aOffset[] and aType[].
+  ** parsed and valid information is in aOffset[] and pC->aType[].
   */
   if( pC->nHdrParsed<=p2 ){
     /* If there is more header available for parsing in the record, try
@@ -2382,7 +2381,7 @@ case OP_Column: {
         zData = pC->aRow;
       }
   
-      /* Fill in aType[i] and aOffset[i] values through the p2-th field. */
+      /* Fill in pC->aType[i] and aOffset[i] values through the p2-th field. */
       i = pC->nHdrParsed;
       offset = aOffset[i];
       zHdr = zData + pC->iHdrOffset;
@@ -2395,7 +2394,7 @@ case OP_Column: {
         }else{
           zHdr += sqlite3GetVarint32(zHdr, &t);
         }
-        aType[i] = t;
+        pC->aType[i] = t;
         szField = sqlite3VdbeSerialTypeLen(t);
         offset += szField;
         if( offset<szField ){  /* True if offset overflows */
@@ -2442,20 +2441,20 @@ case OP_Column: {
   }
 
   /* Extract the content for the p2+1-th column.  Control can only
-  ** reach this point if aOffset[p2], aOffset[p2+1], and aType[p2] are
+  ** reach this point if aOffset[p2], aOffset[p2+1], and pC->aType[p2] are
   ** all valid.
   */
   assert( p2<pC->nHdrParsed );
   assert( rc==SQLITE_OK );
   assert( sqlite3VdbeCheckMemInvariants(pDest) );
   if( VdbeMemDynamic(pDest) ) sqlite3VdbeMemSetNull(pDest);
+  t = pC->aType[p2];
   if( pC->szRow>=aOffset[p2+1] ){
     /* This is the common case where the desired content fits on the original
     ** page - where the content is not on an overflow page */
-    sqlite3VdbeSerialGet(pC->aRow+aOffset[p2], aType[p2], pDest);
+    sqlite3VdbeSerialGet(pC->aRow+aOffset[p2], t, pDest);
   }else{
     /* This branch happens only when content is on overflow pages */
-    t = aType[p2];
     if( ((pOp->p5 & (OPFLAG_LENGTHARG|OPFLAG_TYPEOFARG))!=0
           && ((t>=12 && (t&1)==0) || (pOp->p5 & OPFLAG_TYPEOFARG)!=0))
      || (len = sqlite3VdbeSerialTypeLen(t))==0
@@ -2487,15 +2486,15 @@ op_column_out:
   ** used.  The following code does the equivalent of Deephemeralize()
   ** but does it faster. */
   if( (pDest->flags & MEM_Ephem)!=0 && pDest->z ){
-    u16 f = pDest->flags & (MEM_Str|MEM_Blob);
-    assert( f!=0 );
+    fx = pDest->flags & (MEM_Str|MEM_Blob);
+    assert( fx!=0 );
     zData = (const u8*)pDest->z;
     len = pDest->n;
     if( sqlite3VdbeMemClearAndResize(pDest, len+2) ) goto no_mem;
     memcpy(pDest->z, zData, len);
     pDest->z[len] = 0;
     pDest->z[len+1] = 0;
-    pDest->flags = f|MEM_Term;
+    pDest->flags = fx|MEM_Term;
   }
 op_column_error:
   UPDATE_MAX_BLOBSIZE(pDest);