:-) (CVS 50)

FossilOrigin-Name: 1cf2873d55b471bb3e397f90dc0868dd88c440a0
diff --git a/src/main.c b/src/main.c
index 6fae4df..aeb75e3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -26,7 +26,7 @@
 ** other files are for internal use by SQLite and should not be
 ** accessed by users of the library.
 **
-** $Id: main.c,v 1.7 2000/06/02 14:27:23 drh Exp $
+** $Id: main.c,v 1.8 2000/06/05 02:07:04 drh Exp $
 */
 #include "sqliteInt.h"
 
@@ -46,7 +46,7 @@
   memset(&sParse, 0, sizeof(sParse));
   sParse.db = db;
   sParse.initFlag = 1;
-  nErr = sqliteRunParser(&sParse, argv[0], &zErrMsg);
+  nErr = sqliteRunParser(&sParse, argv[0], 0);
   return nErr;
 }
 
diff --git a/src/shell.c b/src/shell.c
index 81b2b5c..a188b4b 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -24,7 +24,7 @@
 ** This file contains code to implement the "sqlite" command line
 ** utility for accessing SQLite databases.
 **
-** $Id: shell.c,v 1.7 2000/06/04 12:58:38 drh Exp $
+** $Id: shell.c,v 1.8 2000/06/05 02:07:04 drh Exp $
 */
 #include <stdlib.h>
 #include <string.h>
@@ -456,7 +456,11 @@
   }
   db = sqlite_open(argv[1], 0666, &zErrMsg);
   if( db==0 ){
-    fprintf(stderr,"Unable to open database \"%s\": %s\n", argv[1], zErrMsg);
+    if( zErrMsg ){
+      fprintf(stderr,"Unable to open database \"%s\": %s\n", argv[1], zErrMsg);
+    }else{
+      fprintf(stderr,"Unable to open database %s\n", argv[1]);
+    }
     exit(1);
   }
   data.out = stdout;
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 45625a5..48f3895 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -23,7 +23,7 @@
 *************************************************************************
 ** Internal interface definitions for SQLite.
 **
-** @(#) $Id: sqliteInt.h,v 1.12 2000/06/04 12:58:38 drh Exp $
+** @(#) $Id: sqliteInt.h,v 1.13 2000/06/05 02:07:04 drh Exp $
 */
 #include "sqlite.h"
 #include "dbbe.h"
@@ -35,7 +35,7 @@
 #include <string.h>
 #include <assert.h>
 
-#define MEMORY_DEBUG 1
+/* #define MEMORY_DEBUG 1 */
 #ifdef MEMORY_DEBUG
 # define sqliteMalloc(X)    sqliteMalloc_(X,__FILE__,__LINE__)
 # define sqliteFree(X)      sqliteFree_(X,__FILE__,__LINE__)
diff --git a/src/vdbe.c b/src/vdbe.c
index 22eea0c..53a4e01 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -41,7 +41,7 @@
 ** But other routines are also provided to help in building up
 ** a program instruction by instruction.
 **
-** $Id: vdbe.c,v 1.13 2000/06/04 12:58:38 drh Exp $
+** $Id: vdbe.c,v 1.14 2000/06/05 02:07:04 drh Exp $
 */
 #include "sqliteInt.h"
 
@@ -671,6 +671,11 @@
 
   p->tos = -1;
   rc = SQLITE_OK;
+#ifdef MEMORY_DEBUG
+  if( access("vdbe_trace",0)==0 ){
+    p->trace = stderr;
+  }
+#endif
   if( pzErrMsg ){ *pzErrMsg = 0; }
   for(pc=0; rc==SQLITE_OK && pc<p->nOp && pc>=0; pc++){
     pOp = &p->aOp[pc];
@@ -1644,13 +1649,13 @@
         if( i>=0 && i<p->nTable && p->aTab[i].pTable!=0 ){
           char *zKey;
           int nKey;
-          if( (p->aStack[tos].flags & STK_Int)==0 ){
+          if( p->aStack[tos].flags & STK_Int ){
+            nKey = sizeof(int);
+            zKey = (char*)&p->aStack[tos].i;
+          }else{
             if( Stringify(p, tos) ) goto no_mem;
             nKey = p->aStack[tos].n;
             zKey = p->zStack[tos];
-          }else{
-            nKey = sizeof(int);
-            zKey = (char*)&p->aStack[tos].n;
           }
           sqliteDbbeDelete(p->aTab[i].pTable, nKey, zKey);
         }
@@ -1971,8 +1976,9 @@
         if( amt==1 ){
           p->tos++;
           if( NeedStack(p, p->tos) ) goto no_mem;
-          p->aStack[p->tos].n = val;
+          p->aStack[p->tos].i = val;
           p->aStack[p->tos].flags = STK_Int;
+          p->zStack[p->tos] = 0;
         }else{
           pc = pOp->p2 - 1;
         }