diff options
author | drh <drh@noemail.net> | 2014-09-19 22:44:20 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2014-09-19 22:44:20 +0000 |
commit | e7a3466458a175a88fa82c64c7a432825622c1d8 (patch) | |
tree | dea8f5f0eeb02928416901e5d317a792c79f0591 /src | |
parent | 1eda9f7d8702b8a81023e43ce153938f69dd7f62 (diff) | |
download | sqlite-e7a3466458a175a88fa82c64c7a432825622c1d8.tar.gz sqlite-e7a3466458a175a88fa82c64c7a432825622c1d8.zip |
Simplify two conditionals and add testcase() macros to the affinity transform
logic in the comparison operators.
FossilOrigin-Name: 544664cadfb4e504bc0b321c865d1ecb8a831e20
Diffstat (limited to 'src')
-rw-r--r-- | src/vdbe.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vdbe.c b/src/vdbe.c index 136b7abae..26ca72b9f 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -1900,17 +1900,21 @@ case OP_Ge: { /* same as TK_GE, jump, in1, in3 */ /* Neither operand is NULL. Do a comparison. */ affinity = pOp->p5 & SQLITE_AFF_MASK; if( affinity>=SQLITE_AFF_NUMERIC ){ - if( (pIn1->flags & (MEM_Int|MEM_Real))==0 && (pIn1->flags&MEM_Str)!=0 ){ + if( (pIn1->flags & (MEM_Int|MEM_Real|MEM_Str))==MEM_Str ){ applyNumericAffinity(pIn1,0); } - if( (pIn3->flags & (MEM_Int|MEM_Real))==0 && (pIn3->flags&MEM_Str)!=0 ){ + if( (pIn3->flags & (MEM_Int|MEM_Real|MEM_Str))==MEM_Str ){ applyNumericAffinity(pIn3,0); } }else if( affinity==SQLITE_AFF_TEXT ){ if( (pIn1->flags & MEM_Str)==0 && (pIn1->flags & (MEM_Int|MEM_Real))!=0 ){ + testcase( pIn1->flags & MEM_Int ); + testcase( pIn1->flags & MEM_Real ); sqlite3VdbeMemStringify(pIn1, encoding, 1); } if( (pIn3->flags & MEM_Str)==0 && (pIn3->flags & (MEM_Int|MEM_Real))!=0 ){ + testcase( pIn3->flags & MEM_Int ); + testcase( pIn3->flags & MEM_Real ); sqlite3VdbeMemStringify(pIn3, encoding, 1); } } |