aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2001-12-21 14:30:42 +0000
committerdrh <drh@noemail.net>2001-12-21 14:30:42 +0000
commit4a32431ce7c94176cb146d3776e192b45fe92d57 (patch)
tree574800b0a2869e96c723eb885ccbb4ff204a416c /src/expr.c
parent7c917d196f3e9fbe7af324707dde461f54e9da0c (diff)
downloadsqlite-4a32431ce7c94176cb146d3776e192b45fe92d57.tar.gz
sqlite-4a32431ce7c94176cb146d3776e192b45fe92d57.zip
Added support for the INTEGER PRIMARY KEY column type. (CVS 333)
FossilOrigin-Name: 236a54d289e858a1e0505a20d907a2a40c01b521
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/expr.c b/src/expr.c
index fc7e7f83e..37f4d28e1 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.34 2001/11/24 00:31:46 drh Exp $
+** $Id: expr.c,v 1.35 2001/12/21 14:30:43 drh Exp $
*/
#include "sqliteInt.h"
@@ -127,7 +127,12 @@ int sqliteExprResolveIds(Parse *pParse, IdList *pTabList, Expr *pExpr){
if( sqliteStrICmp(pTab->aCol[j].zName, z)==0 ){
cnt++;
pExpr->iTable = i + pParse->nTab;
- pExpr->iColumn = j;
+ if( j==pTab->iPKey ){
+ /* Substitute the record number for the INTEGER PRIMARY KEY */
+ pExpr->iColumn = -1;
+ }else{
+ pExpr->iColumn = j;
+ }
}
}
}
@@ -190,7 +195,12 @@ int sqliteExprResolveIds(Parse *pParse, IdList *pTabList, Expr *pExpr){
if( sqliteStrICmp(pTab->aCol[j].zName, zRight)==0 ){
cnt++;
pExpr->iTable = i + pParse->nTab;
- pExpr->iColumn = j;
+ if( j==pTab->iPKey ){
+ /* Substitute the record number for the INTEGER PRIMARY KEY */
+ pExpr->iColumn = -1;
+ }else{
+ pExpr->iColumn = j;
+ }
}
}
}