Index: src/vdbe.c
==================================================================
--- src/vdbe.c
+++ src/vdbe.c
@@ -41,11 +41,11 @@
** 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.301 2004/05/19 11:24:26 drh Exp $
+** $Id: vdbe.c,v 1.302 2004/05/19 11:31:13 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
#include
#include "vdbeInt.h"
@@ -1650,163 +1650,10 @@
}else{
pTos++;
pTos->flags = MEM_Int;
pTos->i = res;
}
- break;
-}
-/* INSERT NO CODE HERE!
-**
-** The opcode numbers are extracted from this source file by doing
-**
-** grep '^case OP_' vdbe.c | ... >opcodes.h
-**
-** The opcodes are numbered in the order that they appear in this file.
-** But in order for the expression generating code to work right, the
-** string comparison operators that follow must be numbered exactly 6
-** greater than the numeric comparison opcodes above. So no other
-** cases can appear between the two.
-*/
-/* Opcode: StrEq P1 P2 *
-**
-** Pop the top two elements from the stack. If they are equal, then
-** jump to instruction P2. Otherwise, continue to the next instruction.
-**
-** If either operand is NULL (and thus if the result is unknown) then
-** take the jump if P1 is true.
-**
-** The strcmp() library routine is used for the comparison. For a
-** numeric comparison, use OP_Eq.
-**
-** If P2 is zero, do not jump. Instead, push an integer 1 onto the
-** stack if the jump would have been taken, or a 0 if not. Push a
-** NULL if either operand was NULL.
-*/
-/* Opcode: StrNe P1 P2 *
-**
-** Pop the top two elements from the stack. If they are not equal, then
-** jump to instruction P2. Otherwise, continue to the next instruction.
-**
-** If either operand is NULL (and thus if the result is unknown) then
-** take the jump if P1 is true.
-**
-** The strcmp() library routine is used for the comparison. For a
-** numeric comparison, use OP_Ne.
-**
-** If P2 is zero, do not jump. Instead, push an integer 1 onto the
-** stack if the jump would have been taken, or a 0 if not. Push a
-** NULL if either operand was NULL.
-*/
-/* Opcode: StrLt P1 P2 *
-**
-** Pop the top two elements from the stack. If second element (the
-** next on stack) is less than the first (the top of stack), then
-** jump to instruction P2. Otherwise, continue to the next instruction.
-** In other words, jump if NOSTOS.
-**
-** If either operand is NULL (and thus if the result is unknown) then
-** take the jump if P1 is true.
-**
-** The strcmp() library routine is used for the comparison. For a
-** numeric comparison, use OP_Gt.
-**
-** If P2 is zero, do not jump. Instead, push an integer 1 onto the
-** stack if the jump would have been taken, or a 0 if not. Push a
-** NULL if either operand was NULL.
-*/
-/* Opcode: StrGe P1 P2 *
-**
-** Pop the top two elements from the stack. If second element (the next
-** on stack) is greater than or equal to the first (the top of stack),
-** then jump to instruction P2. In other words, jump if NOS>=TOS.
-**
-** If either operand is NULL (and thus if the result is unknown) then
-** take the jump if P1 is true.
-**
-** The strcmp() library routine is used for the comparison. For a
-** numeric comparison, use OP_Ge.
-**
-** If P2 is zero, do not jump. Instead, push an integer 1 onto the
-** stack if the jump would have been taken, or a 0 if not. Push a
-** NULL if either operand was NULL.
-*/
-case OP_StrEq:
-case OP_StrNe:
-case OP_StrLt:
-case OP_StrLe:
-case OP_StrGt:
-case OP_StrGe: {
- Mem *pNos = &pTos[-1];
- int c;
- assert( pNos>=p->aStack );
- if( (pNos->flags | pTos->flags) & MEM_Null ){
- popStack(&pTos, 2);
- if( pOp->p2 ){
- if( pOp->p1 ) pc = pOp->p2-1;
- }else{
- pTos++;
- pTos->flags = MEM_Null;
- }
- break;
- }else{
- Stringify(pTos);
- Stringify(pNos);
- c = strcmp(pNos->z, pTos->z);
- }
- /* The asserts on each case of the following switch are there to verify
- ** that string comparison opcodes are always exactly 6 greater than the
- ** corresponding numeric comparison opcodes. The code generator depends
- ** on this fact.
- */
- switch( pOp->opcode ){
- case OP_StrEq: c = c==0; assert( pOp->opcode-6==OP_Eq ); break;
- case OP_StrNe: c = c!=0; assert( pOp->opcode-6==OP_Ne ); break;
- case OP_StrLt: c = c<0; assert( pOp->opcode-6==OP_Lt ); break;
- case OP_StrLe: c = c<=0; assert( pOp->opcode-6==OP_Le ); break;
- case OP_StrGt: c = c>0; assert( pOp->opcode-6==OP_Gt ); break;
- default: c = c>=0; assert( pOp->opcode-6==OP_Ge ); break;
- }
- popStack(&pTos, 2);
- if( pOp->p2 ){
- if( c ) pc = pOp->p2-1;
- }else{
- pTos++;
- pTos->flags = MEM_Int;
- pTos->i = c;
- }
break;
}
/* Opcode: And * * *
**