aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2004-05-30 01:38:43 +0000
committerdrh <drh@noemail.net>2004-05-30 01:38:43 +0000
commit6fec0762389cc1ae09c0071b79e40845d8284f43 (patch)
tree5ff71ce2ea6b6d905cb5bad134bb5540dc34ce73 /src/expr.c
parent436051582f4c8bf418d8f6702047560e8a686202 (diff)
downloadsqlite-6fec0762389cc1ae09c0071b79e40845d8284f43.tar.gz
sqlite-6fec0762389cc1ae09c0071b79e40845d8284f43.zip
Do not include the P3 parameter on OP_Integer opcodes if the integer will fit
in 32 bits. The P3 conversion is slow. (CVS 1494) FossilOrigin-Name: fcd84ebabca72023e76e6954514948aa9a3ab999
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/expr.c b/src/expr.c
index 1e87ed818..12dbd9992 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.132 2004/05/29 11:24:50 danielk1977 Exp $
+** $Id: expr.c,v 1.133 2004/05/30 01:38:43 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -1068,8 +1068,10 @@ int sqlite3ExprType(Expr *p){
*/
static void codeInteger(Vdbe *v, const char *z, int n){
int i;
- if( sqlite3GetInt32(z, &i) || (i=0, sqlite3FitsIn64Bits(z))!=0 ){
- sqlite3VdbeOp3(v, OP_Integer, i, 0, z, n);
+ if( sqlite3GetInt32(z, &i) ){
+ sqlite3VdbeAddOp(v, OP_Integer, i, 0);
+ }else if( sqlite3FitsIn64Bits(z) ){
+ sqlite3VdbeOp3(v, OP_Integer, 0, 0, z, n);
}else{
sqlite3VdbeOp3(v, OP_Real, 0, 0, z, n);
}