aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2002-01-06 17:07:40 +0000
committerdrh <drh@noemail.net>2002-01-06 17:07:40 +0000
commitaacc543e23f8899f5cdd7e58e1950ee226019f3c (patch)
tree53d27f1c627a3e2aa3cc85ef29b14145db6a1dfb /src/expr.c
parentc6b52df32d43900ad48cb231efa0ff3a9569066a (diff)
downloadsqlite-aacc543e23f8899f5cdd7e58e1950ee226019f3c.tar.gz
sqlite-aacc543e23f8899f5cdd7e58e1950ee226019f3c.zip
Comment updates most. Also some small changes to the VDBE. (CVS 339)
FossilOrigin-Name: 9b0be4fcc1cbca69f5fee906f86dfb36a323fe84
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/expr.c b/src/expr.c
index 526ad6622..6d2e3104b 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -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.36 2002/01/04 03:09:30 drh Exp $
+** $Id: expr.c,v 1.37 2002/01/06 17:07:40 drh Exp $
*/
#include "sqliteInt.h"
@@ -49,7 +49,9 @@ static int isConstant(Expr *p){
** These operators have to be processed before column names are
** resolved because each such operator increments pParse->nTab
** to reserve cursor numbers for its own use. But pParse->nTab
-** needs to be constant once we begin resolving column names.
+** needs to be constant once we begin resolving column names. For
+** that reason, this procedure needs to be called on every expression
+** before sqliteExprResolveIds() is called on any expression.
**
** Actually, the processing of IN-SELECT is only started by this
** routine. This routine allocates a cursor number to the IN-SELECT
@@ -86,11 +88,15 @@ static int sqliteIsRowid(const char *z){
/*
** This routine walks an expression tree and resolves references to
** table columns. Nodes of the form ID.ID or ID resolve into an
-** index to the table in the table list and a column offset. The opcode
-** for such nodes is changed to TK_COLUMN. The iTable value is changed
-** to the index of the referenced table in pTabList plus the pParse->nTab
-** value. The iColumn value is changed to the index of the column of the
-** referenced table.
+** index to the table in the table list and a column offset. The
+** Expr.opcode for such nodes is changed to TK_COLUMN. The Expr.iTable
+** value is changed to the index of the referenced table in pTabList
+** plus the pParse->nTab value. This value will ultimately become the
+** VDBE cursor number for a cursor that is pointing into the referenced
+** table. The Expr.iColumn value is changed to the index of the column
+** of the referenced table. The Expr.iColumn value for the special
+** ROWID column is -1. Any INTEGER PRIMARY KEY column is tried as an
+** alias for ROWID.
**
** We also check for instances of the IN operator. IN comes in two
** forms: