aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-02-19 00:29:11 +0000
committerdrh <drh@noemail.net>2015-02-19 00:29:11 +0000
commit883ad04985496dfeb54135a23066cf9fb0b9a1e3 (patch)
tree7ab7d75fb8a39a0afcbc581a939f8c6f796a4b26 /src
parent96c707a3c285141f3f5764422bdce7a01aaa319f (diff)
downloadsqlite-883ad04985496dfeb54135a23066cf9fb0b9a1e3.tar.gz
sqlite-883ad04985496dfeb54135a23066cf9fb0b9a1e3.zip
First small steps toward brining trunk and apple-osx closer together.
FossilOrigin-Name: 28284ccc0d7301503f6d2d7bee9093738d52e331
Diffstat (limited to 'src')
-rw-r--r--src/func.c8
-rw-r--r--src/main.c5
-rw-r--r--src/sqlite.h.in17
-rw-r--r--src/test_backup.c2
-rw-r--r--src/test_demovfs.c2
-rw-r--r--src/test_rtree.c2
-rw-r--r--src/test_superlock.c2
7 files changed, 30 insertions, 8 deletions
diff --git a/src/func.c b/src/func.c
index a05799341..30990a30f 100644
--- a/src/func.c
+++ b/src/func.c
@@ -291,6 +291,14 @@ static void substrFunc(
}
}
}
+#ifdef SQLITE_SUBSTR_COMPATIBILITY
+ /* If SUBSTR_COMPATIBILITY is defined then substr(X,0,N) work the same as
+ ** as substr(X,1,N) - it returns the first N characters of X. This
+ ** is essentially a back-out of the bug-fix in check-in [5fc125d362df4b8]
+ ** from 2009-02-02 for compatibility of applications that exploited the
+ ** old buggy behavior. */
+ if( p1==0 ) p1 = 1; /* <rdar://problem/6778339> */
+#endif
if( argc==3 ){
p2 = sqlite3_value_int(argv[2]);
if( p2<0 ){
diff --git a/src/main.c b/src/main.c
index d0bd55c1d..371bb1fed 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2707,6 +2707,9 @@ static int openDatabase(
#if !defined(SQLITE_DEFAULT_AUTOMATIC_INDEX) || SQLITE_DEFAULT_AUTOMATIC_INDEX
| SQLITE_AutoIndex
#endif
+#if SQLITE_DEFAULT_CKPTFULLFSYNC
+ | SQLITE_CkptFullFSync
+#endif
#if SQLITE_DEFAULT_FILE_FORMAT<4
| SQLITE_LegacyFileFmt
#endif
@@ -3301,7 +3304,7 @@ int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
sqlite3BtreeLeave(pBtree);
}
sqlite3_mutex_leave(db->mutex);
- return rc;
+ return rc;
}
/*
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index f256cea45..8a358dbb2 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -944,9 +944,9 @@ struct sqlite3_io_methods {
** </ul>
*/
#define SQLITE_FCNTL_LOCKSTATE 1
-#define SQLITE_GET_LOCKPROXYFILE 2
-#define SQLITE_SET_LOCKPROXYFILE 3
-#define SQLITE_LAST_ERRNO 4
+#define SQLITE_FCNTL_GET_LOCKPROXYFILE 2
+#define SQLITE_FCNTL_SET_LOCKPROXYFILE 3
+#define SQLITE_FCNTL_LAST_ERRNO 4
#define SQLITE_FCNTL_SIZE_HINT 5
#define SQLITE_FCNTL_CHUNK_SIZE 6
#define SQLITE_FCNTL_FILE_POINTER 7
@@ -966,6 +966,12 @@ struct sqlite3_io_methods {
#define SQLITE_FCNTL_COMMIT_PHASETWO 22
#define SQLITE_FCNTL_WIN32_SET_HANDLE 23
+/* deprecated names */
+#define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
+#define SQLITE_SET_LOCKPROXYFILE SQLITE_FCNTL_SET_LOCKPROXYFILE
+#define SQLITE_LAST_ERRNO SQLITE_FCNTL_LAST_ERRNO
+
+
/*
** CAPI3REF: Mutex Handle
**
@@ -5061,6 +5067,11 @@ void *sqlite3_update_hook(
** future releases of SQLite. Applications that care about shared
** cache setting should set it explicitly.
**
+** Note: This method is disabled on MacOS X 10.7 and iOS version 5.0
+** and will always return SQLITE_MISUSE. On those systems,
+** shared cache mode should be enabled per-database connection via
+** [sqlite3_open_v2()] with [SQLITE_OPEN_SHAREDCACHE].
+**
** This interface is threadsafe on processors where writing a
** 32-bit integer is atomic.
**
diff --git a/src/test_backup.c b/src/test_backup.c
index e967424a2..6b4d6b9b1 100644
--- a/src/test_backup.c
+++ b/src/test_backup.c
@@ -14,7 +14,7 @@
*/
#include "tcl.h"
-#include <sqlite3.h>
+#include "sqlite3.h"
#include <assert.h>
/* These functions are implemented in main.c. */
diff --git a/src/test_demovfs.c b/src/test_demovfs.c
index c63b0a8b7..9410a309a 100644
--- a/src/test_demovfs.c
+++ b/src/test_demovfs.c
@@ -115,7 +115,7 @@
#if !defined(SQLITE_TEST) || SQLITE_OS_UNIX
-#include <sqlite3.h>
+#include "sqlite3.h"
#include <assert.h>
#include <string.h>
diff --git a/src/test_rtree.c b/src/test_rtree.c
index 9d19fa0e2..7beec6645 100644
--- a/src/test_rtree.c
+++ b/src/test_rtree.c
@@ -13,7 +13,7 @@
** is not included in the SQLite library.
*/
-#include <sqlite3.h>
+#include "sqlite3.h"
#include <tcl.h>
/* Solely for the UNUSED_PARAMETER() macro. */
diff --git a/src/test_superlock.c b/src/test_superlock.c
index 936fcad0c..cac789842 100644
--- a/src/test_superlock.c
+++ b/src/test_superlock.c
@@ -18,7 +18,7 @@
** sqlite3demo_superunlock()
*/
-#include <sqlite3.h>
+#include "sqlite3.h"
#include <string.h> /* memset(), strlen() */
#include <assert.h> /* assert() */