1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-08 03:22:21 +03:00

Fix for ticket #92: Correct the sqliteExprCompare() function so that is takes

into account the iTable and iColumn fields of the Expr structure.  Otherwise,
"min(a)" and "min(b)" will compare equal to each other in views. (CVS 658)

FossilOrigin-Name: 85793a4f03250166c21007cab3525709592d0866
This commit is contained in:
drh
2002-07-02 13:05:04 +00:00
parent 1f66c57a9c
commit 2f2c01e51d
4 changed files with 23 additions and 10 deletions

View 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.76 2002/06/29 02:20:08 drh Exp $
** $Id: expr.c,v 1.77 2002/07/02 13:05:05 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -1391,6 +1391,7 @@ int sqliteExprCompare(Expr *pA, Expr *pB){
return 0;
}
if( pA->pSelect || pB->pSelect ) return 0;
if( pA->iTable!=pB->iTable || pA->iColumn!=pB->iColumn ) return 0;
if( pA->token.z ){
if( pB->token.z==0 ) return 0;
if( pB->token.n!=pA->token.n ) return 0;