Change prototype for busy callbacks to "int xBusy(void *, int);" (CVS 1573)

FossilOrigin-Name: 4f1cfca5ca703d0068cf8d6222dc8e0cfb7e24b6
diff --git a/src/main.c b/src/main.c
index 17fdb93..f031de5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -14,7 +14,7 @@
 ** other files are for internal use by SQLite and should not be
 ** accessed by users of the library.
 **
-** $Id: main.c,v 1.216 2004/06/12 00:42:35 danielk1977 Exp $
+** $Id: main.c,v 1.217 2004/06/12 01:43:26 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 #include "os.h"
@@ -608,7 +608,7 @@
 */
 void sqlite3_busy_handler(
   sqlite *db,
-  int (*xBusy)(void*,const char*,int),
+  int (*xBusy)(void*,int),
   void *pArg
 ){
   db->busyHandler.xFunc = xBusy;
diff --git a/src/pager.c b/src/pager.c
index 0c28b8f..add2e80 100644
--- a/src/pager.c
+++ b/src/pager.c
@@ -18,7 +18,7 @@
 ** file simultaneously, or one process from reading the database while
 ** another is writing.
 **
-** @(#) $Id: pager.c,v 1.123 2004/06/10 23:35:50 drh Exp $
+** @(#) $Id: pager.c,v 1.124 2004/06/12 01:43:26 danielk1977 Exp $
 */
 #include "os.h"         /* Must be first to enable large file support */
 #include "sqliteInt.h"
@@ -1555,7 +1555,7 @@
   }while( rc==SQLITE_BUSY && 
       pPager->pBusyHandler && 
       pPager->pBusyHandler->xFunc && 
-      pPager->pBusyHandler->xFunc(pPager->pBusyHandler->pArg, "", busy++)
+      pPager->pBusyHandler->xFunc(pPager->pBusyHandler->pArg, busy++)
   );
   if( rc!=SQLITE_OK ){
     return rc;
@@ -1639,7 +1639,7 @@
     }while( rc==SQLITE_BUSY && 
         pPager->pBusyHandler && 
         pPager->pBusyHandler->xFunc && 
-        pPager->pBusyHandler->xFunc(pPager->pBusyHandler->pArg, "", busy++)
+        pPager->pBusyHandler->xFunc(pPager->pBusyHandler->pArg, busy++)
     );
     if( rc!=SQLITE_OK ){
       return rc;
@@ -2030,7 +2030,7 @@
       }while( rc==SQLITE_BUSY && 
           pPager->pBusyHandler && 
           pPager->pBusyHandler->xFunc && 
-          pPager->pBusyHandler->xFunc(pPager->pBusyHandler->pArg, "", busy++)
+          pPager->pBusyHandler->xFunc(pPager->pBusyHandler->pArg, busy++)
       );
       if( rc!=SQLITE_OK ){
         return rc;
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index c95d938..9c0eec4 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -12,7 +12,7 @@
 ** This header file defines the interface that the SQLite library
 ** presents to client programs.
 **
-** @(#) $Id: sqlite.h.in,v 1.99 2004/06/12 00:42:35 danielk1977 Exp $
+** @(#) $Id: sqlite.h.in,v 1.100 2004/06/12 01:43:27 danielk1977 Exp $
 */
 #ifndef _SQLITE_H_
 #define _SQLITE_H_
@@ -242,7 +242,7 @@
 ** data structures out from under the executing query and will 
 ** probably result in a coredump.
 */
-void sqlite3_busy_handler(sqlite*, int(*)(void*,const char*,int), void*);
+void sqlite3_busy_handler(sqlite*, int(*)(void*,int), void*);
 
 /*
 ** This routine sets a busy handler that sleeps for a while when a
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 7cf1a4b..e69fe56 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -11,7 +11,7 @@
 *************************************************************************
 ** Internal interface definitions for SQLite.
 **
-** @(#) $Id: sqliteInt.h,v 1.283 2004/06/12 00:42:35 danielk1977 Exp $
+** @(#) $Id: sqliteInt.h,v 1.284 2004/06/12 01:43:27 danielk1977 Exp $
 */
 #include "config.h"
 #include "sqlite3.h"
@@ -342,8 +342,8 @@
 ** callback is currently invoked only from within pager.c.
 */
 struct BusyHandler {
-  int (*xFunc)(void *,const char*,int);  /* The busy callback */
-  void *pArg;                            /* First arg to busy callback */
+  int (*xFunc)(void *,int);  /* The busy callback */
+  void *pArg;                /* First arg to busy callback */
 };
 
 /*
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index af4131a..c0b751a 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -11,7 +11,7 @@
 *************************************************************************
 ** A TCL Interface to SQLite
 **
-** $Id: tclsqlite.c,v 1.83 2004/06/10 10:50:38 danielk1977 Exp $
+** $Id: tclsqlite.c,v 1.84 2004/06/12 01:43:27 danielk1977 Exp $
 */
 #ifndef NO_TCL     /* Omit this whole file if TCL is unavailable */
 
@@ -149,7 +149,7 @@
 ** This routine is called when a database file is locked while trying
 ** to execute SQL.
 */
-static int DbBusyHandler(void *cd, const char *zTable, int nTries){
+static int DbBusyHandler(void *cd, int nTries){
   SqliteDb *pDb = (SqliteDb*)cd;
   int rc;
   char zVal[30];
@@ -158,9 +158,8 @@
 
   Tcl_DStringInit(&cmd);
   Tcl_DStringAppend(&cmd, pDb->zBusy, -1);
-  Tcl_DStringAppendElement(&cmd, zTable);
-  sprintf(zVal, " %d", nTries);
-  Tcl_DStringAppend(&cmd, zVal, -1);
+  sprintf(zVal, "%d", nTries);
+  Tcl_DStringAppendElement(&cmd, zVal);
   zCmd = Tcl_DStringValue(&cmd);
   rc = Tcl_Eval(pDb->interp, zCmd);
   Tcl_DStringFree(&cmd);
diff --git a/src/vdbe.c b/src/vdbe.c
index 57ea492..3736ebb 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -43,7 +43,7 @@
 ** in this file for details.  If in doubt, do not deviate from existing
 ** commenting and indentation practices when changing or adding code.
 **
-** $Id: vdbe.c,v 1.366 2004/06/12 00:42:35 danielk1977 Exp $
+** $Id: vdbe.c,v 1.367 2004/06/12 01:43:27 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 #include "os.h"
@@ -2378,16 +2378,12 @@
     }
     rc = sqlite3BtreeBeginTrans(pBt, pOp->p2, db->nMaster);
     if( rc==SQLITE_BUSY ){
-        if( db->busyHandler.xFunc==0 ){
-          p->pc = pc;
-          p->rc = SQLITE_BUSY;
-          p->pTos = pTos;
-          return SQLITE_BUSY;
-        }else{
-          sqlite3SetString(&p->zErrMsg, sqlite3ErrStr(rc), (char*)0);
-        }
+      p->pc = pc;
+      p->rc = SQLITE_BUSY;
+      p->pTos = pTos;
+      return SQLITE_BUSY;
     }
-    if( rc!=SQLITE_OK && rc!=SQLITE_READONLY && rc!=SQLITE_BUSY ){
+    if( rc!=SQLITE_OK && rc!=SQLITE_READONLY /* && rc!=SQLITE_BUSY */ ){
       goto abort_due_to_error;
     }
   }
@@ -2565,15 +2561,10 @@
   }
   switch( rc ){
     case SQLITE_BUSY: {
-      if( db->busyHandler.xFunc ){
-        p->pc = pc;
-        p->rc = SQLITE_BUSY;
-        p->pTos = &pTos[1 + (pOp->p2<=0)]; /* Operands must remain on stack */
-        return SQLITE_BUSY;
-      }else{
-        sqlite3SetString(&p->zErrMsg, sqlite3ErrStr(rc), (char*)0);
-      }
-      break;
+      p->pc = pc;
+      p->rc = SQLITE_BUSY;
+      p->pTos = &pTos[1 + (pOp->p2<=0)]; /* Operands must remain on stack */
+      return SQLITE_BUSY;
     }
     case SQLITE_OK: {
       int flags = sqlite3BtreeFlags(pCur->pCursor);