SQLite

Check-in [41aef6496a]
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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 41aef6496a10c81e1095408dc8f69740d6ea7627
User & Date: drh 2006-01-08 05:26:41.000
Context
2006-01-08
18:10
Get LIMIT and OFFSET working again for negative limits and offsets. Ticket #1586. (CVS 2889) (check-in: b2ac0be07e user: drh tags: trunk)
05:26
Remove some cruft from the VDBE. Bring comments up to date. (CVS 2888) (check-in: 41aef6496a user: drh tags: trunk)
05:02
Reduce memory requirements for ORDER BY combined with LIMIT. Ticket #1586. (CVS 2887) (check-in: 55e703ecac user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vdbe.c.
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
**
** Various scripts scan this source file in order to generate HTML
** documentation, headers files, or other derived files.  The formatting
** of the code in this file is, therefore, important.  See other comments
** 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.516 2006/01/07 18:48:26 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
#include <ctype.h>
#include "vdbeInt.h"

/*







|







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
**
** Various scripts scan this source file in order to generate HTML
** documentation, headers files, or other derived files.  The formatting
** of the code in this file is, therefore, important.  See other comments
** 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.517 2006/01/08 05:26:41 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
#include <ctype.h>
#include "vdbeInt.h"

/*
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306


4307
4308
4309
4310
4311
4312
4313

4314
4315
4316
4317
4318
4319
4320
4321



4322
4323
4324
4325
4326
4327
4328

4329
4330
4331
4332
4333
4334
4335
  if( pMem->i<pTos->i){
    pMem->i = pTos->i;
  }
  break;
}
#endif /* SQLITE_OMIT_AUTOINCREMENT */

/* Opcode: MemIncr P1 P2 *
**
** Increment the integer valued memory cell P1 by 1.  If P2 is not zero
** and the result after the increment is exactly 0, then jump
** to P2.
**
** This instruction throws an error if the memory cell is not initially
** an integer.
*/
case OP_MemIncr: {        /* no-push */
  int i = pOp->p1;
  Mem *pMem;
  assert( i>=0 && i<p->nMem );
  pMem = &p->aMem[i];
  assert( pMem->flags==MEM_Int );
  pMem->i++;
  if( pOp->p2>0 && pMem->i==0 ){
     pc = pOp->p2 - 1;
  }
  break;
}

/* Opcode: IfMemPos P1 P2 *
**
** If the value of memory cell P1 is 1 or greater, jump to P2.  If
** the memory cell holds an integer of 0 or less or if it holds something
** that is not an integer, then fall thru.


*/
case OP_IfMemPos: {        /* no-push */
  int i = pOp->p1;
  Mem *pMem;
  assert( i>=0 && i<p->nMem );
  pMem = &p->aMem[i];
  if( pMem->flags==MEM_Int && pMem->i>0 ){

     pc = pOp->p2 - 1;
  }
  break;
}

/* Opcode: IfMemZero P1 P2 *
**
** If the value of memory cell P1 is exactly 0, jump to P2.



*/
case OP_IfMemZero: {        /* no-push */
  int i = pOp->p1;
  Mem *pMem;
  assert( i>=0 && i<p->nMem );
  pMem = &p->aMem[i];
  if( pMem->flags==MEM_Int && pMem->i==0 ){

     pc = pOp->p2 - 1;
  }
  break;
}

/* Opcode: MemNull P1 * *
**







|

|
<
<

|
|








<
|
<






|
|
>
>






|
>







|
>
>
>






|
>







4273
4274
4275
4276
4277
4278
4279
4280
4281
4282


4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293

4294

4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
  if( pMem->i<pTos->i){
    pMem->i = pTos->i;
  }
  break;
}
#endif /* SQLITE_OMIT_AUTOINCREMENT */

/* Opcode: MemIncr P1 * *
**
** Increment the integer valued memory cell P1 by 1.


**
** It is illegal to use this instruction on a memory cell that does
** not contain an integer.  An assertion fault will result if you try.
*/
case OP_MemIncr: {        /* no-push */
  int i = pOp->p1;
  Mem *pMem;
  assert( i>=0 && i<p->nMem );
  pMem = &p->aMem[i];
  assert( pMem->flags==MEM_Int );
  pMem->i++;

  assert( pOp->p2==0 );

  break;
}

/* Opcode: IfMemPos P1 P2 *
**
** If the value of memory cell P1 is 1 or greater, jump to P2.  If
** the memory cell holds an integer of 0 or less.
**
** It is illegal to use this instruction on a memory cell that does
** not contain an integer.  An assertion fault will result if you try.
*/
case OP_IfMemPos: {        /* no-push */
  int i = pOp->p1;
  Mem *pMem;
  assert( i>=0 && i<p->nMem );
  pMem = &p->aMem[i];
  assert( pMem->flags==MEM_Int );
  if( pMem->i>0 ){
     pc = pOp->p2 - 1;
  }
  break;
}

/* Opcode: IfMemZero P1 P2 *
**
** If the value of memory cell P1 is exactly 0, jump to P2. 
**
** It is illegal to use this instruction on a memory cell that does
** not contain an integer.  An assertion fault will result if you try.
*/
case OP_IfMemZero: {        /* no-push */
  int i = pOp->p1;
  Mem *pMem;
  assert( i>=0 && i<p->nMem );
  pMem = &p->aMem[i];
  assert( pMem->flags==MEM_Int );
  if( pMem->i==0 ){
     pc = pOp->p2 - 1;
  }
  break;
}

/* Opcode: MemNull P1 * *
**