aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/btree.c18
-rw-r--r--src/sqliteInt.h4
-rw-r--r--src/test4.c14
-rw-r--r--src/test7.c16
4 files changed, 24 insertions, 28 deletions
diff --git a/src/btree.c b/src/btree.c
index 0dd2299e1..f92e32cc5 100644
--- a/src/btree.c
+++ b/src/btree.c
@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
-** $Id: btree.c,v 1.408 2007/08/22 02:56:43 drh Exp $
+** $Id: btree.c,v 1.409 2007/08/22 11:41:18 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
@@ -1372,13 +1372,10 @@ int sqlite3BtreeClose(Btree *p){
}
#ifndef SQLITE_OMIT_SHARED_CACHE
- else{
- assert( p->wantToLock==0 );
- assert( p->locked==0 );
- assert( p->sharable );
- if( p->pPrev ) p->pPrev->pNext = p->pNext;
- if( p->pNext ) p->pNext->pPrev = p->pPrev;
- }
+ assert( p->wantToLock==0 );
+ assert( p->locked==0 );
+ if( p->pPrev ) p->pPrev->pNext = p->pNext;
+ if( p->pNext ) p->pNext->pPrev = p->pPrev;
#endif
sqlite3_free(p);
@@ -1482,10 +1479,10 @@ void sqlite3BtreeLeave(Btree *p){
** Short-cuts for entering and leaving mutexes on a cursor.
*/
static void cursorLeave(BtCursor *p){
- sqlite3BtreeLeave(p->pBt);
+ sqlite3BtreeLeave(p->pBtree);
}
static void cursorEnter(BtCursor *pCur){
- sqlite3BtreeEnter(pCur->pBt);
+ sqlite3BtreeEnter(pCur->pBtree);
}
#else
# define cursorEnter(X)
@@ -3759,7 +3756,6 @@ static int btreeNext(BtCursor *pCur, int *pRes){
if( sqlite3BtreeIsRootPage(pPage) ){
*pRes = 1;
pCur->eState = CURSOR_INVALID;
- cursorLeave(pCur);
return SQLITE_OK;
}
sqlite3BtreeMoveToParent(pCur);
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 15702962d..4b6e01dec 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -11,7 +11,7 @@
*************************************************************************
** Internal interface definitions for SQLite.
**
-** @(#) $Id: sqliteInt.h,v 1.596 2007/08/22 11:22:04 danielk1977 Exp $
+** @(#) $Id: sqliteInt.h,v 1.597 2007/08/22 11:41:18 drh Exp $
*/
#ifndef _SQLITEINT_H_
#define _SQLITEINT_H_
@@ -42,7 +42,7 @@
#if defined(THREADSAFE)
# define SQLITE_THREADSAFE THREADSAFE
#else
-# define SQLTIE_THREADSAFE 1
+# define SQLITE_THREADSAFE 1
#endif
#endif
diff --git a/src/test4.c b/src/test4.c
index 57ea1bed6..4a47d2f86 100644
--- a/src/test4.c
+++ b/src/test4.c
@@ -11,7 +11,7 @@
*************************************************************************
** Code for testing the the SQLite library in a multithreaded environment.
**
-** $Id: test4.c,v 1.20 2007/08/21 10:44:16 drh Exp $
+** $Id: test4.c,v 1.21 2007/08/22 11:41:18 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
@@ -141,14 +141,14 @@ static int tcl_thread_create(
return TCL_ERROR;
}
threadset[i].busy = 1;
- sqliteFree(threadset[i].zFilename);
+ sqlite3_free(threadset[i].zFilename);
threadset[i].zFilename = sqlite3StrDup(argv[2]);
threadset[i].opnum = 1;
threadset[i].completed = 0;
rc = pthread_create(&x, 0, thread_main, &threadset[i]);
if( rc ){
Tcl_AppendResult(interp, "failed to create the thread", 0);
- sqliteFree(threadset[i].zFilename);
+ sqlite3_free(threadset[i].zFilename);
threadset[i].busy = 0;
return TCL_ERROR;
}
@@ -199,9 +199,9 @@ static void stop_thread(Thread *p){
p->xOp = 0;
p->opnum++;
thread_wait(p);
- sqliteFree(p->zArg);
+ sqlite3_free(p->zArg);
p->zArg = 0;
- sqliteFree(p->zFilename);
+ sqlite3_free(p->zFilename);
p->zFilename = 0;
p->busy = 0;
}
@@ -475,7 +475,7 @@ static int tcl_thread_compile(
}
thread_wait(&threadset[i]);
threadset[i].xOp = do_compile;
- sqliteFree(threadset[i].zArg);
+ sqlite3_free(threadset[i].zArg);
threadset[i].zArg = sqlite3StrDup(argv[2]);
threadset[i].opnum++;
return TCL_OK;
@@ -570,7 +570,7 @@ static int tcl_thread_finalize(
}
thread_wait(&threadset[i]);
threadset[i].xOp = do_finalize;
- sqliteFree(threadset[i].zArg);
+ sqlite3_free(threadset[i].zArg);
threadset[i].zArg = 0;
threadset[i].opnum++;
return TCL_OK;
diff --git a/src/test7.c b/src/test7.c
index 15ebce371..4f5982899 100644
--- a/src/test7.c
+++ b/src/test7.c
@@ -12,7 +12,7 @@
** Code for testing the client/server version of the SQLite library.
** Derived from test4.c.
**
-** $Id: test7.c,v 1.7 2007/08/21 10:44:16 drh Exp $
+** $Id: test7.c,v 1.8 2007/08/22 11:41:18 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
@@ -163,14 +163,14 @@ static int tcl_client_create(
return TCL_ERROR;
}
threadset[i].busy = 1;
- sqliteFree(threadset[i].zFilename);
+ sqlite3_free(threadset[i].zFilename);
threadset[i].zFilename = sqlite3StrDup(argv[2]);
threadset[i].opnum = 1;
threadset[i].completed = 0;
rc = pthread_create(&x, 0, client_main, &threadset[i]);
if( rc ){
Tcl_AppendResult(interp, "failed to create the thread", 0);
- sqliteFree(threadset[i].zFilename);
+ sqlite3_free(threadset[i].zFilename);
threadset[i].busy = 0;
return TCL_ERROR;
}
@@ -222,9 +222,9 @@ static void stop_thread(Thread *p){
p->xOp = 0;
p->opnum++;
client_wait(p);
- sqliteFree(p->zArg);
+ sqlite3_free(p->zArg);
p->zArg = 0;
- sqliteFree(p->zFilename);
+ sqlite3_free(p->zFilename);
p->zFilename = 0;
p->busy = 0;
}
@@ -506,7 +506,7 @@ static int tcl_client_compile(
}
client_wait(&threadset[i]);
threadset[i].xOp = do_compile;
- sqliteFree(threadset[i].zArg);
+ sqlite3_free(threadset[i].zArg);
threadset[i].zArg = sqlite3StrDup(argv[2]);
threadset[i].opnum++;
return TCL_OK;
@@ -601,7 +601,7 @@ static int tcl_client_finalize(
}
client_wait(&threadset[i]);
threadset[i].xOp = do_finalize;
- sqliteFree(threadset[i].zArg);
+ sqlite3_free(threadset[i].zArg);
threadset[i].zArg = 0;
threadset[i].opnum++;
return TCL_OK;
@@ -645,7 +645,7 @@ static int tcl_client_reset(
}
client_wait(&threadset[i]);
threadset[i].xOp = do_reset;
- sqliteFree(threadset[i].zArg);
+ sqlite3_free(threadset[i].zArg);
threadset[i].zArg = 0;
threadset[i].opnum++;
return TCL_OK;