mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-10 01:02:56 +03:00
Remove the OP_StrEq opcodes. (CVS 1397)
FossilOrigin-Name: 238442bbd267faee3eb70048bd9419af99c02931
This commit is contained in:
14
manifest
14
manifest
@@ -1,5 +1,5 @@
|
||||
C Remove\sdead\scode\sfrom\sutil.c\s(CVS\s1396)
|
||||
D 2004-05-18T22:03:43
|
||||
C Remove\sthe\sOP_StrEq\sopcodes.\s(CVS\s1397)
|
||||
D 2004-05-18T22:17:46
|
||||
F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a
|
||||
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
|
||||
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
|
||||
@@ -43,7 +43,7 @@ F src/os.h fbb2f6595fc34fa351830d88fe1c6b85118f0383
|
||||
F src/pager.c 6ff6b906427d4824099140776cb8768f922f3dc5
|
||||
F src/pager.h 78a00ac280899bcba1a89dc51585dcae6b7b3253
|
||||
F src/parse.y d2e226650738931c047c2562326ed05882af2330
|
||||
F src/pragma.c fcbd8bc7f2cc1429758a042920e13c8738a6050c
|
||||
F src/pragma.c 2332e7fa9d7cd4b21f30583a696bee36628404ca
|
||||
F src/printf.c ef750e8e2398ca7e8b58be991075f08c6a7f0e53
|
||||
F src/random.c eff68e3f257e05e81eae6c4d50a51eb88beb4ff3
|
||||
F src/select.c f376f3beade0e1e4808b3a393c13f5b30baecf74
|
||||
@@ -63,7 +63,7 @@ F src/update.c 0cc7291dd0e0f82cf93085e49c973e8ef9e51fd5
|
||||
F src/utf.c fc799748d43fe1982d157b871e3e420a19c85d4f
|
||||
F src/util.c 6d4339b7f05ccdacaebcce67e7fb8c5b880620e8
|
||||
F src/vacuum.c c134702e023db8778e6be59ac0ea7b02315b5476
|
||||
F src/vdbe.c 5cc6e41f2c9f24bbbf591ca538c097c0f7b41a3d
|
||||
F src/vdbe.c 37c3d0c45fd6bd7096ae50d08e864acf41924b34
|
||||
F src/vdbe.h 1d0d0b5741c7f46ab372a95a4305fed0ae09d466
|
||||
F src/vdbeInt.h b4ad3993c720eb80430aeff12d63f22eb4925e7d
|
||||
F src/vdbeaux.c 760105ceedb7bcfcd3f4dbba7a5500321612669b
|
||||
@@ -193,7 +193,7 @@ F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604
|
||||
F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da
|
||||
F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1
|
||||
F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
|
||||
P 61bdb53a363644074d01682fab8220078523676b
|
||||
R 4ce96fc8601455b203e1d075dc16c4ef
|
||||
P 3ce42e85a2e6c95ebc0857436d5fe9384cab8628
|
||||
R fddf5a86430596516456c7f7cc0b49c1
|
||||
U drh
|
||||
Z 94a194243da33cd3a770a79c6fa71a6f
|
||||
Z 8311704fbb47e04be82877058c3afb37
|
||||
|
@@ -1 +1 @@
|
||||
3ce42e85a2e6c95ebc0857436d5fe9384cab8628
|
||||
238442bbd267faee3eb70048bd9419af99c02931
|
@@ -11,7 +11,7 @@
|
||||
*************************************************************************
|
||||
** This file contains code used to implement the PRAGMA command.
|
||||
**
|
||||
** $Id: pragma.c,v 1.25 2004/05/18 09:58:08 danielk1977 Exp $
|
||||
** $Id: pragma.c,v 1.26 2004/05/18 22:17:46 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <ctype.h>
|
||||
@@ -589,7 +589,7 @@ void sqlite3Pragma(Parse *pParse, Token *pLeft, Token *pRight, int minusFlag){
|
||||
{ OP_IntegrityCk, 0, 0, 0}, /* 8 */
|
||||
{ OP_Dup, 0, 1, 0},
|
||||
{ OP_String, 0, 0, "ok"},
|
||||
{ OP_StrEq, 0, 13, 0}, /* 11 */
|
||||
{ OP_Eq, 0, 13, 0}, /* 11 */
|
||||
{ OP_MemIncr, 0, 0, 0},
|
||||
{ OP_String, 0, 0, "*** in database "},
|
||||
{ OP_String, 0, 0, 0}, /* 14 */
|
||||
@@ -713,6 +713,3 @@ void sqlite3Pragma(Parse *pParse, Token *pLeft, Token *pRight, int minusFlag){
|
||||
sqliteFree(zLeft);
|
||||
sqliteFree(zRight);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
150
src/vdbe.c
150
src/vdbe.c
@@ -43,7 +43,7 @@
|
||||
** 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.298 2004/05/18 09:58:08 danielk1977 Exp $
|
||||
** $Id: vdbe.c,v 1.299 2004/05/18 22:17:46 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "os.h"
|
||||
@@ -1451,13 +1451,20 @@ mismatch:
|
||||
** 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 least significant byte of P1 may be either 0x00 or 0x01. If either
|
||||
** operand is NULL (and thus if the result is unknown) then take the jump
|
||||
** only if the least significant byte of P1 is 0x01.
|
||||
**
|
||||
** If both values are numeric, they are converted to doubles using atof()
|
||||
** and compared in that format. Otherwise the strcmp() library
|
||||
** routine is used for the comparison. For a pure text comparison
|
||||
** use OP_StrNe.
|
||||
** The second least significant byte of P1 must be an affinity character -
|
||||
** 'n', 't', 'i' or 'o' - or 0x00. An attempt is made to coerce both values
|
||||
** according to the affinity before the comparison is made. If the byte is
|
||||
** 0x00, then numeric affinity is used.
|
||||
**
|
||||
** Once any conversions have taken place, and neither value is NULL,
|
||||
** the values are compared. If both values are blobs, or both are text,
|
||||
** then memcmp() is used to determine the results of the comparison. If
|
||||
** both values are numeric, then a numeric comparison is used. If the
|
||||
** two values are of different types, then they are inequal.
|
||||
**
|
||||
** 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
|
||||
@@ -1470,14 +1477,20 @@ mismatch:
|
||||
** jump to instruction P2. Otherwise, continue to the next instruction.
|
||||
** 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 least significant byte of P1 may be either 0x00 or 0x01. If either
|
||||
** operand is NULL (and thus if the result is unknown) then take the jump
|
||||
** only if the least significant byte of P1 is 0x01.
|
||||
**
|
||||
** If both values are numeric, they are converted to doubles using atof()
|
||||
** and compared in that format. Numeric values are always less than
|
||||
** non-numeric values. If both operands are non-numeric, the strcmp() library
|
||||
** routine is used for the comparison. For a pure text comparison
|
||||
** use OP_StrLt.
|
||||
** The second least significant byte of P1 must be an affinity character -
|
||||
** 'n', 't', 'i' or 'o' - or 0x00. An attempt is made to coerce both values
|
||||
** according to the affinity before the comparison is made. If the byte is
|
||||
** 0x00, then numeric affinity is used.
|
||||
**
|
||||
** Once any conversions have taken place, and neither value is NULL,
|
||||
** the values are compared. If both values are blobs, or both are text,
|
||||
** then memcmp() is used to determine the results of the comparison. If
|
||||
** both values are numeric, then a numeric comparison is used. If the
|
||||
** two values are of different types, then they are inequal.
|
||||
**
|
||||
** 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
|
||||
@@ -1489,14 +1502,20 @@ mismatch:
|
||||
** next on stack) is less 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 least significant byte of P1 may be either 0x00 or 0x01. If either
|
||||
** operand is NULL (and thus if the result is unknown) then take the jump
|
||||
** only if the least significant byte of P1 is 0x01.
|
||||
**
|
||||
** If both values are numeric, they are converted to doubles using atof()
|
||||
** and compared in that format. Numeric values are always less than
|
||||
** non-numeric values. If both operands are non-numeric, the strcmp() library
|
||||
** routine is used for the comparison. For a pure text comparison
|
||||
** use OP_StrLe.
|
||||
** The second least significant byte of P1 must be an affinity character -
|
||||
** 'n', 't', 'i' or 'o' - or 0x00. An attempt is made to coerce both values
|
||||
** according to the affinity before the comparison is made. If the byte is
|
||||
** 0x00, then numeric affinity is used.
|
||||
**
|
||||
** Once any conversions have taken place, and neither value is NULL,
|
||||
** the values are compared. If both values are blobs, or both are text,
|
||||
** then memcmp() is used to determine the results of the comparison. If
|
||||
** both values are numeric, then a numeric comparison is used. If the
|
||||
** two values are of different types, then they are inequal.
|
||||
**
|
||||
** 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
|
||||
@@ -1508,14 +1527,20 @@ mismatch:
|
||||
** next on stack) is greater than 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 least significant byte of P1 may be either 0x00 or 0x01. If either
|
||||
** operand is NULL (and thus if the result is unknown) then take the jump
|
||||
** only if the least significant byte of P1 is 0x01.
|
||||
**
|
||||
** If both values are numeric, they are converted to doubles using atof()
|
||||
** and compared in that format. Numeric values are always less than
|
||||
** non-numeric values. If both operands are non-numeric, the strcmp() library
|
||||
** routine is used for the comparison. For a pure text comparison
|
||||
** use OP_StrGt.
|
||||
** The second least significant byte of P1 must be an affinity character -
|
||||
** 'n', 't', 'i' or 'o' - or 0x00. An attempt is made to coerce both values
|
||||
** according to the affinity before the comparison is made. If the byte is
|
||||
** 0x00, then numeric affinity is used.
|
||||
**
|
||||
** Once any conversions have taken place, and neither value is NULL,
|
||||
** the values are compared. If both values are blobs, or both are text,
|
||||
** then memcmp() is used to determine the results of the comparison. If
|
||||
** both values are numeric, then a numeric comparison is used. If the
|
||||
** two values are of different types, then they are inequal.
|
||||
**
|
||||
** 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
|
||||
@@ -1527,20 +1552,24 @@ mismatch:
|
||||
** 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 least significant byte of P1 may be either 0x00 or 0x01. If either
|
||||
** operand is NULL (and thus if the result is unknown) then take the jump
|
||||
** only if the least significant byte of P1 is 0x01.
|
||||
**
|
||||
** If both values are numeric, they are converted to doubles using atof()
|
||||
** and compared in that format. Numeric values are always less than
|
||||
** non-numeric values. If both operands are non-numeric, the strcmp() library
|
||||
** routine is used for the comparison. For a pure text comparison
|
||||
** use OP_StrGe.
|
||||
** The second least significant byte of P1 must be an affinity character -
|
||||
** 'n', 't', 'i' or 'o' - or 0x00. An attempt is made to coerce both values
|
||||
** according to the affinity before the comparison is made. If the byte is
|
||||
** 0x00, then numeric affinity is used.
|
||||
**
|
||||
** Once any conversions have taken place, and neither value is NULL,
|
||||
** the values are compared. If both values are blobs, or both are text,
|
||||
** then memcmp() is used to determine the results of the comparison. If
|
||||
** both values are numeric, then a numeric comparison is used. If the
|
||||
** two values are of different types, then they are inequal.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** FIX ME: The comment for OP_Eq is up to date, but none of the others are.
|
||||
*/
|
||||
case OP_Eq:
|
||||
case OP_Ne:
|
||||
@@ -1598,53 +1627,6 @@ case OP_Ge: {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
#if 0
|
||||
Mem *pNos = &pTos[-1];
|
||||
i64 c, v;
|
||||
int ft, fn;
|
||||
assert( pNos>=p->aStack );
|
||||
ft = pTos->flags;
|
||||
fn = pNos->flags;
|
||||
if( (ft | fn) & MEM_Null ){
|
||||
popStack(&pTos, 2);
|
||||
if( pOp->p2 ){
|
||||
if( pOp->p1 ) pc = pOp->p2-1;
|
||||
}else{
|
||||
pTos++;
|
||||
pTos->flags = MEM_Null;
|
||||
}
|
||||
break;
|
||||
}else if( (ft & fn & MEM_Int)==MEM_Int ){
|
||||
c = pNos->i - pTos->i;
|
||||
}else if( (ft & MEM_Int)!=0 && (fn & MEM_Str)!=0 && toInt(pNos->z,&v) ){
|
||||
c = v - pTos->i;
|
||||
}else if( (fn & MEM_Int)!=0 && (ft & MEM_Str)!=0 && toInt(pTos->z,&v) ){
|
||||
c = pNos->i - v;
|
||||
}else{
|
||||
Stringify(pTos);
|
||||
Stringify(pNos);
|
||||
c = sqlite3Compare(pNos->z, pTos->z);
|
||||
}
|
||||
switch( pOp->opcode ){
|
||||
case OP_Eq: c = c==0; break;
|
||||
case OP_Ne: c = c!=0; break;
|
||||
case OP_Lt: c = c<0; break;
|
||||
case OP_Le: c = c<=0; break;
|
||||
case OP_Gt: c = c>0; break;
|
||||
default: c = c>=0; break;
|
||||
}
|
||||
popStack(&pTos, 2);
|
||||
if( pOp->p2 ){
|
||||
if( c ) pc = pOp->p2-1;
|
||||
}else{
|
||||
pTos++;
|
||||
pTos->i = c;
|
||||
pTos->flags = MEM_Int;
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
/* INSERT NO CODE HERE!
|
||||
**
|
||||
** The opcode numbers are extracted from this source file by doing
|
||||
|
Reference in New Issue
Block a user