1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-27 08:52:26 +03:00

Added database server example code (untested). Fixed serveral bugs including

the autovacuum compile problem described by ticket #1593. (CVS 2897)

FossilOrigin-Name: ec332d8822d1ac9673581a26ab2a2fce5f2554a3
This commit is contained in:
drh
2006-01-09 23:40:25 +00:00
parent 2366940d8f
commit 29c636bc12
14 changed files with 1193 additions and 58 deletions

View File

@@ -502,14 +502,9 @@ static int findLockInfo(
struct stat statbuf;
struct lockInfo *pLock;
struct openCnt *pOpen;
ThreadData *pTsd = sqlite3ThreadData();
rc = fstat(fd, &statbuf);
if( rc!=0 ) return 1;
/* Disable the sqlite3_release_memory() function */
assert( !pTsd->disableReleaseMemory );
pTsd->disableReleaseMemory = 1;
memset(&key1, 0, sizeof(key1));
key1.dev = statbuf.st_dev;
key1.ino = statbuf.st_ino;
@@ -573,8 +568,6 @@ static int findLockInfo(
*ppOpen = pOpen;
exit_findlockinfo:
/* Re-enable sqlite3_release_memory() */
pTsd->disableReleaseMemory = 0;
return rc;
}
@@ -1407,7 +1400,6 @@ static int unixUnlock(OsFile *id, int locktype){
** Close a file.
*/
static int unixClose(OsFile **pId){
ThreadData *pTsd = sqlite3ThreadData();
unixFile *id = (unixFile*)*pId;
if( !id ) return SQLITE_OK;
if( CHECK_THREADID(id) ) return SQLITE_MISUSE;
@@ -1416,10 +1408,6 @@ static int unixClose(OsFile **pId){
id->dirfd = -1;
sqlite3OsEnterMutex();
/* Disable the sqlite3_release_memory() function */
assert( !pTsd->disableReleaseMemory );
pTsd->disableReleaseMemory = 1;
if( id->pOpen->nLock ){
/* If there are outstanding locks, do not actually close the file just
** yet because that would clear those locks. Instead, add the file
@@ -1443,9 +1431,6 @@ static int unixClose(OsFile **pId){
releaseLockInfo(id->pLock);
releaseOpenCnt(id->pOpen);
/* Disable the sqlite3_release_memory() function */
pTsd->disableReleaseMemory = 0;
sqlite3OsLeaveMutex();
id->isOpen = 0;
TRACE2("CLOSE %-3d\n", id->h);
@@ -1636,9 +1621,6 @@ void sqlite3UnixLeaveMutex(){
/*
** Return TRUE if we are currently within the mutex and FALSE if not.
** This routine is intended for sanity checking only. It is designed
** for use in an assert() to verify that the mutex is held or not held
** in certain routines.
*/
int sqlite3UnixInMutex(){
return inMutex;