~ubuntu-branches/ubuntu/hardy/sqlite3/hardy

« back to all changes in this revision

Viewing changes to src/expr.c

  • Committer: Bazaar Package Importer
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2007-08-20 16:12:00 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20070820161200-1u06zme8ghkyaenn
Tags: 3.4.2-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.300 2007/06/25 16:29:34 danielk1977 Exp $
 
15
** $Id: expr.c,v 1.303 2007/08/07 17:13:04 drh Exp $
16
16
*/
17
17
#include "sqliteInt.h"
18
18
#include <ctype.h>
177
177
** Argument pRight (but not pLeft) may be a null pointer. In this case,
178
178
** it is not considered.
179
179
*/
180
 
CollSeq* sqlite3BinaryCompareCollSeq(
 
180
CollSeq *sqlite3BinaryCompareCollSeq(
181
181
  Parse *pParse, 
182
182
  Expr *pLeft, 
183
183
  Expr *pRight
1140
1140
      for(j=0; j<pEList->nExpr; j++){
1141
1141
        char *zAs = pEList->a[j].zName;
1142
1142
        if( zAs!=0 && sqlite3StrICmp(zAs, zCol)==0 ){
1143
 
          Expr *pDup;
 
1143
          Expr *pDup, *pOrig;
1144
1144
          assert( pExpr->pLeft==0 && pExpr->pRight==0 );
1145
1145
          assert( pExpr->pList==0 );
1146
1146
          assert( pExpr->pSelect==0 );
1147
 
          pDup = sqlite3ExprDup(pEList->a[j].pExpr);
 
1147
          pOrig = pEList->a[j].pExpr;
 
1148
          if( !pNC->allowAgg && ExprHasProperty(pOrig, EP_Agg) ){
 
1149
            sqlite3ErrorMsg(pParse, "misuse of aliased aggregate %s", zAs);
 
1150
            sqliteFree(zCol);
 
1151
            return 2;
 
1152
          }
 
1153
          pDup = sqlite3ExprDup(pOrig);
1148
1154
          if( pExpr->flags & EP_ExpCollate ){
1149
1155
            pDup->pColl = pExpr->pColl;
1150
1156
            pDup->flags |= EP_ExpCollate;
1572
1578
      }else if( pExpr->pList ){
1573
1579
        /* Case 2:     expr IN (exprlist)
1574
1580
        **
1575
 
        ** For each expression, build an index key from the evaluation and
 
1581
        ** For each expression, build an index key from the evaluation and
1576
1582
        ** store it in the temporary table. If <expr> is a column, then use
1577
1583
        ** that columns affinity when building index keys. If <expr> is not
1578
1584
        ** a column, use numeric affinity.
2052
2058
      if( !pParse->trigStack ){
2053
2059
        sqlite3ErrorMsg(pParse,
2054
2060
                       "RAISE() may only be used within a trigger-program");
2055
 
        return;
 
2061
        return;
2056
2062
      }
2057
2063
      if( pExpr->iColumn!=OE_Ignore ){
2058
2064
         assert( pExpr->iColumn==OE_Rollback ||