aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/btree.c4
-rw-r--r--src/date.c6
-rw-r--r--src/test3.c4
-rw-r--r--src/test7.c7
-rw-r--r--src/test_server.c5
-rw-r--r--src/utf.c62
6 files changed, 48 insertions, 40 deletions
diff --git a/src/btree.c b/src/btree.c
index 488503ff5..4c38882ea 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.425 2007/09/07 14:32:07 drh Exp $
+** $Id: btree.c,v 1.426 2007/09/12 17:01:45 danielk1977 Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
@@ -6166,11 +6166,13 @@ int sqlite3BtreeUpdateMeta(Btree *p, int idx, u32 iMeta){
rc = sqlite3PagerWrite(pBt->pPage1->pDbPage);
if( rc==SQLITE_OK ){
put4byte(&pP1[36 + idx*4], iMeta);
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( idx==7 ){
assert( pBt->autoVacuum || iMeta==0 );
assert( iMeta==0 || iMeta==1 );
pBt->incrVacuum = iMeta;
}
+#endif
}
}
sqlite3BtreeLeave(p);
diff --git a/src/date.c b/src/date.c
index 50f5f4a83..ce1c6c7b3 100644
--- a/src/date.c
+++ b/src/date.c
@@ -16,7 +16,7 @@
** sqlite3RegisterDateTimeFunctions() found at the bottom of the file.
** All other code has file scope.
**
-** $Id: date.c,v 1.72 2007/08/24 03:51:33 drh Exp $
+** $Id: date.c,v 1.73 2007/09/12 17:01:45 danielk1977 Exp $
**
** SQLite processes all times and dates as Julian Day numbers. The
** dates and times are stored as the number of days since noon
@@ -988,10 +988,10 @@ static void currentTimeFunc(
#else
{
struct tm *pTm;
- sqlite3_mutex_enter(sqlite3_mutex_alloc(SQLITE_MUTEX_GLOBAL));
+ sqlite3_mutex_enter(sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MASTER));
pTm = gmtime(&t);
strftime(zBuf, 20, zFormat, pTm);
- sqlite3_mutex_leave(sqlite3_mutex_alloc(SQLITE_MUTEX_GLOBAL));
+ sqlite3_mutex_leave(sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MASTER));
}
#endif
diff --git a/src/test3.c b/src/test3.c
index a62cb8a0f..4f1433052 100644
--- a/src/test3.c
+++ b/src/test3.c
@@ -13,7 +13,7 @@
** is not included in the SQLite library. It is used for automated
** testing of the SQLite library.
**
-** $Id: test3.c,v 1.86 2007/09/03 15:19:36 drh Exp $
+** $Id: test3.c,v 1.87 2007/09/12 17:01:45 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "btreeInt.h"
@@ -1398,7 +1398,7 @@ static int btree_ovfl_info(
sqlite3BtreeLeave(pBt);
return TCL_ERROR;
}
- dataSize = sqlite3BtreeGetPageSize(pBt) - sqlite3BtreeGetReserve(pBt);
+ dataSize = pBt->pBt->usableSize;
Tcl_DStringInit(&str);
n = aResult[6] - aResult[8];
n = (n + dataSize - 1)/dataSize;
diff --git a/src/test7.c b/src/test7.c
index 4f5982899..8e2153a1c 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.8 2007/08/22 11:41:18 drh Exp $
+** $Id: test7.c,v 1.9 2007/09/12 17:01:45 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
@@ -21,8 +21,8 @@
** This test only works on UNIX with a SQLITE_THREADSAFE build that includes
** the SQLITE_SERVER option.
*/
-#if OS_UNIX && SQLITE_THREADSAFE && \
- defined(SQLITE_SERVER) && !defined(SQLITE_OMIT_SHARED_CACHE)
+#if defined(SQLITE_SERVER) && !defined(SQLITE_OMIT_SHARED_CACHE)
+#if defined(OS_UNIX) && OS_UNIX && SQLITE_THREADSAFE
#include <stdlib.h>
#include <string.h>
@@ -721,3 +721,4 @@ int Sqlitetest7_Init(Tcl_Interp *interp){
#else
int Sqlitetest7_Init(Tcl_Interp *interp){ return TCL_OK; }
#endif /* OS_UNIX */
+#endif
diff --git a/src/test_server.c b/src/test_server.c
index deb14aa4e..624249fc1 100644
--- a/src/test_server.c
+++ b/src/test_server.c
@@ -196,6 +196,11 @@
** an integer.
*/
+/* Include this to get the definition of SQLITE_THREADSAFE, in the
+** case that default values are used.
+*/
+#include "sqliteInt.h"
+
/*
** Only compile the code in this file on UNIX with a SQLITE_THREADSAFE build
** and only if the SQLITE_SERVER macro is defined.
diff --git a/src/utf.c b/src/utf.c
index 3170c09ff..4b444afa8 100644
--- a/src/utf.c
+++ b/src/utf.c
@@ -12,7 +12,7 @@
** This file contains routines used to translate between UTF-8,
** UTF-16, UTF-16BE, and UTF-16LE.
**
-** $Id: utf.c,v 1.57 2007/09/01 11:04:27 danielk1977 Exp $
+** $Id: utf.c,v 1.58 2007/09/12 17:01:45 danielk1977 Exp $
**
** Notes on UTF-8:
**
@@ -403,6 +403,36 @@ int sqlite3Utf8CharLen(const char *zIn, int nByte){
return r;
}
+/* This test function is not currently used by the automated test-suite.
+** Hence it is only available in debug builds.
+*/
+#if defined(SQLITE_TEST) && defined(SQLITE_DEBUG)
+/*
+** Translate UTF-8 to UTF-8.
+**
+** This has the effect of making sure that the string is well-formed
+** UTF-8. Miscoded characters are removed.
+**
+** The translation is done in-place (since it is impossible for the
+** correct UTF-8 encoding to be longer than a malformed encoding).
+*/
+int sqlite3Utf8To8(unsigned char *zIn){
+ unsigned char *zOut = zIn;
+ unsigned char *zStart = zIn;
+ unsigned char *zTerm;
+ u32 c;
+
+ while( zIn[0] ){
+ c = sqlite3Utf8Read(zIn, zTerm, (const u8**)&zIn);
+ if( c!=0xfffd ){
+ WRITE_UTF8(zOut, c);
+ }
+ }
+ *zOut = 0;
+ return zOut - zStart;
+}
+#endif
+
#ifndef SQLITE_OMIT_UTF16
/*
** Convert a UTF-16 string in the native encoding into a UTF-8 string.
@@ -456,36 +486,6 @@ int sqlite3Utf16ByteLen(const void *zIn, int nChar){
return (z-(char const *)zIn)-((c==0)?2:0);
}
-/* This test function is not currently used by the automated test-suite.
-** Hence it is only available in debug builds.
-*/
-#if defined(SQLITE_TEST) && defined(SQLITE_DEBUG)
-/*
-** Translate UTF-8 to UTF-8.
-**
-** This has the effect of making sure that the string is well-formed
-** UTF-8. Miscoded characters are removed.
-**
-** The translation is done in-place (since it is impossible for the
-** correct UTF-8 encoding to be longer than a malformed encoding).
-*/
-int sqlite3Utf8To8(unsigned char *zIn){
- unsigned char *zOut = zIn;
- unsigned char *zStart = zIn;
- unsigned char *zTerm;
- u32 c;
-
- while( zIn[0] ){
- c = sqlite3Utf8Read(zIn, zTerm, (const u8**)&zIn);
- if( c!=0xfffd ){
- WRITE_UTF8(zOut, c);
- }
- }
- *zOut = 0;
- return zOut - zStart;
-}
-#endif
-
#if defined(SQLITE_TEST)
/*
** This routine is called from the TCL test function "translate_selftest".