/ Check-in [41aef649]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove some cruft from the VDBE. Bring comments up to date. (CVS 2888)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:41aef6496a10c81e1095408dc8f69740d6ea7627
User & Date: drh 2006-01-08 05:26:41
Context
2006-01-08
18:10
Get LIMIT and OFFSET working again for negative limits and offsets. Ticket #1586. (CVS 2889) check-in: b2ac0be0 user: drh tags: trunk
05:26
Remove some cruft from the VDBE. Bring comments up to date. (CVS 2888) check-in: 41aef649 user: drh tags: trunk
05:02
Reduce memory requirements for ORDER BY combined with LIMIT. Ticket #1586. (CVS 2887) check-in: 55e703ec user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

    39     39   **
    40     40   ** Various scripts scan this source file in order to generate HTML
    41     41   ** documentation, headers files, or other derived files.  The formatting
    42     42   ** of the code in this file is, therefore, important.  See other comments
    43     43   ** in this file for details.  If in doubt, do not deviate from existing
    44     44   ** commenting and indentation practices when changing or adding code.
    45     45   **
    46         -** $Id: vdbe.c,v 1.516 2006/01/07 18:48:26 drh Exp $
           46  +** $Id: vdbe.c,v 1.517 2006/01/08 05:26:41 drh Exp $
    47     47   */
    48     48   #include "sqliteInt.h"
    49     49   #include "os.h"
    50     50   #include <ctype.h>
    51     51   #include "vdbeInt.h"
    52     52   
    53     53   /*
................................................................................
  4273   4273     if( pMem->i<pTos->i){
  4274   4274       pMem->i = pTos->i;
  4275   4275     }
  4276   4276     break;
  4277   4277   }
  4278   4278   #endif /* SQLITE_OMIT_AUTOINCREMENT */
  4279   4279   
  4280         -/* Opcode: MemIncr P1 P2 *
         4280  +/* Opcode: MemIncr P1 * *
  4281   4281   **
  4282         -** Increment the integer valued memory cell P1 by 1.  If P2 is not zero
  4283         -** and the result after the increment is exactly 0, then jump
  4284         -** to P2.
         4282  +** Increment the integer valued memory cell P1 by 1.
  4285   4283   **
  4286         -** This instruction throws an error if the memory cell is not initially
  4287         -** an integer.
         4284  +** It is illegal to use this instruction on a memory cell that does
         4285  +** not contain an integer.  An assertion fault will result if you try.
  4288   4286   */
  4289   4287   case OP_MemIncr: {        /* no-push */
  4290   4288     int i = pOp->p1;
  4291   4289     Mem *pMem;
  4292   4290     assert( i>=0 && i<p->nMem );
  4293   4291     pMem = &p->aMem[i];
  4294   4292     assert( pMem->flags==MEM_Int );
  4295   4293     pMem->i++;
  4296         -  if( pOp->p2>0 && pMem->i==0 ){
  4297         -     pc = pOp->p2 - 1;
  4298         -  }
         4294  +  assert( pOp->p2==0 );
  4299   4295     break;
  4300   4296   }
  4301   4297   
  4302   4298   /* Opcode: IfMemPos P1 P2 *
  4303   4299   **
  4304   4300   ** If the value of memory cell P1 is 1 or greater, jump to P2.  If
  4305         -** the memory cell holds an integer of 0 or less or if it holds something
  4306         -** that is not an integer, then fall thru.
         4301  +** the memory cell holds an integer of 0 or less.
         4302  +**
         4303  +** It is illegal to use this instruction on a memory cell that does
         4304  +** not contain an integer.  An assertion fault will result if you try.
  4307   4305   */
  4308   4306   case OP_IfMemPos: {        /* no-push */
  4309   4307     int i = pOp->p1;
  4310   4308     Mem *pMem;
  4311   4309     assert( i>=0 && i<p->nMem );
  4312   4310     pMem = &p->aMem[i];
  4313         -  if( pMem->flags==MEM_Int && pMem->i>0 ){
         4311  +  assert( pMem->flags==MEM_Int );
         4312  +  if( pMem->i>0 ){
  4314   4313        pc = pOp->p2 - 1;
  4315   4314     }
  4316   4315     break;
  4317   4316   }
  4318   4317   
  4319   4318   /* Opcode: IfMemZero P1 P2 *
  4320   4319   **
  4321         -** If the value of memory cell P1 is exactly 0, jump to P2.
         4320  +** If the value of memory cell P1 is exactly 0, jump to P2. 
         4321  +**
         4322  +** It is illegal to use this instruction on a memory cell that does
         4323  +** not contain an integer.  An assertion fault will result if you try.
  4322   4324   */
  4323   4325   case OP_IfMemZero: {        /* no-push */
  4324   4326     int i = pOp->p1;
  4325   4327     Mem *pMem;
  4326   4328     assert( i>=0 && i<p->nMem );
  4327   4329     pMem = &p->aMem[i];
  4328         -  if( pMem->flags==MEM_Int && pMem->i==0 ){
         4330  +  assert( pMem->flags==MEM_Int );
         4331  +  if( pMem->i==0 ){
  4329   4332        pc = pOp->p2 - 1;
  4330   4333     }
  4331   4334     break;
  4332   4335   }
  4333   4336   
  4334   4337   /* Opcode: MemNull P1 * *
  4335   4338   **