aboutsummaryrefslogtreecommitdiff
path: root/src/resolve.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2009-06-15 23:15:59 +0000
committerdrh <drh@noemail.net>2009-06-15 23:15:59 +0000
commitf7828b5cd64847ce557b41e301bcdf5667187977 (patch)
tree96b0f6f7478087a77551b6d6538f07af8515233e /src/resolve.c
parent0b3bf92417f94429c76926c3b26c48bb09bcb4ea (diff)
downloadsqlite-f7828b5cd64847ce557b41e301bcdf5667187977.tar.gz
sqlite-f7828b5cd64847ce557b41e301bcdf5667187977.zip
Additional updates to the symbol resolver and expression tree walker to
facilitate test coverage. (CVS 6764) FossilOrigin-Name: a49c2d4befcc33dd98543fe7b4d4f0bae56f1a90
Diffstat (limited to 'src/resolve.c')
-rw-r--r--src/resolve.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/resolve.c b/src/resolve.c
index 666bbf226..9ba756765 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -14,7 +14,7 @@
** resolve all identifiers by associating them with a particular
** table and column.
**
-** $Id: resolve.c,v 1.29 2009/06/15 18:32:36 drh Exp $
+** $Id: resolve.c,v 1.30 2009/06/15 23:15:59 drh Exp $
*/
#include "sqliteInt.h"
#include <stdlib.h>
@@ -119,7 +119,7 @@ static void resolveAlias(
** can be used.
**
** If the name cannot be resolved unambiguously, leave an error message
-** in pParse and return non-zero. Return zero on success.
+** in pParse and return WRC_Abort. Return WRC_Prune on success.
*/
static int lookupName(
Parse *pParse, /* The parsing context */
@@ -295,7 +295,7 @@ static int lookupName(
pOrig = pEList->a[j].pExpr;
if( !pNC->allowAgg && ExprHasProperty(pOrig, EP_Agg) ){
sqlite3ErrorMsg(pParse, "misuse of aliased aggregate %s", zAs);
- return 2;
+ return WRC_Abort;
}
resolveAlias(pParse, pEList, j, pExpr, "");
cnt = 1;
@@ -327,7 +327,7 @@ static int lookupName(
if( cnt==0 && zTab==0 && ExprHasProperty(pExpr,EP_DblQuoted) ){
pExpr->op = TK_STRING;
pExpr->pTab = 0;
- return 0;
+ return WRC_Prune;
}
/*
@@ -382,9 +382,9 @@ lookupname_end:
if( pTopNC==pNC ) break;
pTopNC = pTopNC->pNext;
}
- return 0;
+ return WRC_Prune;
} else {
- return 1;
+ return WRC_Abort;
}
}
@@ -443,8 +443,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
/* A lone identifier is the name of a column.
*/
case TK_ID: {
- lookupName(pParse, 0, 0, pExpr->u.zToken, pNC, pExpr);
- return WRC_Prune;
+ return lookupName(pParse, 0, 0, pExpr->u.zToken, pNC, pExpr);
}
/* A table name and column name: ID.ID
@@ -468,8 +467,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
zTable = pRight->pLeft->u.zToken;
zColumn = pRight->pRight->u.zToken;
}
- lookupName(pParse, zDb, zTable, zColumn, pNC, pExpr);
- return WRC_Prune;
+ return lookupName(pParse, zDb, zTable, zColumn, pNC, pExpr);
}
/* Resolve function names