diff options
author | drh <drh@noemail.net> | 2008-01-18 14:08:24 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2008-01-18 14:08:24 +0000 |
commit | ca48c90f60fa43ec60d82acd6ba4f33689f2b658 (patch) | |
tree | 1f2ad81aea145fb36f86055b496c6ff983e13478 /src/expr.c | |
parent | a98d7b47975e218820ddc3a8b6a16fc98fe047f4 (diff) | |
download | sqlite-ca48c90f60fa43ec60d82acd6ba4f33689f2b658.tar.gz sqlite-ca48c90f60fa43ec60d82acd6ba4f33689f2b658.zip |
Remove the OP_HexBlob instruction and code OP_Blob directly. Reduce
the amount of memory allocation required to encode blob literals.
Remove the "out2" instruction type. Other minor optimizations. (CVS 4726)
FossilOrigin-Name: 0e50c0200a3c1c04e63cbb55a7255cdbbd225347
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/expr.c b/src/expr.c index ec850ea17..01574f2c9 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.349 2008/01/18 02:31:56 drh Exp $ +** $Id: expr.c,v 1.350 2008/01/18 14:08:24 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -2004,14 +2004,15 @@ static int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ case TK_BLOB: { int n; const char *z; - assert( TK_BLOB==OP_HexBlob ); + char *zBlob; + assert( pExpr->token.n>=3 ); + assert( pExpr->token.z[0]=='x' || pExpr->token.z[0]=='X' ); + assert( pExpr->token.z[1]=='\'' ); + assert( pExpr->token.z[pExpr->token.n-1]=='\'' ); n = pExpr->token.n - 3; z = (char*)pExpr->token.z + 2; - assert( n>=0 ); - if( n==0 ){ - z = ""; - } - sqlite3VdbeAddOp4(v, op, 0, target, 0, z, n); + zBlob = sqlite3HexToBlob(sqlite3VdbeDb(v), z, n); + sqlite3VdbeAddOp4(v, OP_Blob, n/2, target, 0, zBlob, P4_DYNAMIC); break; } #endif |