/ Check-in [fba0a1e5]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add comments to sqlite3ExprCompare() to clarify its operation. Ticket #2216. (CVS 3663)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:fba0a1e50820677081bc7cf01f97bf953065f7c4
User & Date: drh 2007-02-24 15:29:04
Context
2007-02-27
02:01
Improvements to OS layer tracing on the unix backend. (CVS 3664) check-in: 3ad96dbe user: drh tags: trunk
2007-02-24
15:29
Add comments to sqlite3ExprCompare() to clarify its operation. Ticket #2216. (CVS 3663) check-in: fba0a1e5 user: drh tags: trunk
15:18
Additional test cases added. Improvements to the INSERT transfer optimization. (CVS 3662) check-in: 2bf5475b user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains routines used for analyzing expressions and
    13     13   ** for generating VDBE code that evaluates expressions in SQLite.
    14     14   **
    15         -** $Id: expr.c,v 1.279 2007/02/24 13:53:05 drh Exp $
           15  +** $Id: expr.c,v 1.280 2007/02/24 15:29:04 drh Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   #include <ctype.h>
    19     19   
    20     20   /*
    21     21   ** Return the 'affinity' of the expression pExpr if any.
    22     22   **
................................................................................
  2183   2183     }
  2184   2184     pParse->ckOffset = ckOffset;
  2185   2185   }
  2186   2186   
  2187   2187   /*
  2188   2188   ** Do a deep comparison of two expression trees.  Return TRUE (non-zero)
  2189   2189   ** if they are identical and return FALSE if they differ in any way.
         2190  +**
         2191  +** Sometimes this routine will return FALSE even if the two expressions
         2192  +** really are equivalent.  If we cannot prove that the expressions are
         2193  +** identical, we return FALSE just to be safe.  So if this routine
         2194  +** returns false, then you do not really know for certain if the two
         2195  +** expressions are the same.  But if you get a TRUE return, then you
         2196  +** can be sure the expressions are the same.  In the places where
         2197  +** this routine is used, it does not hurt to get an extra FALSE - that
         2198  +** just might result in some slightly slower code.  But returning
         2199  +** an incorrect TRUE could lead to a malfunction.
  2190   2200   */
  2191   2201   int sqlite3ExprCompare(Expr *pA, Expr *pB){
  2192   2202     int i;
  2193   2203     if( pA==0||pB==0 ){
  2194   2204       return pB==pA;
  2195   2205     }
  2196   2206     if( pA->op!=pB->op ) return 0;