]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix typo reported by ticket #3888. Other minor edits to facilitate
authordrh <drh@noemail.net>
Sat, 30 May 2009 23:35:43 +0000 (23:35 +0000)
committerdrh <drh@noemail.net>
Sat, 30 May 2009 23:35:43 +0000 (23:35 +0000)
coverage testing. (CVS 6695)

FossilOrigin-Name: 164adf261d2536f16c83e44f6482dfb3d04a45d5

manifest
manifest.uuid
src/expr.c

index ab9bb77e1680054db3f59743055a35e7124d54b7..530f8e487e4fe6f5542a1932e02ce27cd5caf3ae 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Simplifications\sto\sthe\sexpr.c\ssource\smodule\sresulting\sfrom\sstructural\ntesting.\s(CVS\s6694)
-D 2009-05-30T20:49:20
+C Fix\stypo\sreported\sby\sticket\s#3888.\s\sOther\sminor\sedits\sto\sfacilitate\ncoverage\stesting.\s(CVS\s6695)
+D 2009-05-30T23:35:43
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -114,7 +114,7 @@ F src/callback.c 57359fa93de47c341b6b8ee504a88ff276397686
 F src/complete.c 5ad5c6cd4548211867c204c41a126d73a9fbcea0
 F src/date.c ab5f7137656652a48434d64f96bdcdc823bb23b3
 F src/delete.c cb791855c7948cecc96def9d97989879ca26f257
-F src/expr.c f0b46b992f5e371706e91205fe3b8aea199d8766
+F src/expr.c ac7ebc41433d177dfbc21780c9cce790bbdbecaf
 F src/fault.c dc88c821842157460750d2d61a8a8b4197d047ff
 F src/func.c 9d7b47729c337c5e4b78d795922ed34eec4aef67
 F src/global.c 448419c44ce0701104c2121b0e06919b44514c0c
@@ -731,7 +731,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 00e7250f11e190cd915870438d172f574d110e6d
-R eed238d5c207fcace25a1d14a8d7836f
+P f760bb7a0372d11ac7e3287b8a56fc4261e6371c
+R 27b6ce0fb3260e877dc964dee964de13
 U drh
-Z b1372e359ebf0d19a0cf7f52aedf055c
+Z 03718f2f6b19c22e54c0a99a910d7f35
index 605bdadddfab04beb538d67240adbb2eacc25b11..57d144e788a7db01f9f94e44eac73ec8bc6f174b 100644 (file)
@@ -1 +1 @@
-f760bb7a0372d11ac7e3287b8a56fc4261e6371c
\ No newline at end of file
+164adf261d2536f16c83e44f6482dfb3d04a45d5
\ No newline at end of file
index ba2f807574937aec458a87a5b746a6d5388c9409..f6cb658747c30f1c474dc049b4b768c71edfc520 100644 (file)
@@ -12,7 +12,7 @@
 ** This file contains routines used for analyzing expressions and
 ** for generating VDBE code that evaluates expressions in SQLite.
 **
-** $Id: expr.c,v 1.443 2009/05/30 20:49:20 drh Exp $
+** $Id: expr.c,v 1.444 2009/05/30 23:35:43 drh Exp $
 */
 #include "sqliteInt.h"
 
@@ -2625,7 +2625,6 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){
         }
         nextCase = sqlite3VdbeMakeLabel(v);
         testcase( pTest->op==TK_COLUMN );
-        testcase( pTest->op==TK_COLUMN );
         sqlite3ExprIfFalse(pParse, pTest, nextCase, SQLITE_JUMPIFNULL);
         testcase( aListelem[i+1].pExpr->op==TK_COLUMN );
         testcase( aListelem[i+1].pExpr->op==TK_REGISTER );
@@ -2730,7 +2729,13 @@ int sqlite3ExprCodeAndCache(Parse *pParse, Expr *pExpr, int target){
   int inReg;
   inReg = sqlite3ExprCode(pParse, pExpr, target);
   assert( target>0 );
-  if( pExpr->op!=TK_REGISTER ){  
+  /* This routine is called for terms to INSERT or UPDATE.  And the only
+  ** other place where expressions can be converted into TK_REGISTER is
+  ** in WHERE clause processing.  So as currently implemented, there is
+  ** no way for a TK_REGISTER to exist here.  But it seems prudent to
+  ** keep the ALWAYS() in case the conditions above change with future
+  ** modifications or enhancements. */
+  if( ALWAYS(pExpr->op!=TK_REGISTER) ){  
     int iMem;
     iMem = ++pParse->nMem;
     sqlite3VdbeAddOp2(v, OP_Copy, inReg, iMem);
@@ -2787,10 +2792,10 @@ static int isAppropriateForFactoring(Expr *p){
       return 0;
     }
     case TK_UMINUS: {
-       if( p->pLeft->op==TK_FLOAT || p->pLeft->op==TK_INTEGER ){
-         return 0;
-       }
-       break;
+      if( p->pLeft->op==TK_FLOAT || p->pLeft->op==TK_INTEGER ){
+        return 0;
+      }
+      break;
     }
     default: {
       break;
@@ -3213,7 +3218,7 @@ int sqlite3ExprCompare(Expr *pA, Expr *pB){
       return 0;
     }
   }else if( pA->op!=TK_COLUMN && pA->u.zToken ){
-    if( ExprHasProperty(pB, EP_IntValue) || pB->u.zToken==0 ) return 0;
+    if( ExprHasProperty(pB, EP_IntValue) || NEVER(pB->u.zToken==0) ) return 0;
     if( sqlite3StrICmp(pA->u.zToken,pB->u.zToken)!=0 ){
       return 0;
     }
@@ -3277,7 +3282,7 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){
       testcase( pExpr->op==TK_COLUMN );
       /* Check to see if the column is in one of the tables in the FROM
       ** clause of the aggregate query */
-      if( pSrcList ){
+      if( ALWAYS(pSrcList!=0) ){
         struct SrcList_item *pItem = pSrcList->a;
         for(i=0; i<pSrcList->nSrc; i++, pItem++){
           struct AggInfo_col *pCol;
@@ -3411,6 +3416,7 @@ void sqlite3ExprAnalyzeAggregates(NameContext *pNC, Expr *pExpr){
   w.xExprCallback = analyzeAggregate;
   w.xSelectCallback = analyzeAggregatesInSelect;
   w.u.pNC = pNC;
+  assert( pNC->pSrcList!=0 );
   sqlite3WalkExpr(&w, pExpr);
 }