diff options
author | drh <drh@noemail.net> | 2005-06-22 08:48:06 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2005-06-22 08:48:06 +0000 |
commit | 288d37f1b44a117f9602df9e5ad738858e0dfb3b (patch) | |
tree | 57cdbfcea4068569c9fb0f4cdb15da5d8a25b234 /src/expr.c | |
parent | edef8fcd73cea22d402dfb2fb91fe88e511207a8 (diff) | |
download | sqlite-288d37f1b44a117f9602df9e5ad738858e0dfb3b.tar.gz sqlite-288d37f1b44a117f9602df9e5ad738858e0dfb3b.zip |
Allow parameters to be introduced by characters ':', '$' and '#'. This
is an experimental change. (CVS 2523)
FossilOrigin-Name: f3427a139c3bd4faf9134ec6290b3eb829c0a19f
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/expr.c b/src/expr.c index edba81a2a..4f21800e5 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.206 2005/06/12 21:35:52 drh Exp $ +** $Id: expr.c,v 1.207 2005/06/22 08:48:06 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -207,9 +207,8 @@ Expr *sqlite3Expr(int op, Expr *pLeft, Expr *pRight, const Token *pToken){ /* ** When doing a nested parse, you can include terms in an expression ** that look like this: #0 #1 #2 ... These terms refer to elements -** on the stack. "#0" (or just "#") means the top of the stack. -** "#1" means the next down on the stack. And so forth. #-1 means -** memory location 0. #-2 means memory location 1. And so forth. +** on the stack. "#0" means the top of the stack. +** "#1" means the next down on the stack. And so forth. ** ** This routine is called by the parser to deal with on of those terms. ** It immediately generates code to store the value in a memory location. @@ -230,13 +229,9 @@ Expr *sqlite3RegisterExpr(Parse *pParse, Token *pToken){ return 0; /* Malloc failed */ } depth = atoi(&pToken->z[1]); - if( depth>=0 ){ - p->iTable = pParse->nMem++; - sqlite3VdbeAddOp(v, OP_Dup, depth, 0); - sqlite3VdbeAddOp(v, OP_MemStore, p->iTable, 1); - }else{ - p->iTable = -1-depth; - } + p->iTable = pParse->nMem++; + sqlite3VdbeAddOp(v, OP_Dup, depth, 0); + sqlite3VdbeAddOp(v, OP_MemStore, p->iTable, 1); return p; } |