1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-08 03:22:21 +03:00

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
This commit is contained in:
drh
2008-01-18 14:08:24 +00:00
parent a98d7b4797
commit ca48c90f60
8 changed files with 49 additions and 86 deletions

View File

@@ -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