diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/expr.c | 6 | ||||
-rw-r--r-- | src/global.c | 8 | ||||
-rw-r--r-- | src/parse.y | 2 | ||||
-rw-r--r-- | src/select.c | 2 | ||||
-rw-r--r-- | src/sqliteInt.h | 1 | ||||
-rw-r--r-- | src/window.c | 2 |
6 files changed, 6 insertions, 15 deletions
diff --git a/src/expr.c b/src/expr.c index 9310f0003..43f20d876 100644 --- a/src/expr.c +++ b/src/expr.c @@ -905,7 +905,7 @@ Expr *sqlite3ExprAnd(Parse *pParse, Expr *pLeft, Expr *pRight){ }else if( ExprAlwaysFalse(pLeft) || ExprAlwaysFalse(pRight) ){ sqlite3ExprUnmapAndDelete(pParse, pLeft); sqlite3ExprUnmapAndDelete(pParse, pRight); - return sqlite3ExprAlloc(db, TK_INTEGER, &sqlite3IntTokens[0], 0); + return sqlite3Expr(db, TK_INTEGER, "0"); }else{ return sqlite3PExpr(pParse, TK_AND, pLeft, pRight); } @@ -2963,7 +2963,7 @@ int sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){ /* The subquery already has a limit. If the pre-existing limit is X ** then make the new limit X<>0 so that the new limit is either 1 or 0 */ sqlite3 *db = pParse->db; - pLimit = sqlite3ExprAlloc(db, TK_INTEGER, &sqlite3IntTokens[0], 0); + pLimit = sqlite3Expr(db, TK_INTEGER, "0"); if( pLimit ){ pLimit->affExpr = SQLITE_AFF_NUMERIC; pLimit = sqlite3PExpr(pParse, TK_NE, @@ -2973,7 +2973,7 @@ int sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){ pSel->pLimit->pLeft = pLimit; }else{ /* If there is no pre-existing limit add a limit of 1 */ - pLimit = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &sqlite3IntTokens[1], 0); + pLimit = sqlite3Expr(pParse->db, TK_INTEGER, "1"); pSel->pLimit = sqlite3PExpr(pParse, TK_LIMIT, pLimit, 0); } pSel->iLimit = 0; diff --git a/src/global.c b/src/global.c index a2979e2e5..4689e94bb 100644 --- a/src/global.c +++ b/src/global.c @@ -271,14 +271,6 @@ SQLITE_WSD struct Sqlite3Config sqlite3Config = { */ FuncDefHash sqlite3BuiltinFunctions; -/* -** Constant tokens for values 0 and 1. -*/ -const Token sqlite3IntTokens[] = { - { "0", 1 }, - { "1", 1 } -}; - #ifdef VDBE_PROFILE /* ** The following performance counter can be used in place of diff --git a/src/parse.y b/src/parse.y index e7bbc738f..2b69dd596 100644 --- a/src/parse.y +++ b/src/parse.y @@ -1181,7 +1181,7 @@ expr(A) ::= expr(A) between_op(N) expr(X) AND expr(Y). [BETWEEN] { ** regardless of the value of expr1. */ sqlite3ExprUnmapAndDelete(pParse, A); - A = sqlite3ExprAlloc(pParse->db, TK_INTEGER,&sqlite3IntTokens[N],1); + A = sqlite3Expr(pParse->db, TK_INTEGER, N ? "1" : "0"); }else{ A = sqlite3PExpr(pParse, TK_IN, A, 0); if( A ){ diff --git a/src/select.c b/src/select.c index f28bdf937..6d18f7524 100644 --- a/src/select.c +++ b/src/select.c @@ -5465,7 +5465,7 @@ static int havingToWhereExprCb(Walker *pWalker, Expr *pExpr){ Select *pS = pWalker->u.pSelect; if( sqlite3ExprIsConstantOrGroupBy(pWalker->pParse, pExpr, pS->pGroupBy) ){ sqlite3 *db = pWalker->pParse->db; - Expr *pNew = sqlite3ExprAlloc(db, TK_INTEGER, &sqlite3IntTokens[1], 0); + Expr *pNew = sqlite3Expr(db, TK_INTEGER, "1"); if( pNew ){ Expr *pWhere = pS->pWhere; SWAP(Expr, *pNew, *pExpr); diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 0a3c432bf..2934a16e9 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -4318,7 +4318,6 @@ extern const unsigned char sqlite3OpcodeProperty[]; extern const char sqlite3StrBINARY[]; extern const unsigned char sqlite3UpperToLower[]; extern const unsigned char sqlite3CtypeMap[]; -extern const Token sqlite3IntTokens[]; extern SQLITE_WSD struct Sqlite3Config sqlite3Config; extern FuncDefHash sqlite3BuiltinFunctions; #ifndef SQLITE_OMIT_WSD diff --git a/src/window.c b/src/window.c index 0fb8eb461..afbb7aaa1 100644 --- a/src/window.c +++ b/src/window.c @@ -991,7 +991,7 @@ int sqlite3WindowRewrite(Parse *pParse, Select *p){ */ if( pSublist==0 ){ pSublist = sqlite3ExprListAppend(pParse, 0, - sqlite3ExprAlloc(db, TK_INTEGER, &sqlite3IntTokens[0], 0) + sqlite3Expr(db, TK_INTEGER, "0") ); } |