From: drh Date: Fri, 19 Sep 2014 22:44:20 +0000 (+0000) Subject: Simplify two conditionals and add testcase() macros to the affinity transform X-Git-Tag: version-3.8.7~88 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e7a3466458a175a88fa82c64c7a432825622c1d8;p=thirdparty%2Fsqlite.git Simplify two conditionals and add testcase() macros to the affinity transform logic in the comparison operators. FossilOrigin-Name: 544664cadfb4e504bc0b321c865d1ecb8a831e20 --- diff --git a/manifest b/manifest index 6625f6c19a..fd932fa1b7 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Recognize\sthe\sinvariant\sthat\sa\sMem\sobject\scannot\sbe\sMEM_Dyn\sand\shave\s\na\snon-zero\sszMalloc\sat\sthe\ssame\stime.\s\sEnforce\sthis\swith\sassert()s\sand\nexploit\sit\sin\sthe\ssqlite3VdbeMemClearAndResize()\sroutine\sfor\sa\sperformance\nincrease. -D 2014-09-19T22:30:49.809 +C Simplify\stwo\sconditionals\sand\sadd\stestcase()\smacros\sto\sthe\saffinity\stransform\nlogic\sin\sthe\scomparison\soperators. +D 2014-09-19T22:44:20.033 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in cf57f673d77606ab0f2d9627ca52a9ba1464146a F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -288,7 +288,7 @@ F src/update.c 729f6f18fc27740591d085e1172cebe311144bf0 F src/utf.c fc6b889ba0779b7722634cdeaa25f1930d93820c F src/util.c 4006c01772bd8d8ac4306d523bbcee41d3e392d8 F src/vacuum.c 59f03f92bcff57faa6a8ca256eb29ccddfb0614a -F src/vdbe.c 16efd1ae26d877827cd6669f5f19afd8d8903d08 +F src/vdbe.c de1af1795bebdad20c23e82bafa2f531e9893198 F src/vdbe.h 09f5b4e3719fa454f252322b1cdab5cf1f361327 F src/vdbeInt.h f177bed1ec8d4eb5c7089f012aeb95f374745735 F src/vdbeapi.c e9e33b59834e3edc8790209765e069874c269d9d @@ -1198,7 +1198,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P e996ca32cb643c558b616c0dd872f3351b6aa3ef -R 5148a059197bc43e5fc9e398f77834ac +P 3b21cf2b284048da4b728a5d6ec89e5c330144d4 +R c321e5b6443015b26d22f3eade4b771c U drh -Z 24b5c2935cab55558784e01172e53731 +Z b0d83e95571a3002a17dc014110d23f5 diff --git a/manifest.uuid b/manifest.uuid index d94cacb1fd..aee58dcbcb 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3b21cf2b284048da4b728a5d6ec89e5c330144d4 \ No newline at end of file +544664cadfb4e504bc0b321c865d1ecb8a831e20 \ No newline at end of file diff --git a/src/vdbe.c b/src/vdbe.c index 136b7abae1..26ca72b9f4 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); } }