summaryrefslogtreecommitdiff
path: root/build_android
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2015-02-17 17:25:57 +0000
committer <>2015-03-17 16:26:24 +0000
commit780b92ada9afcf1d58085a83a0b9e6bc982203d1 (patch)
tree598f8b9fa431b228d29897e798de4ac0c1d3d970 /build_android
parent7a2660ba9cc2dc03a69ddfcfd95369395cc87444 (diff)
downloadberkeleydb-master.tar.gz
Imported from /home/lorry/working-area/delta_berkeleydb/db-6.1.23.tar.gz.HEADdb-6.1.23master
Diffstat (limited to 'build_android')
-rw-r--r--build_android/Android.mk378
-rw-r--r--build_android/db.h370
-rw-r--r--build_android/db_config.h40
-rw-r--r--build_android/db_int.h140
-rw-r--r--build_android/jdbc/jni/Android.mk419
-rw-r--r--build_android/sql/config.h4
6 files changed, 1164 insertions, 187 deletions
diff --git a/build_android/Android.mk b/build_android/Android.mk
index c386e072..d8d5541a 100644
--- a/build_android/Android.mk
+++ b/build_android/Android.mk
@@ -1,6 +1,6 @@
# DO NOT EDIT: automatically built by dist/s_android.
# Makefile for building a drop-in replacement of SQLite using
-# Berkeley DB 11g Release 2, library version 11.2.5.3.21: (May 11, 2012)
+# Berkeley DB 12c Release 1, library version 12.1.6.1.23: (February 17, 2015)
###################################################################
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
@@ -10,7 +10,7 @@ include $(CLEAR_VARS)
LOCAL_MODULE := libsqlite
# BDB_TOP will change with release numbers
-BDB_TOP := db-5.3.21
+BDB_TOP := db-6.1.23
BDB_PATH := $(LOCAL_PATH)/$(BDB_TOP)/src
# This directive results in arm (vs thumb) code. It's necessary to
@@ -26,6 +26,10 @@ LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(BDB_TOP)/build_android/sql
# Source files
LOCAL_SRC_FILES := \
+ $(BDB_TOP)/src/blob/blob_fileops.c \
+ $(BDB_TOP)/src/blob/blob_page.c \
+ $(BDB_TOP)/src/blob/blob_stream.c \
+ $(BDB_TOP)/src/blob/blob_util.c \
$(BDB_TOP)/src/btree/bt_compact.c \
$(BDB_TOP)/src/btree/bt_compare.c \
$(BDB_TOP)/src/btree/bt_compress.c \
@@ -48,7 +52,6 @@ LOCAL_SRC_FILES := \
$(BDB_TOP)/src/clib/rand.c \
$(BDB_TOP)/src/clib/snprintf.c \
$(BDB_TOP)/src/common/clock.c \
- $(BDB_TOP)/src/common/crypto_stub.c \
$(BDB_TOP)/src/common/db_byteorder.c \
$(BDB_TOP)/src/common/db_compint.c \
$(BDB_TOP)/src/common/db_err.c \
@@ -184,6 +187,7 @@ LOCAL_SRC_FILES := \
$(BDB_TOP)/src/os/os_path.c \
$(BDB_TOP)/src/os/os_pid.c \
$(BDB_TOP)/src/os/os_rename.c \
+ $(BDB_TOP)/src/os/os_rmdir.c \
$(BDB_TOP)/src/os/os_root.c \
$(BDB_TOP)/src/os/os_rpath.c \
$(BDB_TOP)/src/os/os_rw.c \
@@ -210,6 +214,7 @@ LOCAL_SRC_FILES := \
$(BDB_TOP)/src/txn/txn_region.c \
$(BDB_TOP)/src/txn/txn_stat.c \
$(BDB_TOP)/src/txn/txn_util.c \
+ $(BDB_TOP)/src/common/crypto_stub.c \
$(BDB_TOP)/lang/sql/generated/sqlite3.c
ifneq ($(TARGET_ARCH),arm)
@@ -278,3 +283,370 @@ LOCAL_MODULE := sqlite3
include $(BUILD_EXECUTABLE)
endif # !SDK_ONLY
+################################################################################
+##device commande line tool:db_archive
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_archive
+include $(CLEAR_VARS)
+
+LOCAL_ARM_MODE := arm
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_archive.c \
+ $(BDB_TOP)/src/common/util_sig.c
+LOCAL_SHARED_LIBRARIES := libsqlite
+LOCAL_C_INCLUDES := $(BDB_PATH) $(LOCAL_PATH)/$(BDB_TOP)/build_android\
+ $(LOCAL_PATH)/$(BDB_TOP)/lang/sql/generated $(LOCAL_PATH)/../android
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_CFLAGS += -DHAVE_USLEEP=1 -DTHREADSAFE=1 -DNDEBUG=1
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+LOCAL_MODULE := db_archive
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+################################################################################
+##device commande line tool:db_checkpoint
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_checkpoint
+include $(CLEAR_VARS)
+
+LOCAL_ARM_MODE := arm
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_checkpoint.c \
+ $(BDB_TOP)/src/common/util_log.c \
+ $(BDB_TOP)/src/common/util_sig.c
+LOCAL_SHARED_LIBRARIES := libsqlite
+LOCAL_C_INCLUDES := $(BDB_PATH) $(LOCAL_PATH)/$(BDB_TOP)/build_android\
+ $(LOCAL_PATH)/$(BDB_TOP)/lang/sql/generated $(LOCAL_PATH)/../android
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_CFLAGS += -DHAVE_USLEEP=1 -DTHREADSAFE=1 -DNDEBUG=1
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+LOCAL_MODULE := db_checkpoint
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+################################################################################
+##device commande line tool:db_deadlock
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_deadlock
+include $(CLEAR_VARS)
+
+LOCAL_ARM_MODE := arm
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_deadlock.c \
+ $(BDB_TOP)/src/common/util_log.c \
+ $(BDB_TOP)/src/common/util_sig.c
+LOCAL_SHARED_LIBRARIES := libsqlite
+LOCAL_C_INCLUDES := $(BDB_PATH) $(LOCAL_PATH)/$(BDB_TOP)/build_android\
+ $(LOCAL_PATH)/$(BDB_TOP)/lang/sql/generated $(LOCAL_PATH)/../android
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_CFLAGS += -DHAVE_USLEEP=1 -DTHREADSAFE=1 -DNDEBUG=1
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+LOCAL_MODULE := db_deadlock
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+################################################################################
+##device commande line tool:db_dump
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_dump
+include $(CLEAR_VARS)
+
+LOCAL_ARM_MODE := arm
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_dump.c \
+ $(BDB_TOP)/src/common/util_cache.c \
+ $(BDB_TOP)/src/common/util_sig.c
+LOCAL_SHARED_LIBRARIES := libsqlite
+LOCAL_C_INCLUDES := $(BDB_PATH) $(LOCAL_PATH)/$(BDB_TOP)/build_android\
+ $(LOCAL_PATH)/$(BDB_TOP)/lang/sql/generated $(LOCAL_PATH)/../android
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_CFLAGS += -DHAVE_USLEEP=1 -DTHREADSAFE=1 -DNDEBUG=1
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+LOCAL_MODULE := db_dump
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+################################################################################
+##device commande line tool:db_hotbackup
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_hotbackup
+include $(CLEAR_VARS)
+
+LOCAL_ARM_MODE := arm
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_hotbackup.c \
+ $(BDB_TOP)/src/common/util_sig.c
+LOCAL_SHARED_LIBRARIES := libsqlite
+LOCAL_C_INCLUDES := $(BDB_PATH) $(LOCAL_PATH)/$(BDB_TOP)/build_android\
+ $(LOCAL_PATH)/$(BDB_TOP)/lang/sql/generated $(LOCAL_PATH)/../android
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_CFLAGS += -DHAVE_USLEEP=1 -DTHREADSAFE=1 -DNDEBUG=1
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+LOCAL_MODULE := db_hotbackup
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+################################################################################
+##device commande line tool:db_load
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_load
+include $(CLEAR_VARS)
+
+LOCAL_ARM_MODE := arm
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_load.c \
+ $(BDB_TOP)/src/common/util_cache.c \
+ $(BDB_TOP)/src/common/util_sig.c
+LOCAL_SHARED_LIBRARIES := libsqlite
+LOCAL_C_INCLUDES := $(BDB_PATH) $(LOCAL_PATH)/$(BDB_TOP)/build_android\
+ $(LOCAL_PATH)/$(BDB_TOP)/lang/sql/generated $(LOCAL_PATH)/../android
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_CFLAGS += -DHAVE_USLEEP=1 -DTHREADSAFE=1 -DNDEBUG=1
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+LOCAL_MODULE := db_load
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+################################################################################
+##device commande line tool:db_printlog
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_printlog
+include $(CLEAR_VARS)
+
+LOCAL_ARM_MODE := arm
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_printlog.c \
+ $(BDB_TOP)/src/common/util_sig.c \
+ $(BDB_TOP)/src/btree/btree_autop.c \
+ $(BDB_TOP)/src/db/crdel_autop.c \
+ $(BDB_TOP)/src/db/db_autop.c \
+ $(BDB_TOP)/src/dbreg/dbreg_autop.c \
+ $(BDB_TOP)/src/fileops/fileops_autop.c \
+ $(BDB_TOP)/src/hash/hash_autop.c \
+ $(BDB_TOP)/src/heap/heap_autop.c \
+ $(BDB_TOP)/src/qam/qam_autop.c \
+ $(BDB_TOP)/src/repmgr/repmgr_autop.c \
+ $(BDB_TOP)/src/txn/txn_autop.c
+
+LOCAL_SHARED_LIBRARIES := libsqlite
+LOCAL_C_INCLUDES := $(BDB_PATH) $(LOCAL_PATH)/$(BDB_TOP)/build_android\
+ $(LOCAL_PATH)/$(BDB_TOP)/lang/sql/generated $(LOCAL_PATH)/../android
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_CFLAGS += -DHAVE_USLEEP=1 -DTHREADSAFE=1 -DNDEBUG=1
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+LOCAL_MODULE := db_printlog
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+################################################################################
+##device commande line tool:db_recover
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_recover
+include $(CLEAR_VARS)
+
+LOCAL_ARM_MODE := arm
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_recover.c \
+ $(BDB_TOP)/src/common/util_sig.c
+LOCAL_SHARED_LIBRARIES := libsqlite
+LOCAL_C_INCLUDES := $(BDB_PATH) $(LOCAL_PATH)/$(BDB_TOP)/build_android\
+ $(LOCAL_PATH)/$(BDB_TOP)/lang/sql/generated $(LOCAL_PATH)/../android
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_CFLAGS += -DHAVE_USLEEP=1 -DTHREADSAFE=1 -DNDEBUG=1
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+LOCAL_MODULE := db_recover
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+################################################################################
+##device commande line tool:db_replicate
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_replicate
+include $(CLEAR_VARS)
+
+LOCAL_ARM_MODE := arm
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_replicate.c \
+ $(BDB_TOP)/src/common/util_sig.c
+LOCAL_SHARED_LIBRARIES := libsqlite
+LOCAL_C_INCLUDES := $(BDB_PATH) $(LOCAL_PATH)/$(BDB_TOP)/build_android\
+ $(LOCAL_PATH)/$(BDB_TOP)/lang/sql/generated $(LOCAL_PATH)/../android
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_CFLAGS += -DHAVE_USLEEP=1 -DTHREADSAFE=1 -DNDEBUG=1
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+LOCAL_MODULE := db_replicate
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+################################################################################
+##device commande line tool:db_stat
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_stat
+include $(CLEAR_VARS)
+
+LOCAL_ARM_MODE := arm
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_stat.c \
+ $(BDB_TOP)/src/common/util_cache.c \
+ $(BDB_TOP)/src/common/util_sig.c
+LOCAL_SHARED_LIBRARIES := libsqlite
+LOCAL_C_INCLUDES := $(BDB_PATH) $(LOCAL_PATH)/$(BDB_TOP)/build_android\
+ $(LOCAL_PATH)/$(BDB_TOP)/lang/sql/generated $(LOCAL_PATH)/../android
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_CFLAGS += -DHAVE_USLEEP=1 -DTHREADSAFE=1 -DNDEBUG=1
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+LOCAL_MODULE := db_stat
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+################################################################################
+##device commande line tool:db_tuner
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_tuner
+include $(CLEAR_VARS)
+
+LOCAL_ARM_MODE := arm
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_tuner.c \
+ $(BDB_TOP)/src/common/util_sig.c
+LOCAL_SHARED_LIBRARIES := libsqlite
+LOCAL_C_INCLUDES := $(BDB_PATH) $(LOCAL_PATH)/$(BDB_TOP)/build_android\
+ $(LOCAL_PATH)/$(BDB_TOP)/lang/sql/generated $(LOCAL_PATH)/../android
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_CFLAGS += -DHAVE_USLEEP=1 -DTHREADSAFE=1 -DNDEBUG=1
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+LOCAL_MODULE := db_tuner
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+################################################################################
+##device commande line tool:db_upgrade
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_upgrade
+include $(CLEAR_VARS)
+
+LOCAL_ARM_MODE := arm
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_upgrade.c \
+ $(BDB_TOP)/src/common/util_sig.c
+LOCAL_SHARED_LIBRARIES := libsqlite
+LOCAL_C_INCLUDES := $(BDB_PATH) $(LOCAL_PATH)/$(BDB_TOP)/build_android\
+ $(LOCAL_PATH)/$(BDB_TOP)/lang/sql/generated $(LOCAL_PATH)/../android
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_CFLAGS += -DHAVE_USLEEP=1 -DTHREADSAFE=1 -DNDEBUG=1
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+LOCAL_MODULE := db_upgrade
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+################################################################################
+##device commande line tool:db_verify
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_verify
+include $(CLEAR_VARS)
+
+LOCAL_ARM_MODE := arm
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_verify.c \
+ $(BDB_TOP)/src/common/util_cache.c \
+ $(BDB_TOP)/src/common/util_sig.c
+LOCAL_SHARED_LIBRARIES := libsqlite
+LOCAL_C_INCLUDES := $(BDB_PATH) $(LOCAL_PATH)/$(BDB_TOP)/build_android\
+ $(LOCAL_PATH)/$(BDB_TOP)/lang/sql/generated $(LOCAL_PATH)/../android
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_CFLAGS += -DHAVE_USLEEP=1 -DTHREADSAFE=1 -DNDEBUG=1
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+LOCAL_MODULE := db_verify
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+################################################################################
+##device commande line tool:db_log_verify
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_log_verify
+include $(CLEAR_VARS)
+
+LOCAL_ARM_MODE := arm
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_log_verify.c \
+ $(BDB_TOP)/src/common/util_cache.c \
+ $(BDB_TOP)/src/common/util_sig.c
+LOCAL_SHARED_LIBRARIES := libsqlite
+LOCAL_C_INCLUDES := $(BDB_PATH) $(LOCAL_PATH)/$(BDB_TOP)/build_android\
+ $(LOCAL_PATH)/$(BDB_TOP)/lang/sql/generated $(LOCAL_PATH)/../android
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_CFLAGS += -DHAVE_USLEEP=1 -DTHREADSAFE=1 -DNDEBUG=1
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+LOCAL_MODULE := db_log_verify
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
diff --git a/build_android/db.h b/build_android/db.h
index 7ae145ff..cda67bc5 100644
--- a/build_android/db.h
+++ b/build_android/db.h
@@ -2,7 +2,7 @@
/*
* See the file LICENSE for redistribution information.
*
- * Copyright (c) 1996, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015 Oracle and/or its affiliates. All rights reserved.
*
* $Id$
*
@@ -42,13 +42,13 @@ extern "C" {
/*
* Berkeley DB version information.
*/
-#define DB_VERSION_FAMILY 11
-#define DB_VERSION_RELEASE 2
-#define DB_VERSION_MAJOR 5
-#define DB_VERSION_MINOR 3
-#define DB_VERSION_PATCH 21
-#define DB_VERSION_STRING "Berkeley DB 5.3.21: (May 11, 2012)"
-#define DB_VERSION_FULL_STRING "Berkeley DB 11g Release 2, library version 11.2.5.3.21: (May 11, 2012)"
+#define DB_VERSION_FAMILY 12
+#define DB_VERSION_RELEASE 1
+#define DB_VERSION_MAJOR 6
+#define DB_VERSION_MINOR 1
+#define DB_VERSION_PATCH 23
+#define DB_VERSION_STRING "Berkeley DB 6.1.23: (February 17, 2015)"
+#define DB_VERSION_FULL_STRING "Berkeley DB 12c Release 1, library version 12.1.6.1.23: (February 17, 2015)"
/*
* !!!
@@ -94,6 +94,7 @@ extern "C" {
+typedef int64_t db_off_t;
#ifdef HAVE_MIXED_SIZE_ADDRESSING
typedef u_int32_t db_size_t;
#else
@@ -119,9 +120,9 @@ typedef u_int16_t db_indx_t; /* Page offset type. */
#define DB_MAX_PAGES 0xffffffff /* >= # of pages in a file */
typedef u_int32_t db_recno_t; /* Record number type. */
-#define DB_MAX_RECORDS 0xffffffff /* >= # of records in a tree */
+#define DB_MAX_RECORDS 0xffffffff /* >= # of records in a recno tree. */
-typedef u_int32_t db_timeout_t; /* Type of a timeout. */
+typedef u_int32_t db_timeout_t; /* Type of a timeout in microseconds. */
/*
* Region offsets are the difference between a pointer in a region and the
@@ -145,6 +146,10 @@ struct __db_compact; typedef struct __db_compact DB_COMPACT;
struct __db_dbt; typedef struct __db_dbt DBT;
struct __db_distab; typedef struct __db_distab DB_DISTAB;
struct __db_env; typedef struct __db_env DB_ENV;
+struct __db_event_mutex_died_info;
+ typedef struct __db_event_mutex_died_info DB_EVENT_MUTEX_DIED_INFO;
+struct __db_event_failchk_info;
+ typedef struct __db_event_failchk_info DB_EVENT_FAILCHK_INFO;
struct __db_h_stat; typedef struct __db_h_stat DB_HASH_STAT;
struct __db_heap_rid; typedef struct __db_heap_rid DB_HEAP_RID;
struct __db_heap_stat; typedef struct __db_heap_stat DB_HEAP_STAT;
@@ -177,6 +182,7 @@ struct __db_repmgr_site;typedef struct __db_repmgr_site DB_REPMGR_SITE;
struct __db_repmgr_stat;typedef struct __db_repmgr_stat DB_REPMGR_STAT;
struct __db_seq_record; typedef struct __db_seq_record DB_SEQ_RECORD;
struct __db_seq_stat; typedef struct __db_seq_stat DB_SEQUENCE_STAT;
+struct __db_stream; typedef struct __db_stream DB_STREAM;
struct __db_site; typedef struct __db_site DB_SITE;
struct __db_sequence; typedef struct __db_sequence DB_SEQUENCE;
struct __db_thread_info;typedef struct __db_thread_info DB_THREAD_INFO;
@@ -214,18 +220,20 @@ struct __db_dbt {
void *app_data;
-#define DB_DBT_APPMALLOC 0x001 /* Callback allocated memory. */
-#define DB_DBT_BULK 0x002 /* Internal: Insert if duplicate. */
-#define DB_DBT_DUPOK 0x004 /* Internal: Insert if duplicate. */
-#define DB_DBT_ISSET 0x008 /* Lower level calls set value. */
-#define DB_DBT_MALLOC 0x010 /* Return in malloc'd memory. */
-#define DB_DBT_MULTIPLE 0x020 /* References multiple records. */
-#define DB_DBT_PARTIAL 0x040 /* Partial put/get. */
-#define DB_DBT_REALLOC 0x080 /* Return in realloc'd memory. */
-#define DB_DBT_READONLY 0x100 /* Readonly, don't update. */
-#define DB_DBT_STREAMING 0x200 /* Internal: DBT is being streamed. */
-#define DB_DBT_USERCOPY 0x400 /* Use the user-supplied callback. */
-#define DB_DBT_USERMEM 0x800 /* Return in user's memory. */
+#define DB_DBT_APPMALLOC 0x0001 /* Callback allocated memory. */
+#define DB_DBT_BULK 0x0002 /* Internal: Insert if duplicate. */
+#define DB_DBT_DUPOK 0x0004 /* Internal: Insert if duplicate. */
+#define DB_DBT_ISSET 0x0008 /* Lower level calls set value. */
+#define DB_DBT_MALLOC 0x0010 /* Return in malloc'd memory. */
+#define DB_DBT_MULTIPLE 0x0020 /* References multiple records. */
+#define DB_DBT_PARTIAL 0x0040 /* Partial put/get. */
+#define DB_DBT_REALLOC 0x0080 /* Return in realloc'd memory. */
+#define DB_DBT_READONLY 0x0100 /* Readonly, don't update. */
+#define DB_DBT_STREAMING 0x0200 /* Internal: DBT is being streamed. */
+#define DB_DBT_USERCOPY 0x0400 /* Use the user-supplied callback. */
+#define DB_DBT_USERMEM 0x0800 /* Return in user's memory. */
+#define DB_DBT_BLOB 0x1000 /* Data item is a blob. */
+#define DB_DBT_BLOB_REC 0x2000 /* Internal: Blob database record. */
u_int32_t flags;
};
@@ -262,6 +270,23 @@ struct __db_mutex_stat { /* SHARED */
#endif
};
+/* Buffers passed to __mutex_describe() must be at least this large. */
+#define DB_MUTEX_DESCRIBE_STRLEN 128
+
+/* This is the info of a DB_EVENT_MUTEX_DIED event notification. */
+struct __db_event_mutex_died_info {
+ pid_t pid; /* Process which last owned the mutex */
+ db_threadid_t tid; /* Thread which last owned the mutex */
+ db_mutex_t mutex; /* ID of the mutex */
+ char desc[DB_MUTEX_DESCRIBE_STRLEN];
+};
+
+/* This is the info of a DB_EVENT_FAILCHK event notification. */
+#define DB_FAILURE_SYMPTOM_SIZE 120
+struct __db_event_failchk_info {
+ int error;
+ char symptom[DB_FAILURE_SYMPTOM_SIZE];
+};
/* This is the length of the buffer passed to DB_ENV->thread_id_string() */
#define DB_THREADID_STRLEN 128
@@ -388,6 +413,8 @@ struct __db_lock_stat { /* SHARED */
uintmax_t st_lockers_nowait; /* Locker lock granted without wait. */
uintmax_t st_region_wait; /* Region lock granted after wait. */
uintmax_t st_region_nowait; /* Region lock granted without wait. */
+ uintmax_t st_nlockers_hit; /* Lockers found in thread info. */
+ uintmax_t st_nlockers_reused; /* Lockers reallocated from thread info. */
u_int32_t st_hash_len; /* Max length of bucket. */
roff_t st_regsize; /* Region size. */
#endif
@@ -457,7 +484,7 @@ struct __db_lockreq {
/*******************************************************
* Logging.
*******************************************************/
-#define DB_LOGVERSION 19 /* Current log version. */
+#define DB_LOGVERSION 22 /* Current log version. */
#define DB_LOGVERSION_LATCHING 15 /* Log version using latching: db-4.8 */
#define DB_LOGCHKSUM 12 /* Check sum headers: db-4.5 */
#define DB_LOGOLDVER 8 /* Oldest version supported: db-4.2 */
@@ -583,7 +610,8 @@ typedef enum {
LOGREC_PGDDBT,
LOGREC_PGLIST,
LOGREC_POINTER,
- LOGREC_TIME
+ LOGREC_TIME,
+ LOGREC_LONGARG
} log_rec_type_t;
typedef const struct __log_rec_spec {
@@ -743,6 +771,7 @@ struct __db_mpool_stat { /* SHARED */
uintmax_t st_mvcc_frozen; /* Buffers frozen. */
uintmax_t st_mvcc_thawed; /* Buffers thawed. */
uintmax_t st_mvcc_freed; /* Frozen buffers freed. */
+ uintmax_t st_mvcc_reused; /* Outdated invisible buffers reused. */
uintmax_t st_alloc; /* Number of page allocations. */
uintmax_t st_alloc_buckets; /* Buckets checked during allocation. */
uintmax_t st_alloc_max_buckets;/* Max checked during allocation. */
@@ -750,6 +779,8 @@ struct __db_mpool_stat { /* SHARED */
uintmax_t st_alloc_max_pages; /* Max checked during allocation. */
uintmax_t st_io_wait; /* Thread waited on buffer I/O. */
uintmax_t st_sync_interrupted; /* Number of times sync interrupted. */
+ u_int32_t st_oddfsize_detect; /* Odd file size detected. */
+ u_int32_t st_oddfsize_resolve; /* Odd file size resolved. */
roff_t st_regsize; /* Region size. */
roff_t st_regmax; /* Region max. */
#endif
@@ -944,7 +975,7 @@ struct __db_txn {
#define TXN_SNAPSHOT 0x08000 /* Snapshot Isolation. */
#define TXN_SYNC 0x10000 /* Write and sync on prepare/commit. */
#define TXN_WRITE_NOSYNC 0x20000 /* Write only on prepare/commit. */
-#define TXN_BULK 0x40000 /* Enable bulk loading optimization. */
+#define TXN_BULK 0x40000 /* Enable bulk loading optimization. */
u_int32_t flags;
};
@@ -1053,30 +1084,34 @@ struct __db_txn_token {
/*
* Event notification types. (Tcl testing interface currently assumes there are
- * no more than 32 of these.)
+ * no more than 32 of these.). Comments include any relevant event_info types.
*/
#define DB_EVENT_PANIC 0
-#define DB_EVENT_REG_ALIVE 1
-#define DB_EVENT_REG_PANIC 2
-#define DB_EVENT_REP_CLIENT 3
-#define DB_EVENT_REP_CONNECT_BROKEN 4
-#define DB_EVENT_REP_CONNECT_ESTD 5
-#define DB_EVENT_REP_CONNECT_TRY_FAILED 6
-#define DB_EVENT_REP_DUPMASTER 7
-#define DB_EVENT_REP_ELECTED 8
-#define DB_EVENT_REP_ELECTION_FAILED 9
-#define DB_EVENT_REP_INIT_DONE 10
-#define DB_EVENT_REP_JOIN_FAILURE 11
-#define DB_EVENT_REP_LOCAL_SITE_REMOVED 12
-#define DB_EVENT_REP_MASTER 13
-#define DB_EVENT_REP_MASTER_FAILURE 14
-#define DB_EVENT_REP_NEWMASTER 15
-#define DB_EVENT_REP_PERM_FAILED 16
-#define DB_EVENT_REP_SITE_ADDED 17
-#define DB_EVENT_REP_SITE_REMOVED 18
-#define DB_EVENT_REP_STARTUPDONE 19
-#define DB_EVENT_REP_WOULD_ROLLBACK 20 /* Undocumented; C API only. */
-#define DB_EVENT_WRITE_FAILED 21
+#define DB_EVENT_REG_ALIVE 1 /* int: pid which was in env */
+#define DB_EVENT_REG_PANIC 2 /* int: error causing the panic. */
+#define DB_EVENT_REP_AUTOTAKEOVER_FAILED 3
+#define DB_EVENT_REP_CLIENT 4
+#define DB_EVENT_REP_CONNECT_BROKEN 5 /* DB_REPMGR_CONN_ERR */
+#define DB_EVENT_REP_CONNECT_ESTD 6 /* int: EID of remote site */
+#define DB_EVENT_REP_CONNECT_TRY_FAILED 7 /* DB_REPMGR_CONN_ERR */
+#define DB_EVENT_REP_DUPMASTER 8
+#define DB_EVENT_REP_ELECTED 9
+#define DB_EVENT_REP_ELECTION_FAILED 10
+#define DB_EVENT_REP_INIT_DONE 11
+#define DB_EVENT_REP_INQUEUE_FULL 12
+#define DB_EVENT_REP_JOIN_FAILURE 13
+#define DB_EVENT_REP_LOCAL_SITE_REMOVED 14
+#define DB_EVENT_REP_MASTER 15
+#define DB_EVENT_REP_MASTER_FAILURE 16
+#define DB_EVENT_REP_NEWMASTER 17 /* int: new master's site id */
+#define DB_EVENT_REP_PERM_FAILED 18
+#define DB_EVENT_REP_SITE_ADDED 19 /* int: eid */
+#define DB_EVENT_REP_SITE_REMOVED 20 /* int: eid */
+#define DB_EVENT_REP_STARTUPDONE 21
+#define DB_EVENT_REP_WOULD_ROLLBACK 22 /* Undocumented; C API only. */
+#define DB_EVENT_WRITE_FAILED 23
+#define DB_EVENT_MUTEX_DIED 24 /* DB_EVENT_MUTEX_DIED_INFO */
+#define DB_EVENT_FAILCHK_PANIC 25 /* DB_EVENT_FAILCHK_INFO */
#define DB_EVENT_NO_SUCH_EVENT 0xffffffff /* OOB sentinel value */
/* Replication Manager site status. */
@@ -1090,6 +1125,7 @@ struct __db_repmgr_site {
u_int32_t status;
#define DB_REPMGR_ISPEER 0x01
+#define DB_REPMGR_ISVIEW 0x02
u_int32_t flags;
};
@@ -1105,6 +1141,7 @@ struct __db_rep_stat { /* SHARED */
* circumstances, garbaged).
*/
u_int32_t st_startup_complete; /* Site completed client sync-up. */
+ u_int32_t st_view; /* Site is a view. */
#ifndef __TEST_DB_NO_STATISTICS
uintmax_t st_log_queued; /* Log records currently queued.+ */
u_int32_t st_status; /* Current replication status. */
@@ -1182,6 +1219,7 @@ struct __db_rep_stat { /* SHARED */
/* Undocumented statistics only used by the test system. */
#ifdef CONFIG_TEST
u_int32_t st_filefail_cleanups; /* # of FILE_FAIL cleanups done. */
+ uintmax_t st_log_futuredup; /* Future log records that are dups. */
#endif
#endif
};
@@ -1192,10 +1230,18 @@ struct __db_repmgr_stat { /* SHARED */
uintmax_t st_msgs_queued; /* # msgs queued for network delay. */
uintmax_t st_msgs_dropped; /* # msgs discarded due to excessive
queue length. */
+ u_int32_t st_incoming_queue_gbytes; /* Incoming queue size: GB. */
+ u_int32_t st_incoming_queue_bytes; /* Incoming queue size: B. */
+ uintmax_t st_incoming_msgs_dropped; /* # of msgs discarded due to
+ incoming queue full. */
uintmax_t st_connection_drop; /* Existing connections dropped. */
uintmax_t st_connect_fail; /* Failed new connection attempts. */
- uintmax_t st_elect_threads; /* # of active election threads. */
- uintmax_t st_max_elect_threads; /* Max concurrent e-threads ever. */
+ u_int32_t st_elect_threads; /* # of active election threads. */
+ u_int32_t st_max_elect_threads; /* Max concurrent e-threads ever. */
+ u_int32_t st_site_participants; /* # of repgroup participant sites. */
+ u_int32_t st_site_total; /* # of repgroup total sites. */
+ u_int32_t st_site_views; /* # of repgroup view sites. */
+ uintmax_t st_takeovers; /* # of automatic listener takeovers. */
};
/* Replication Manager connection error. */
@@ -1226,7 +1272,7 @@ struct __db_sequence {
db_mutex_t mtx_seq; /* Mutex if sequence is threaded. */
DB_SEQ_RECORD *seq_rp; /* Pointer to current data. */
DB_SEQ_RECORD seq_record; /* Data from DB_SEQUENCE. */
- int32_t seq_cache_size; /* Number of values cached. */
+ u_int32_t seq_cache_size; /* Number of values cached. */
db_seq_t seq_last_value; /* Last value cached. */
db_seq_t seq_prev_value; /* Last value returned. */
DBT seq_key; /* DBT pointing to sequence key. */
@@ -1238,8 +1284,8 @@ struct __db_sequence {
/* DB_SEQUENCE PUBLIC HANDLE LIST BEGIN */
int (*close) __P((DB_SEQUENCE *, u_int32_t));
int (*get) __P((DB_SEQUENCE *,
- DB_TXN *, int32_t, db_seq_t *, u_int32_t));
- int (*get_cachesize) __P((DB_SEQUENCE *, int32_t *));
+ DB_TXN *, u_int32_t, db_seq_t *, u_int32_t));
+ int (*get_cachesize) __P((DB_SEQUENCE *, u_int32_t *));
int (*get_db) __P((DB_SEQUENCE *, DB **));
int (*get_flags) __P((DB_SEQUENCE *, u_int32_t *));
int (*get_key) __P((DB_SEQUENCE *, DBT *));
@@ -1249,7 +1295,7 @@ struct __db_sequence {
int (*open) __P((DB_SEQUENCE *,
DB_TXN *, DBT *, u_int32_t));
int (*remove) __P((DB_SEQUENCE *, DB_TXN *, u_int32_t));
- int (*set_cachesize) __P((DB_SEQUENCE *, int32_t));
+ int (*set_cachesize) __P((DB_SEQUENCE *, u_int32_t));
int (*set_flags) __P((DB_SEQUENCE *, u_int32_t));
int (*set_range) __P((DB_SEQUENCE *, db_seq_t, db_seq_t));
int (*stat) __P((DB_SEQUENCE *,
@@ -1266,7 +1312,7 @@ struct __db_seq_stat { /* SHARED */
db_seq_t st_last_value; /* Last cached value. */
db_seq_t st_min; /* Minimum value. */
db_seq_t st_max; /* Maximum value. */
- int32_t st_cache_size; /* Cache size. */
+ u_int32_t st_cache_size; /* Cache size. */
u_int32_t st_flags; /* Flag value. */
};
@@ -1288,15 +1334,15 @@ typedef enum {
#define DB_RENAMEMAGIC 0x030800 /* File has been renamed. */
-#define DB_BTREEVERSION 9 /* Current btree version. */
+#define DB_BTREEVERSION 10 /* Current btree version. */
#define DB_BTREEOLDVER 8 /* Oldest btree version supported. */
#define DB_BTREEMAGIC 0x053162
-#define DB_HASHVERSION 9 /* Current hash version. */
+#define DB_HASHVERSION 10 /* Current hash version. */
#define DB_HASHOLDVER 7 /* Oldest hash version supported. */
#define DB_HASHMAGIC 0x061561
-#define DB_HEAPVERSION 1 /* Current heap version. */
+#define DB_HEAPVERSION 2 /* Current heap version. */
#define DB_HEAPOLDVER 1 /* Oldest heap version supported. */
#define DB_HEAPMAGIC 0x074582
@@ -1365,6 +1411,7 @@ typedef enum {
#define DB_LOCK_NOTGRANTED (-30992)/* Lock unavailable. */
#define DB_LOG_BUFFER_FULL (-30991)/* In-memory log buffer full. */
#define DB_LOG_VERIFY_BAD (-30990)/* Log verification failed. */
+#define DB_META_CHKSUM_FAIL (-30968)/* Metadata page checksum failed. */
#define DB_NOSERVER (-30989)/* Server panic return. */
#define DB_NOTFOUND (-30988)/* Key/data pair not found (EOF). */
#define DB_OLD_VERSION (-30987)/* Out-of-date version. */
@@ -1393,6 +1440,8 @@ typedef enum {
#define DB_DELETED (-30897)/* Recovery file marked deleted. */
#define DB_EVENT_NOT_HANDLED (-30896)/* Forward event to application. */
#define DB_NEEDSPLIT (-30895)/* Page needs to be split. */
+#define DB_NOINTMP (-30886)/* Sequences not supported in temporary
+ or in-memory databases. */
#define DB_REP_BULKOVF (-30894)/* Rep bulk buffer overflow. */
#define DB_REP_LOGREADY (-30893)/* Rep log ready for recovery. */
#define DB_REP_NEWMASTER (-30892)/* We have learned of a new master. */
@@ -1403,6 +1452,13 @@ typedef enum {
#define DB_TXN_CKP (-30888)/* Encountered ckp record in log. */
#define DB_VERIFY_FATAL (-30887)/* DB->verify cannot proceed. */
+/*
+ * This exit status indicates that a BDB utility failed because it needed a
+ * resource which had been held by a process which crashed or otherwise did
+ * not exit cleanly.
+ */
+#define DB_EXIT_FAILCHK 3
+
/* Database handle. */
struct __db {
/*******************************************************
@@ -1414,7 +1470,7 @@ struct __db {
/* Callbacks. */
int (*db_append_recno) __P((DB *, DBT *, db_recno_t));
void (*db_feedback) __P((DB *, int, int));
- int (*dup_compare) __P((DB *, const DBT *, const DBT *));
+ int (*dup_compare) __P((DB *, const DBT *, const DBT *, size_t *));
void *app_private; /* Application-private handle. */
@@ -1438,6 +1494,8 @@ struct __db {
u_int32_t adj_fileid; /* File's unique ID for curs. adj. */
+ u_int32_t blob_threshold; /* Blob threshold record size. */
+
#define DB_LOGFILEID_INVALID -1
FNAME *log_filename; /* File's naming info for logging. */
@@ -1581,6 +1639,12 @@ struct __db {
/* Reference to foreign -- set in the secondary. */
DB *s_foreign;
+ DB *blob_meta_db; /* Databases holding blob metadata. */
+ DB_SEQUENCE *blob_seq; /* Sequence of blob ids. */
+ char *blob_sub_dir; /* Subdirectory for blob files */
+ db_seq_t blob_file_id; /* Id of the file blob directory. */
+ db_seq_t blob_sdb_id; /* Id of the subdb blob directory. */
+
/* API-private structure: used by DB 1.85, C++, Java, Perl and Tcl */
void *api_internal;
@@ -1611,8 +1675,11 @@ struct __db {
void *(**)(void *, size_t), void (**)(void *)));
int (*get_append_recno) __P((DB *, int (**)(DB *, DBT *, db_recno_t)));
int (*get_assoc_flags) __P((DB *, u_int32_t *));
+ int (*get_blob_dir) __P((DB *, const char **));
+ int (*get_blob_sub_dir) __P((DB *, const char **));
+ int (*get_blob_threshold) __P((DB *, u_int32_t *));
int (*get_bt_compare)
- __P((DB *, int (**)(DB *, const DBT *, const DBT *)));
+ __P((DB *, int (**)(DB *, const DBT *, const DBT *, size_t *)));
int (*get_bt_compress) __P((DB *,
int (**)(DB *,
const DBT *, const DBT *, const DBT *, const DBT *, DBT *),
@@ -1625,7 +1692,7 @@ struct __db {
int (*get_create_dir) __P((DB *, const char **));
int (*get_dbname) __P((DB *, const char **, const char **));
int (*get_dup_compare)
- __P((DB *, int (**)(DB *, const DBT *, const DBT *)));
+ __P((DB *, int (**)(DB *, const DBT *, const DBT *, size_t *)));
int (*get_encrypt_flags) __P((DB *, u_int32_t *));
DB_ENV *(*get_env) __P((DB *));
void (*get_errcall) __P((DB *,
@@ -1635,7 +1702,7 @@ struct __db {
int (*get_feedback) __P((DB *, void (**)(DB *, int, int)));
int (*get_flags) __P((DB *, u_int32_t *));
int (*get_h_compare)
- __P((DB *, int (**)(DB *, const DBT *, const DBT *)));
+ __P((DB *, int (**)(DB *, const DBT *, const DBT *, size_t *)));
int (*get_h_ffactor) __P((DB *, u_int32_t *));
int (*get_h_hash)
__P((DB *, u_int32_t (**)(DB *, const void *, u_int32_t)));
@@ -1676,8 +1743,10 @@ struct __db {
int (*set_alloc) __P((DB *, void *(*)(size_t),
void *(*)(void *, size_t), void (*)(void *)));
int (*set_append_recno) __P((DB *, int (*)(DB *, DBT *, db_recno_t)));
+ int (*set_blob_dir) __P((DB *, const char *));
+ int (*set_blob_threshold) __P((DB *, u_int32_t, u_int32_t));
int (*set_bt_compare)
- __P((DB *, int (*)(DB *, const DBT *, const DBT *)));
+ __P((DB *, int (*)(DB *, const DBT *, const DBT *, size_t *)));
int (*set_bt_compress) __P((DB *,
int (*)(DB *, const DBT *, const DBT *, const DBT *, const DBT *, DBT *),
int (*)(DB *, const DBT *, const DBT *, DBT *, DBT *, DBT *)));
@@ -1687,7 +1756,7 @@ struct __db {
int (*set_cachesize) __P((DB *, u_int32_t, u_int32_t, int));
int (*set_create_dir) __P((DB *, const char *));
int (*set_dup_compare)
- __P((DB *, int (*)(DB *, const DBT *, const DBT *)));
+ __P((DB *, int (*)(DB *, const DBT *, const DBT *, size_t *)));
int (*set_encrypt) __P((DB *, const char *, u_int32_t));
void (*set_errcall) __P((DB *,
void (*)(const DB_ENV *, const char *, const char *)));
@@ -1696,7 +1765,7 @@ struct __db {
int (*set_feedback) __P((DB *, void (*)(DB *, int, int)));
int (*set_flags) __P((DB *, u_int32_t));
int (*set_h_compare)
- __P((DB *, int (*)(DB *, const DBT *, const DBT *)));
+ __P((DB *, int (*)(DB *, const DBT *, const DBT *, size_t *)));
int (*set_h_ffactor) __P((DB *, u_int32_t));
int (*set_h_hash)
__P((DB *, u_int32_t (*)(DB *, const void *, u_int32_t)));
@@ -1796,13 +1865,34 @@ struct __db {
u_int32_t orig_flags; /* Flags at open, for refresh */
u_int32_t flags;
-#define DB2_AM_EXCL 0x00000001 /* Exclusively lock the handle */
-#define DB2_AM_INTEXCL 0x00000002 /* Internal exclusive lock. */
-#define DB2_AM_NOWAIT 0x00000004 /* Do not wait for handle lock */
- u_int32_t orig_flags2; /* Second flags word; for refresh */
+#define DB2_AM_EXCL 0x00000001 /* Exclusively lock the handle */
+#define DB2_AM_INTEXCL 0x00000002 /* Internal exclusive lock. */
+#define DB2_AM_NOWAIT 0x00000004 /* Do not wait for handle lock */
u_int32_t flags2; /* Second flags word */
};
+/*
+ * Stream interface for blob files.
+ */
+struct __db_stream {
+ DBC *dbc; /* Cursor pointing to the db blob record. */
+ DB_FH *fhp;
+
+ /* DB_STREAM PUBLIC HANDLE LIST BEGIN */
+ int (*close) __P((DB_STREAM *, u_int32_t));
+ int (*read) __P((DB_STREAM *, DBT *, db_off_t, u_int32_t, u_int32_t));
+ int (*size) __P((DB_STREAM *, db_off_t *, u_int32_t));
+ int (*write) __P((DB_STREAM *, DBT *, db_off_t, u_int32_t));
+ /* DB_STREAM PUBLIC HANDLE LIST END */
+
+ u_int32_t flags;
+#define DB_STREAM_READ 0x00000001 /* Stream is read only. */
+#define DB_STREAM_WRITE 0x00000002 /* Stream is writeable. */
+#define DB_STREAM_SYNC_WRITE 0x00000004 /* Sync file on each write. */
+ db_seq_t blob_id;
+ db_off_t file_size;
+};
+
/*
* Macros for bulk operations. These are only intended for the C API.
* For C++, use DbMultiple*Iterator or DbMultiple*Builder.
@@ -1877,7 +1967,7 @@ struct __db {
pointer = __p; \
} while (0)
-#define DB_MULTIPLE_WRITE_INIT(pointer, dbt) \
+#define DB_MULTIPLE_WRITE_INIT(pointer, dbt) \
do { \
(dbt)->flags |= DB_DBT_BULK; \
pointer = (u_int8_t *)(dbt)->data + \
@@ -1885,7 +1975,7 @@ struct __db {
*(u_int32_t *)(pointer) = (u_int32_t)-1; \
} while (0)
-#define DB_MULTIPLE_RESERVE_NEXT(pointer, dbt, writedata, writedlen) \
+#define DB_MULTIPLE_RESERVE_NEXT(pointer, dbt, writedata, writedlen) \
do { \
u_int32_t *__p = (u_int32_t *)(pointer); \
u_int32_t __off = ((pointer) == (u_int8_t *)(dbt)->data +\
@@ -1902,7 +1992,7 @@ struct __db {
} \
} while (0)
-#define DB_MULTIPLE_WRITE_NEXT(pointer, dbt, writedata, writedlen) \
+#define DB_MULTIPLE_WRITE_NEXT(pointer, dbt, writedata, writedlen) \
do { \
void *__destd; \
DB_MULTIPLE_RESERVE_NEXT((pointer), (dbt), \
@@ -1913,7 +2003,7 @@ struct __db {
memcpy(__destd, (writedata), (writedlen)); \
} while (0)
-#define DB_MULTIPLE_KEY_RESERVE_NEXT(pointer, dbt, writekey, writeklen, writedata, writedlen) \
+#define DB_MULTIPLE_KEY_RESERVE_NEXT(pointer, dbt, writekey, writeklen, writedata, writedlen) \
do { \
u_int32_t *__p = (u_int32_t *)(pointer); \
u_int32_t __off = ((pointer) == (u_int8_t *)(dbt)->data +\
@@ -1936,7 +2026,7 @@ struct __db {
} \
} while (0)
-#define DB_MULTIPLE_KEY_WRITE_NEXT(pointer, dbt, writekey, writeklen, writedata, writedlen) \
+#define DB_MULTIPLE_KEY_WRITE_NEXT(pointer, dbt, writekey, writeklen, writedata, writedlen) \
do { \
void *__destk, *__destd; \
DB_MULTIPLE_KEY_RESERVE_NEXT((pointer), (dbt), \
@@ -1950,7 +2040,7 @@ struct __db {
} \
} while (0)
-#define DB_MULTIPLE_RECNO_WRITE_INIT(pointer, dbt) \
+#define DB_MULTIPLE_RECNO_WRITE_INIT(pointer, dbt) \
do { \
(dbt)->flags |= DB_DBT_BULK; \
pointer = (u_int8_t *)(dbt)->data + \
@@ -1958,7 +2048,7 @@ struct __db {
*(u_int32_t *)(pointer) = 0; \
} while (0)
-#define DB_MULTIPLE_RECNO_RESERVE_NEXT(pointer, dbt, recno, writedata, writedlen) \
+#define DB_MULTIPLE_RECNO_RESERVE_NEXT(pointer, dbt, recno, writedata, writedlen) \
do { \
u_int32_t *__p = (u_int32_t *)(pointer); \
u_int32_t __off = ((pointer) == (u_int8_t *)(dbt)->data +\
@@ -1976,7 +2066,7 @@ struct __db {
} \
} while (0)
-#define DB_MULTIPLE_RECNO_WRITE_NEXT(pointer, dbt, recno, writedata, writedlen)\
+#define DB_MULTIPLE_RECNO_WRITE_NEXT(pointer, dbt, recno, writedata, writedlen)\
do { \
void *__destd; \
DB_MULTIPLE_RECNO_RESERVE_NEXT((pointer), (dbt), \
@@ -1991,7 +2081,7 @@ struct __db_heap_rid {
db_pgno_t pgno; /* Page number. */
db_indx_t indx; /* Index in the offset table. */
};
-#define DB_HEAP_RID_SZ (sizeof(db_pgno_t) + sizeof(db_indx_t))
+#define DB_HEAP_RID_SZ (sizeof(db_pgno_t) + sizeof(db_indx_t))
/*******************************************************
* Access method cursors.
@@ -2062,6 +2152,7 @@ struct __dbc {
int (*close) __P((DBC *));
int (*cmp) __P((DBC *, DBC *, int *, u_int32_t));
int (*count) __P((DBC *, db_recno_t *, u_int32_t));
+ int (*db_stream) __P((DBC *, DB_STREAM **, u_int32_t));
int (*del) __P((DBC *, u_int32_t));
int (*dup) __P((DBC *, DBC **, u_int32_t));
int (*get) __P((DBC *, DBT *, DBT *, u_int32_t));
@@ -2139,6 +2230,7 @@ struct __db_bt_stat { /* SHARED */
u_int32_t bt_pagecnt; /* Page count. */
u_int32_t bt_pagesize; /* Page size. */
u_int32_t bt_minkey; /* Minkey value. */
+ u_int32_t bt_nblobs; /* Number of blobs. */
u_int32_t bt_re_len; /* Fixed-length record length. */
u_int32_t bt_re_pad; /* Fixed-length record pad. */
u_int32_t bt_levels; /* Tree levels. */
@@ -2167,7 +2259,7 @@ struct __db_compact {
u_int32_t compact_deadlock; /* Number of deadlocks. */
db_pgno_t compact_pages_truncated; /* Pages truncated to OS. */
/* Internal. */
- db_pgno_t compact_truncate; /* Page number for truncation */
+ db_pgno_t compact_truncate; /* Exchange pages above here. */
};
/* Hash statistics structure. */
@@ -2177,6 +2269,7 @@ struct __db_h_stat { /* SHARED */
u_int32_t hash_metaflags; /* Metadata flags. */
u_int32_t hash_nkeys; /* Number of unique keys. */
u_int32_t hash_ndata; /* Number of data items. */
+ u_int32_t hash_nblobs; /* Number of blobs. */
u_int32_t hash_pagecnt; /* Page count. */
u_int32_t hash_pagesize; /* Page size. */
u_int32_t hash_ffactor; /* Fill factor specified at create. */
@@ -2196,6 +2289,7 @@ struct __db_heap_stat { /* SHARED */
u_int32_t heap_magic; /* Magic number. */
u_int32_t heap_version; /* Version number. */
u_int32_t heap_metaflags; /* Metadata flags. */
+ u_int32_t heap_nblobs; /* Number of blobs. */
u_int32_t heap_nrecs; /* Number of records. */
u_int32_t heap_pagecnt; /* Page count. */
u_int32_t heap_pagesize; /* Page size. */
@@ -2255,21 +2349,15 @@ typedef enum {
* Backup configuration types.
*/
typedef enum {
- DB_BACKUP_READ_COUNT = 1,
- DB_BACKUP_READ_SLEEP = 2,
- DB_BACKUP_SIZE = 3,
- DB_BACKUP_WRITE_DIRECT = 4
+ DB_BACKUP_READ_COUNT=1,
+ DB_BACKUP_READ_SLEEP=2,
+ DB_BACKUP_SIZE=3,
+ DB_BACKUP_WRITE_DIRECT=4
} DB_BACKUP_CONFIG;
struct __db_env {
ENV *env; /* Linked ENV structure */
- /*
- * The DB_ENV structure can be used concurrently, so field access is
- * protected.
- */
- db_mutex_t mtx_db_env; /* DB_ENV structure mutex */
-
/* Error message callback */
void (*db_errcall) __P((const DB_ENV *, const char *, const char *));
FILE *db_errfile; /* Error message file stream */
@@ -2292,6 +2380,7 @@ struct __db_env {
char *(*thread_id_string) __P((DB_ENV *, pid_t, db_threadid_t, char *));
/* Application specified paths */
+ char *db_blob_dir; /* Blob file directory */
char *db_log_dir; /* Database log file directory */
char *db_md_dir; /* Persistent metadata directory */
char *db_tmp_dir; /* Database tmp file directory */
@@ -2315,6 +2404,8 @@ struct __db_env {
u_int32_t verbose; /* DB_VERB_XXX flags */
+ u_int32_t blob_threshold; /* Blob threshold record size */
+
/* Mutex configuration */
u_int32_t mutex_align; /* Mutex alignment */
u_int32_t mutex_cnt; /* Number of mutexes to configure */
@@ -2383,6 +2474,11 @@ struct __db_env {
* build settings.
*/
db_timeout_t envreg_timeout; /* DB_REGISTER wait timeout */
+ /*
+ * When failchk broadcasting is active, any wait for a mutex will wake
+ * up this frequently in order to check whether the mutex has died.
+ */
+ db_timeout_t mutex_failchk_timeout;
#define DB_ENV_AUTO_COMMIT 0x00000001 /* DB_AUTO_COMMIT */
#define DB_ENV_CDB_ALLDB 0x00000002 /* CDB environment wide locking */
@@ -2402,8 +2498,8 @@ struct __db_env {
#define DB_ENV_TXN_SNAPSHOT 0x00008000 /* DB_TXN_SNAPSHOT set */
#define DB_ENV_TXN_WRITE_NOSYNC 0x00010000 /* DB_TXN_WRITE_NOSYNC set */
#define DB_ENV_YIELDCPU 0x00020000 /* DB_YIELDCPU set */
-#define DB_ENV_HOTBACKUP 0x00040000 /* DB_HOTBACKUP_IN_PROGRESS set */
-#define DB_ENV_NOFLUSH 0x00080000 /* DB_NOFLUSH set */
+#define DB_ENV_HOTBACKUP 0x00040000 /* DB_HOTBACKUP_IN_PROGRESS set */
+#define DB_ENV_NOFLUSH 0x00080000 /* DB_NOFLUSH set */
u_int32_t flags;
/* DB_ENV PUBLIC HANDLE LIST BEGIN */
@@ -2424,6 +2520,8 @@ struct __db_env {
void *(**)(void *, size_t), void (**)(void *)));
int (*get_app_dispatch)
__P((DB_ENV *, int (**)(DB_ENV *, DBT *, DB_LSN *, db_recops)));
+ int (*get_blob_dir) __P((DB_ENV *, const char **));
+ int (*get_blob_threshold) __P((DB_ENV*, u_int32_t *));
int (*get_cache_max) __P((DB_ENV *, u_int32_t *, u_int32_t *));
int (*get_cachesize) __P((DB_ENV *, u_int32_t *, u_int32_t *, int *));
int (*get_create_dir) __P((DB_ENV *, const char **));
@@ -2439,8 +2537,8 @@ struct __db_env {
void (**)(const DB_ENV *, const char *, const char *)));
void (*get_errfile) __P((DB_ENV *, FILE **));
void (*get_errpfx) __P((DB_ENV *, const char **));
- int (*get_flags) __P((DB_ENV *, u_int32_t *));
int (*get_feedback) __P((DB_ENV *, void (**)(DB_ENV *, int, int)));
+ int (*get_flags) __P((DB_ENV *, u_int32_t *));
int (*get_home) __P((DB_ENV *, const char **));
int (*get_intermediate_dir_mode) __P((DB_ENV *, const char **));
int (*get_isalive) __P((DB_ENV *,
@@ -2556,17 +2654,23 @@ struct __db_env {
int (*rep_set_timeout) __P((DB_ENV *, int, db_timeout_t));
int (*rep_set_transport) __P((DB_ENV *, int, int (*)(DB_ENV *,
const DBT *, const DBT *, const DB_LSN *, int, u_int32_t)));
+ int (*rep_set_view) __P((DB_ENV *, int (*)(DB_ENV *,
+ const char *, int *, u_int32_t)));
int (*rep_start) __P((DB_ENV *, DBT *, u_int32_t));
int (*rep_stat) __P((DB_ENV *, DB_REP_STAT **, u_int32_t));
int (*rep_stat_print) __P((DB_ENV *, u_int32_t));
int (*rep_sync) __P((DB_ENV *, u_int32_t));
int (*repmgr_channel) __P((DB_ENV *, int, DB_CHANNEL **, u_int32_t));
int (*repmgr_get_ack_policy) __P((DB_ENV *, int *));
+ int (*repmgr_get_incoming_queue_max)
+ __P((DB_ENV *, u_int32_t *, u_int32_t *));
int (*repmgr_local_site) __P((DB_ENV *, DB_SITE **));
int (*repmgr_msg_dispatch) __P((DB_ENV *,
void (*)(DB_ENV *, DB_CHANNEL *, DBT *, u_int32_t, u_int32_t),
u_int32_t));
int (*repmgr_set_ack_policy) __P((DB_ENV *, int));
+ int (*repmgr_set_incoming_queue_max)
+ __P((DB_ENV *, u_int32_t, u_int32_t));
int (*repmgr_site)
__P((DB_ENV *, const char *, u_int, DB_SITE**, u_int32_t));
int (*repmgr_site_by_eid) __P((DB_ENV *, int, DB_SITE**));
@@ -2578,6 +2682,8 @@ struct __db_env {
void *(*)(void *, size_t), void (*)(void *)));
int (*set_app_dispatch)
__P((DB_ENV *, int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops)));
+ int (*set_blob_dir) __P((DB_ENV *, const char *));
+ int (*set_blob_threshold) __P((DB_ENV *, u_int32_t, u_int32_t));
int (*set_cache_max) __P((DB_ENV *, u_int32_t, u_int32_t));
int (*set_cachesize) __P((DB_ENV *, u_int32_t, u_int32_t, int));
int (*set_create_dir) __P((DB_ENV *, const char *));
@@ -2650,8 +2756,8 @@ struct __db_env {
/* DB_ENV PUBLIC HANDLE LIST END */
/* DB_ENV PRIVATE HANDLE LIST BEGIN */
- int (*prdbt) __P((DBT *, int,
- const char *, void *, int (*)(void *, const void *), int, int));
+ int (*prdbt) __P((DBT *, int, const char *, void *,
+ int (*)(void *, const void *), int, int, int));
/* DB_ENV PRIVATE HANDLE LIST END */
};
@@ -2833,6 +2939,7 @@ typedef struct entry {
#define DB_FLUSH 0x00000002
#define DB_FORCE 0x00000001
#define DB_FORCESYNC 0x00000001
+#define DB_FORCESYNCENV 0x00000002
#define DB_FOREIGN_ABORT 0x00000001
#define DB_FOREIGN_CASCADE 0x00000002
#define DB_FOREIGN_NULLIFY 0x00000004
@@ -2850,8 +2957,9 @@ typedef struct entry {
#define DB_INIT_REP 0x00001000
#define DB_INIT_TXN 0x00002000
#define DB_INORDER 0x00000020
-#define DB_INTERNAL_PERSISTENT_DB 0x00001000
-#define DB_INTERNAL_TEMPORARY_DB 0x00002000
+#define DB_INTERNAL_BLOB_DB 0x00001000
+#define DB_INTERNAL_PERSISTENT_DB 0x00002000
+#define DB_INTERNAL_TEMPORARY_DB 0x00004000
#define DB_JOIN_NOSORT 0x00000001
#define DB_LEGACY 0x00000004
#define DB_LOCAL_SITE 0x00000008
@@ -2864,12 +2972,14 @@ typedef struct entry {
#define DB_LOCK_SWITCH 0x00000020
#define DB_LOCK_UPGRADE 0x00000040
#define DB_LOG_AUTO_REMOVE 0x00000001
+#define DB_LOG_BLOB 0x00000002
#define DB_LOG_CHKPNT 0x00000001
#define DB_LOG_COMMIT 0x00000004
-#define DB_LOG_DIRECT 0x00000002
-#define DB_LOG_DSYNC 0x00000004
-#define DB_LOG_IN_MEMORY 0x00000008
+#define DB_LOG_DIRECT 0x00000004
+#define DB_LOG_DSYNC 0x00000008
+#define DB_LOG_IN_MEMORY 0x00000010
#define DB_LOG_NOCOPY 0x00000008
+#define DB_LOG_NOSYNC 0x00000020
#define DB_LOG_NOT_DURABLE 0x00000010
#define DB_LOG_NO_DATA 0x00000002
#define DB_LOG_VERIFY_CAF 0x00000001
@@ -2881,7 +2991,7 @@ typedef struct entry {
#define DB_LOG_VERIFY_VERBOSE 0x00000040
#define DB_LOG_VERIFY_WARNING 0x00000080
#define DB_LOG_WRNOSYNC 0x00000020
-#define DB_LOG_ZERO 0x00000010
+#define DB_LOG_ZERO 0x00000040
#define DB_MPOOL_CREATE 0x00000001
#define DB_MPOOL_DIRTY 0x00000002
#define DB_MPOOL_DISCARD 0x00000001
@@ -2899,17 +3009,18 @@ typedef struct entry {
#define DB_MUTEX_ALLOCATED 0x00000001
#define DB_MUTEX_LOCKED 0x00000002
#define DB_MUTEX_LOGICAL_LOCK 0x00000004
+#define DB_MUTEX_OWNER_DEAD 0x00000020
#define DB_MUTEX_PROCESS_ONLY 0x00000008
#define DB_MUTEX_SELF_BLOCK 0x00000010
-#define DB_MUTEX_SHARED 0x00000020
-#define DB_NOERROR 0x00004000
+#define DB_MUTEX_SHARED 0x00000040
+#define DB_NOERROR 0x00008000
#define DB_NOFLUSH 0x00001000
#define DB_NOLOCKING 0x00002000
#define DB_NOMMAP 0x00000010
#define DB_NOORDERCHK 0x00000002
#define DB_NOPANIC 0x00004000
#define DB_NOSYNC 0x00000001
-#define DB_NO_AUTO_COMMIT 0x00008000
+#define DB_NO_AUTO_COMMIT 0x00010000
#define DB_NO_CHECKPOINT 0x00008000
#define DB_ODDFILESIZE 0x00000080
#define DB_ORDERCHKONLY 0x00000004
@@ -2920,7 +3031,7 @@ typedef struct entry {
#define DB_PR_PAGE 0x00000010
#define DB_PR_RECOVERYTEST 0x00000020
#define DB_RDONLY 0x00000400
-#define DB_RDWRMASTER 0x00010000
+#define DB_RDWRMASTER 0x00020000
#define DB_READ_COMMITTED 0x00000400
#define DB_READ_UNCOMMITTED 0x00000200
#define DB_RECNUM 0x00000040
@@ -2931,17 +3042,20 @@ typedef struct entry {
#define DB_RENUMBER 0x00000080
#define DB_REPMGR_CONF_2SITE_STRICT 0x00000001
#define DB_REPMGR_CONF_ELECTIONS 0x00000002
+#define DB_REPMGR_CONF_PREFMAS_CLIENT 0x00000004
+#define DB_REPMGR_CONF_PREFMAS_MASTER 0x00000008
#define DB_REPMGR_NEED_RESPONSE 0x00000001
#define DB_REPMGR_PEER 0x00000010
#define DB_REP_ANYWHERE 0x00000001
#define DB_REP_CLIENT 0x00000001
-#define DB_REP_CONF_AUTOINIT 0x00000004
-#define DB_REP_CONF_AUTOROLLBACK 0x00000008
-#define DB_REP_CONF_BULK 0x00000010
-#define DB_REP_CONF_DELAYCLIENT 0x00000020
-#define DB_REP_CONF_INMEM 0x00000040
-#define DB_REP_CONF_LEASE 0x00000080
-#define DB_REP_CONF_NOWAIT 0x00000100
+#define DB_REP_CONF_AUTOINIT 0x00000010
+#define DB_REP_CONF_AUTOROLLBACK 0x00000020
+#define DB_REP_CONF_BULK 0x00000040
+#define DB_REP_CONF_DELAYCLIENT 0x00000080
+#define DB_REP_CONF_ELECT_LOGLENGTH 0x00000100
+#define DB_REP_CONF_INMEM 0x00000200
+#define DB_REP_CONF_LEASE 0x00000400
+#define DB_REP_CONF_NOWAIT 0x00000800
#define DB_REP_ELECTION 0x00000004
#define DB_REP_MASTER 0x00000002
#define DB_REP_NOBUFFER 0x00000002
@@ -2958,8 +3072,9 @@ typedef struct entry {
#define DB_SEQ_WRAP 0x00000008
#define DB_SEQ_WRAPPED 0x00000010
#define DB_SET_LOCK_TIMEOUT 0x00000001
-#define DB_SET_REG_TIMEOUT 0x00000004
-#define DB_SET_TXN_NOW 0x00000008
+#define DB_SET_MUTEX_FAILCHK_TIMEOUT 0x00000004
+#define DB_SET_REG_TIMEOUT 0x00000008
+#define DB_SET_TXN_NOW 0x00000010
#define DB_SET_TXN_TIMEOUT 0x00000002
#define DB_SHALLOW_DUP 0x00000100
#define DB_SNAPSHOT 0x00000200
@@ -2985,7 +3100,7 @@ typedef struct entry {
#define DB_SYSTEM_MEM 0x00080000
#define DB_THREAD 0x00000020
#define DB_TIME_NOTGRANTED 0x00040000
-#define DB_TRUNCATE 0x00020000
+#define DB_TRUNCATE 0x00040000
#define DB_TXN_BULK 0x00000010
#define DB_TXN_FAMILY 0x00000040
#define DB_TXN_NOSYNC 0x00000001
@@ -3003,24 +3118,25 @@ typedef struct entry {
#define DB_VERB_DEADLOCK 0x00000002
#define DB_VERB_FILEOPS 0x00000004
#define DB_VERB_FILEOPS_ALL 0x00000008
-#define DB_VERB_RECOVERY 0x00000010
-#define DB_VERB_REGISTER 0x00000020
-#define DB_VERB_REPLICATION 0x00000040
-#define DB_VERB_REPMGR_CONNFAIL 0x00000080
-#define DB_VERB_REPMGR_MISC 0x00000100
-#define DB_VERB_REP_ELECT 0x00000200
-#define DB_VERB_REP_LEASE 0x00000400
-#define DB_VERB_REP_MISC 0x00000800
-#define DB_VERB_REP_MSGS 0x00001000
-#define DB_VERB_REP_SYNC 0x00002000
-#define DB_VERB_REP_SYSTEM 0x00004000
-#define DB_VERB_REP_TEST 0x00008000
-#define DB_VERB_WAITSFOR 0x00010000
+#define DB_VERB_MVCC 0x00000010
+#define DB_VERB_RECOVERY 0x00000020
+#define DB_VERB_REGISTER 0x00000040
+#define DB_VERB_REPLICATION 0x00000080
+#define DB_VERB_REPMGR_CONNFAIL 0x00000100
+#define DB_VERB_REPMGR_MISC 0x00000200
+#define DB_VERB_REP_ELECT 0x00000400
+#define DB_VERB_REP_LEASE 0x00000800
+#define DB_VERB_REP_MISC 0x00001000
+#define DB_VERB_REP_MSGS 0x00002000
+#define DB_VERB_REP_SYNC 0x00004000
+#define DB_VERB_REP_SYSTEM 0x00008000
+#define DB_VERB_REP_TEST 0x00010000
+#define DB_VERB_WAITSFOR 0x00020000
#define DB_VERIFY 0x00000002
#define DB_VERIFY_PARTITION 0x00040000
#define DB_WRITECURSOR 0x00000010
#define DB_WRITELOCK 0x00000020
-#define DB_WRITEOPEN 0x00040000
+#define DB_WRITEOPEN 0x00080000
#define DB_XA_CREATE 0x00000001
#define DB_YIELDCPU 0x00080000
diff --git a/build_android/db_config.h b/build_android/db_config.h
index c675dd71..0b3fbbb4 100644
--- a/build_android/db_config.h
+++ b/build_android/db_config.h
@@ -81,6 +81,10 @@
/* Define to 1 if building the DBM API. */
/* #undef HAVE_DBM */
+/* Define to 1 if you want a version that records extra information about
+ errors. */
+/* #undef HAVE_ERROR_HISTORY */
+
/* Define to 1 if you have the `directio' function. */
/* #undef HAVE_DIRECTIO */
@@ -100,6 +104,9 @@
/* Define to 1 if platform has EXIT_SUCCESS/EXIT_FAILURE #defines. */
#define HAVE_EXIT_SUCCESS 1
+/* Define to 1 for failchk to inform all waiting threads about crashes. */
+/* #undef HAVE_FAILCHK_BROADCAST */
+
/* Define to 1 if you have the `fchmod' function. */
#define HAVE_FCHMOD 1
@@ -169,6 +176,9 @@
/* Define to 1 if you have the `hstrerror' function. */
#define HAVE_HSTRERROR 1
+/* Define to 1 if you have the `initstate_r' function. */
+/* #undef HAVE_INITSTATE_R */
+
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
@@ -190,6 +200,9 @@
/* Define to 1 if you have the `localtime' function. */
#define HAVE_LOCALTIME 1
+/* Define to 1 if you have the `localtime_r' function. */
+#define HAVE_LOCALTIME_R 1
+
/* Define to 1 if you want to enable log checksums. */
/* #undef HAVE_LOG_CHECKSUM */
@@ -363,6 +376,15 @@
pthread_cond_t. */
/* #undef HAVE_PTHREAD_COND_REINIT_OKAY */
+/* Define to 1 if you have the `pthread_getspecific' function. */
+/* #undef HAVE_PTHREAD_GETSPECIFIC */
+
+/* Define to 1 if you have the `pthread_key_create' function. */
+/* #undef HAVE_PTHREAD_KEY_CREATE */
+
+/* Define to 1 if you have the `pthread_once' function. */
+/* #undef HAVE_PTHREAD_ONCE */
+
/* Define to 1 if it is OK to initialize an already initialized
pthread_rwlock_t. */
/* #undef HAVE_PTHREAD_RWLOCK_REINIT_OKAY */
@@ -370,6 +392,9 @@
/* Define to 1 if you have the `pthread_self' function. */
#define HAVE_PTHREAD_SELF 1
+/* Define to 1 if you have the `pthread_setspecific' function. */
+/* #undef HAVE_PTHREAD_SETSPECIFIC */
+
/* Define to 1 if you have the `pthread_yield' function. */
/* #undef HAVE_PTHREAD_YIELD */
@@ -394,6 +419,9 @@
/* Define to 1 if you have the `random' function. */
/* #undef HAVE_RANDOM */
+/* Define to 1 if you have the `random_r' function. */
+/* #undef HAVE_RANDOM_R /
+
/* Define to 1 if building replication support. */
/* #undef HAVE_REPLICATION */
@@ -430,6 +458,9 @@
/* Define to 1 if you have the `snprintf' function. */
#define HAVE_SNPRINTF 1
+/* Define to 1 if you have the `srandom_r' function. */
+/* #undef HAVE_SRANDOM_R */
+
/* Define to 1 if you have the `stat' function. */
#define HAVE_STAT 1
@@ -560,16 +591,16 @@
#define PACKAGE_NAME "Berkeley DB"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "Berkeley DB 5.3.21"
+#define PACKAGE_STRING "Berkeley DB 6.1.23"
/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "db-5.3.21"
+#define PACKAGE_TARNAME "db-6.1.23"
/* Define to the home page for this package. */
#define PACKAGE_URL "http://www.oracle.com/technology/software/products/berkeley-db/index.html"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "5.3.21"
+#define PACKAGE_VERSION "6.1.23"
/* The size of `char', as computed by sizeof. */
#define SIZEOF_CHAR 1
@@ -586,6 +617,9 @@
/* The size of `long long', as computed by sizeof. */
#define SIZEOF_LONG_LONG 8
+/* The size of `off_t', as computed by sizeof. */
+#define SIZEOF_OFF_T
+
/* The size of `short', as computed by sizeof. */
#define SIZEOF_SHORT 2
diff --git a/build_android/db_int.h b/build_android/db_int.h
index 588e035c..8f15bd02 100644
--- a/build_android/db_int.h
+++ b/build_android/db_int.h
@@ -2,7 +2,7 @@
/*-
* See the file LICENSE for redistribution information.
*
- * Copyright (c) 1996, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015 Oracle and/or its affiliates. All rights reserved.
*
* $Id$
*/
@@ -74,6 +74,17 @@
#endif /* !HAVE_SYSTEM_INCLUDE_FILES */
+/*
+ * The Windows compiler needs to be told about structures that are available
+ * outside a dll.
+ */
+#if defined(DB_WIN32) && defined(_MSC_VER) && \
+ !defined(DB_CREATE_DLL) && !defined(_LIB)
+#define __DB_IMPORT __declspec(dllimport)
+#else
+#define __DB_IMPORT
+#endif
+
#ifdef DB_WIN32
#include "dbinc/win_db.h"
#endif
@@ -89,22 +100,12 @@
#include "dbinc/queue.h"
#include "dbinc/shqueue.h"
#include "dbinc/perfmon.h"
+#include "dbinc/clock.h"
#if defined(__cplusplus)
extern "C" {
#endif
-/*
- * The Windows compiler needs to be told about structures that are available
- * outside a dll.
- */
-#if defined(DB_WIN32) && defined(_MSC_VER) && \
- !defined(DB_CREATE_DLL) && !defined(_LIB)
-#define __DB_IMPORT __declspec(dllimport)
-#else
-#define __DB_IMPORT
-#endif
-
/*******************************************************
* Forward structure declarations.
*******************************************************/
@@ -367,22 +368,27 @@ typedef struct __fn {
/*
* Structure used for callback message aggregation.
*
- * Display values in XXX_stat_print calls.
+ * DB_MSGBUF_FLUSH displays values in XXX_stat_print calls.
+ * DB_MSGBUF_REP_FLUSH displays replication system messages.
*/
typedef struct __db_msgbuf {
char *buf; /* Heap allocated buffer. */
char *cur; /* Current end of message. */
size_t len; /* Allocated length of buffer. */
+ int flags;
} DB_MSGBUF;
+#define DB_MSGBUF_PREALLOCATED 0x0001
+
#define DB_MSGBUF_INIT(a) do { \
(a)->buf = (a)->cur = NULL; \
- (a)->len = 0; \
+ (a)->len = (a)->flags = 0; \
} while (0)
#define DB_MSGBUF_FLUSH(env, a) do { \
if ((a)->buf != NULL) { \
if ((a)->cur != (a)->buf) \
__db_msg(env, "%s", (a)->buf); \
- __os_free(env, (a)->buf); \
+ if (!F_ISSET((a), DB_MSGBUF_PREALLOCATED)) \
+ __os_free(env, (a)->buf); \
DB_MSGBUF_INIT(a); \
} \
} while (0)
@@ -393,18 +399,14 @@ typedef struct __db_msgbuf {
if (regular_msg) \
DB_MSGBUF_FLUSH(env, a); \
else { \
- __os_free(env, (a)->buf); \
+ if (!F_ISSET((a), DB_MSGBUF_PREALLOCATED)) \
+ __os_free(env, (a)->buf); \
DB_MSGBUF_INIT(a); \
} \
} \
} while (0)
-#define STAT_FMT(msg, fmt, type, v) do { \
- DB_MSGBUF __mb; \
- DB_MSGBUF_INIT(&__mb); \
- __db_msgadd(env, &__mb, fmt, (type)(v)); \
- __db_msgadd(env, &__mb, "\t%s", msg); \
- DB_MSGBUF_FLUSH(env, &__mb); \
-} while (0)
+#define STAT_FMT(msg, fmt, type, v) \
+ __db_msg(env, fmt "\t%s", (type)(v), msg);
#define STAT_HEX(msg, v) \
__db_msg(env, "%#lx\t%s", (u_long)(v), msg)
#define STAT_ISSET(msg, p) \
@@ -442,25 +444,21 @@ typedef struct __db_msgbuf {
*
* Error message IDs are automatically assigned by dist/s_message_id script.
*/
-#ifdef HAVE_LOCALIZATION
-#define _(msg) msg /* Replace with localization function. */
-#else
-#define _(msg) msg
-#endif
-
#ifdef HAVE_STRIPPED_MESSAGES
#define DB_STR_C(msg, fmt) fmt
#else
-#define DB_STR_C(msg, fmt) _(msg)
+#define DB_STR_C(msg, fmt) msg
#endif
-#define DB_MSGID(id) "BDB" id
-
-#define DB_STR(id, msg) DB_MSGID(id) " " DB_STR_C(msg, "")
-
-#define DB_STR_A(id, msg, fmt) DB_MSGID(id) " " DB_STR_C(msg, fmt)
+#ifdef HAVE_LOCALIZATION
+#define _(msg) (msg) /* Replace with localization function. */
+#else
+#define _(msg) msg
+#endif
-#define DB_STR_P(msg) _(msg)
+#define DB_STR(id, msg) _("BDB" id " " DB_STR_C(msg, ""))
+#define DB_STR_A(id, msg, fmt) _("BDB" id " " DB_STR_C(msg, fmt))
+#define DB_STR_P(msg) _(msg)
/*
* There are quite a few places in Berkeley DB where we want to initialize
@@ -543,6 +541,7 @@ typedef struct __db_msgbuf {
/* Type passed to __db_appname(). */
typedef enum {
DB_APP_NONE=0, /* No type (region). */
+ DB_APP_BLOB, /* Blob file. */
DB_APP_DATA, /* Data file. */
DB_APP_LOG, /* Log file. */
DB_APP_META, /* Persistent metadata file. */
@@ -613,8 +612,13 @@ typedef enum {
if (F_ISSET((env), ENV_OPEN_CALLED)) \
ENV_REQUIRES_CONFIG(env, handle, i, flags)
+/*
+ * The ENV_ENTER and ENV_LEAVE macros announce to other threads that
+ * the current thread is entering or leaving the BDB api.
+ */
#define ENV_ENTER_RET(env, ip, ret) do { \
ret = 0; \
+ DISCARD_HISTORY(env); \
PANIC_CHECK_RET(env, ret); \
if (ret == 0) { \
if ((env)->thr_hashtab == NULL) \
@@ -632,6 +636,10 @@ typedef enum {
return (__ret); \
} while (0)
+/*
+ * Publicize the current thread's intention to run failchk. This invokes
+ * DB_ENV->is_alive() in the mutex code, to avoid hanging on dead processes.
+ */
#define FAILCHK_THREAD(env, ip) do { \
if ((ip) != NULL) \
(ip)->dbth_state = THREAD_FAILCHK; \
@@ -639,20 +647,15 @@ typedef enum {
#define ENV_GET_THREAD_INFO(env, ip) ENV_ENTER(env, ip)
-#ifdef DIAGNOSTIC
#define ENV_LEAVE(env, ip) do { \
- if ((ip) != NULL) { \
- DB_ASSERT(env, ((ip)->dbth_state == THREAD_ACTIVE || \
- (ip)->dbth_state == THREAD_FAILCHK)); \
+ if ((ip) != NULL) { \
+ DB_ASSERT((env), (ip)->dbth_state == THREAD_ACTIVE || \
+ (ip)->dbth_state == THREAD_FAILCHK); \
(ip)->dbth_state = THREAD_OUT; \
} \
} while (0)
-#else
-#define ENV_LEAVE(env, ip) do { \
- if ((ip) != NULL) \
- (ip)->dbth_state = THREAD_OUT; \
-} while (0)
-#endif
+
+
#ifdef DIAGNOSTIC
#define CHECK_THREAD(env) do { \
if ((env)->thr_hashtab != NULL) \
@@ -689,6 +692,23 @@ typedef struct __pin_list {
} PIN_LIST;
#define PINMAX 4
+typedef enum {
+ MUTEX_ACTION_UNLOCKED=0,
+ MUTEX_ACTION_INTEND_SHARE, /* Thread is attempting a read-lock. */
+ MUTEX_ACTION_SHARED /* Thread has gotten a read lock. */
+} MUTEX_ACTION;
+
+typedef struct __mutex_state { /* SHARED */
+ db_mutex_t mutex;
+ MUTEX_ACTION action;
+#ifdef DIAGNOSTIC
+ db_timespec when;
+#endif
+} MUTEX_STATE;
+
+#define MUTEX_STATE_MAX 10 /* It only needs enough for shared latches. */
+
+
struct __db_thread_info { /* SHARED */
pid_t dbth_pid;
db_threadid_t dbth_tid;
@@ -708,11 +728,25 @@ struct __db_thread_info { /* SHARED */
u_int16_t dbth_pinmax; /* Number of slots allocated. */
roff_t dbth_pinlist; /* List of pins. */
PIN_LIST dbth_pinarray[PINMAX]; /* Initial array of slots. */
+
+ /*
+ * While thread tracking is active this caches one of the lockers
+ * created by each thread. This locker remains allocated, with an
+ * invalid id, even after the locker id is freed.
+ */
+ roff_t dbth_local_locker;
+ /*
+ * Each latch shared by this thread has an entry here. Exclusive
+ * ownership, for both latches and mutexes, are in the DB_MUTEX.
+ */
+ MUTEX_STATE dbth_latches[MUTEX_STATE_MAX];
#ifdef DIAGNOSTIC
roff_t dbth_locker; /* Current locker for this thread. */
u_int32_t dbth_check_off; /* Count of number of LOCK_OFF calls. */
#endif
+ db_timespec dbth_failtime; /* Time when its crash was detected. */
};
+
#ifdef DIAGNOSTIC
#define LOCK_CHECK_OFF(ip) if ((ip) != NULL) \
(ip)->dbth_check_off++
@@ -730,7 +764,7 @@ struct __db_thread_info { /* SHARED */
#define LOCK_CHECK(dbc, pgno, mode) NOP_STATEMENT
#endif
-typedef struct __env_thread_info {
+typedef struct __env_thread_info { /* SHARED */
u_int32_t thr_count;
u_int32_t thr_init;
u_int32_t thr_max;
@@ -804,6 +838,11 @@ struct __env {
#define ENV_DEF_DATA_LEN 100
u_int32_t data_len; /* Data length in __db_prbytes. */
+ /* Registered processes */
+ size_t num_active_pids; /* number of entries in active_pids */
+ size_t size_active_pids; /* allocated size of active_pids */
+ pid_t *active_pids; /* array active pids */
+
/* Thread tracking */
u_int32_t thr_nbucket; /* Number of hash buckets */
DB_HASHTAB *thr_hashtab; /* Hash table of DB_THREAD_INFO */
@@ -867,6 +906,7 @@ struct __env {
#define DB_TEST_PREOPEN 10 /* before __os_open */
#define DB_TEST_REPMGR_PERM 11 /* repmgr perm/archiving tests */
#define DB_TEST_SUBDB_LOCKS 12 /* subdb locking tests */
+#define DB_TEST_REPMGR_HEARTBEAT 13 /* repmgr stop sending heartbeats */
int test_abort; /* Abort value for testing */
int test_check; /* Checkpoint value for testing */
int test_copy; /* Copy value for testing */
@@ -882,7 +922,9 @@ struct __env {
#define ENV_REF_COUNTED 0x00000100 /* Region references this handle */
#define ENV_SYSTEM_MEM 0x00000200 /* DB_SYSTEM_MEM set */
#define ENV_THREAD 0x00000400 /* DB_THREAD set */
-#define ENV_FORCE_TXN_BULK 0x00000800 /* Txns use bulk mode-for testing */
+#define ENV_FORCE_TXN_BULK 0x00000800 /* Txns use bulk mode-for testing */
+#define ENV_REMEMBER_PANIC 0x00001000 /* Panic was on during cleanup. */
+#define ENV_FORCESYNCENV 0x00002000 /* Force msync on closing. */
u_int32_t flags;
};
@@ -1107,7 +1149,6 @@ typedef struct __dbpginfo {
#include "dbinc/globals.h"
-#include "dbinc/clock.h"
#include "dbinc/debug.h"
#include "dbinc/region.h"
#include "dbinc_auto/env_ext.h"
@@ -1119,6 +1160,7 @@ typedef struct __dbpginfo {
#include "dbinc/os.h"
#include "dbinc_auto/clib_ext.h"
#include "dbinc_auto/common_ext.h"
+#include "dbinc_auto/blob_ext.h"
/*******************************************************
* Remaining Log.
diff --git a/build_android/jdbc/jni/Android.mk b/build_android/jdbc/jni/Android.mk
index d38b6421..8a8b1792 100644
--- a/build_android/jdbc/jni/Android.mk
+++ b/build_android/jdbc/jni/Android.mk
@@ -1,6 +1,6 @@
# DO NOT EDIT: automatically built by dist/s_android.
# Makefile for building Android.JDBC for DBSQL
-# Berkeley DB 11g Release 2, library version 11.2.5.3.21: (May 11, 2012)
+# Berkeley DB 12c Release 1, library version 12.1.6.1.23: (February 17, 2015)
#
# This Makefile will generate 3 files:
# 1. Static libdb_sql library. An internal library and users don't
@@ -10,6 +10,7 @@
# Android directly.
###################################################################
LOCAL_PATH := $(call my-dir)
+BDB_ENABLE_ENCRYPTION := false
###################################################################
# Common variables
@@ -43,6 +44,10 @@ COMMON_CFLAGS := -Wall -DHAVE_USLEEP=1 \
-D_HAVE_SQLITE_CONFIG_H -DSQLITE_THREAD_OVERRIDE_LOCK=-1 \
-DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_BACKWARDS -Dfdatasync=fsync
+ifeq ($(BDB_ENABLE_ENCRYPTION),true)
+COMMON_CFLAGS += -DSQLITE_HAS_CODEC -DHAVE_CRYPTO -DHAVE_SQLITE3_KEY
+endif
+
# Required for JDBC building
# Most of these are from configured <db>/lang/sql/jdbc/Makefile.in
COMMON_CFLAGS += \
@@ -66,7 +71,6 @@ COMMON_CFLAGS += \
-DHAVE_SQLITE3_BIND_PARAMETER_INDEX=1 \
-DHAVE_SQLITE3_RESULT_ZEROBLOB=1 \
-DHAVE_SQLITE3_INCRBLOBIO=1 \
- -DHAVE_SQLITE3_KEY=0 \
-DHAVE_SQLITE3_SHARED_CACHE=1 \
-DHAVE_SQLITE3_OPEN_V2=1 \
-DHAVE_SQLITE3_LOAD_EXTENSION=0 \
@@ -96,6 +100,10 @@ LOCAL_CFLAGS += $(COMMON_CFLAGS)
# Source files
LOCAL_SRC_FILES := \
+ $(BDB_TOP)/src/blob/blob_fileops.c \
+ $(BDB_TOP)/src/blob/blob_page.c \
+ $(BDB_TOP)/src/blob/blob_stream.c \
+ $(BDB_TOP)/src/blob/blob_util.c \
$(BDB_TOP)/src/btree/bt_compact.c \
$(BDB_TOP)/src/btree/bt_compare.c \
$(BDB_TOP)/src/btree/bt_compress.c \
@@ -118,7 +126,6 @@ LOCAL_SRC_FILES := \
$(BDB_TOP)/src/clib/rand.c \
$(BDB_TOP)/src/clib/snprintf.c \
$(BDB_TOP)/src/common/clock.c \
- $(BDB_TOP)/src/common/crypto_stub.c \
$(BDB_TOP)/src/common/db_byteorder.c \
$(BDB_TOP)/src/common/db_compint.c \
$(BDB_TOP)/src/common/db_err.c \
@@ -254,6 +261,7 @@ LOCAL_SRC_FILES := \
$(BDB_TOP)/src/os/os_path.c \
$(BDB_TOP)/src/os/os_pid.c \
$(BDB_TOP)/src/os/os_rename.c \
+ $(BDB_TOP)/src/os/os_rmdir.c \
$(BDB_TOP)/src/os/os_root.c \
$(BDB_TOP)/src/os/os_rpath.c \
$(BDB_TOP)/src/os/os_rw.c \
@@ -282,6 +290,17 @@ LOCAL_SRC_FILES := \
$(BDB_TOP)/src/txn/txn_util.c \
$(BDB_TOP)/lang/sql/generated/sqlite3.c
+ifeq ($(BDB_ENABLE_ENCRYPTION),true)
+LOCAL_SRC_FILES += \
+ $(BDB_TOP)/src/crypto/crypto.c \
+ $(BDB_TOP)/src/crypto/aes_method.c \
+ $(BDB_TOP)/src/crypto/mersenne/mt19937db.c \
+ $(BDB_TOP)/src/crypto/rijndael/rijndael-api-fst.c \
+ $(BDB_TOP)/src/crypto/rijndael/rijndael-alg-fst.c
+else
+LOCAL_SRC_FILES += $(BDB_TOP)/src/common/crypto_stub.c
+endif
+
ifneq ($(TARGET_ARCH),arm)
LOCAL_LDLIBS += -lpthread -ldl
endif
@@ -343,3 +362,397 @@ LOCAL_MODULE_TAGS := debug
include $(BUILD_EXECUTABLE)
endif # !SDK_ONLY
+
+################################################################################
+##device commande line tool:db_archive
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_archive
+include $(CLEAR_VARS)
+LOCAL_MODULE := db_archive
+
+LOCAL_ARM_MODE := arm
+LOCAL_STATIC_LIBRARIES := libdb_sql_static # Based on above static library
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_archive.c \
+ $(BDB_TOP)/src/common/util_sig.c
+
+# Import common flags
+LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
+LOCAL_CFLAGS += $(COMMON_CFLAGS)
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+
+################################################################################
+##device commande line tool:db_checkpoint
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_checkpoint
+include $(CLEAR_VARS)
+LOCAL_MODULE := db_checkpoint
+
+LOCAL_ARM_MODE := arm
+LOCAL_STATIC_LIBRARIES := libdb_sql_static # Based on above static library
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_checkpoint.c \
+ $(BDB_TOP)/src/common/util_log.c \
+ $(BDB_TOP)/src/common/util_sig.c
+
+# Import common flags
+LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
+LOCAL_CFLAGS += $(COMMON_CFLAGS)
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+
+################################################################################
+##device commande line tool:db_deadlock
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_deadlock
+include $(CLEAR_VARS)
+LOCAL_MODULE := db_deadlock
+
+LOCAL_ARM_MODE := arm
+LOCAL_STATIC_LIBRARIES := libdb_sql_static # Based on above static library
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_deadlock.c \
+ $(BDB_TOP)/src/common/util_log.c \
+ $(BDB_TOP)/src/common/util_sig.c
+
+# Import common flags
+LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
+LOCAL_CFLAGS += $(COMMON_CFLAGS)
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+
+################################################################################
+##device commande line tool:db_dump
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_dump
+include $(CLEAR_VARS)
+LOCAL_MODULE := db_dump
+
+LOCAL_ARM_MODE := arm
+LOCAL_STATIC_LIBRARIES := libdb_sql_static # Based on above static library
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_dump.c \
+ $(BDB_TOP)/src/common/util_cache.c \
+ $(BDB_TOP)/src/common/util_sig.c
+
+# Import common flags
+LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
+LOCAL_CFLAGS += $(COMMON_CFLAGS)
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+
+################################################################################
+##device commande line tool:db_hotbackup
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_hotbackup
+include $(CLEAR_VARS)
+LOCAL_MODULE := db_hotbackup
+
+LOCAL_ARM_MODE := arm
+LOCAL_STATIC_LIBRARIES := libdb_sql_static # Based on above static library
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_hotbackup.c \
+ $(BDB_TOP)/src/common/util_sig.c
+
+# Import common flags
+LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
+LOCAL_CFLAGS += $(COMMON_CFLAGS)
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+
+################################################################################
+##device commande line tool:db_load
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_load
+include $(CLEAR_VARS)
+LOCAL_MODULE := db_load
+
+LOCAL_ARM_MODE := arm
+LOCAL_STATIC_LIBRARIES := libdb_sql_static # Based on above static library
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_load.c \
+ $(BDB_TOP)/src/common/util_cache.c \
+ $(BDB_TOP)/src/common/util_sig.c
+
+# Import common flags
+LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
+LOCAL_CFLAGS += $(COMMON_CFLAGS)
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+
+################################################################################
+##device commande line tool:db_printlog
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_printlog
+include $(CLEAR_VARS)
+LOCAL_MODULE := db_printlog
+
+LOCAL_ARM_MODE := arm
+LOCAL_STATIC_LIBRARIES := libdb_sql_static # Based on above static library
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_printlog.c \
+ $(BDB_TOP)/src/common/util_sig.c \
+ $(BDB_TOP)/src/btree/btree_autop.c \
+ $(BDB_TOP)/src/db/crdel_autop.c \
+ $(BDB_TOP)/src/db/db_autop.c \
+ $(BDB_TOP)/src/dbreg/dbreg_autop.c \
+ $(BDB_TOP)/src/fileops/fileops_autop.c \
+ $(BDB_TOP)/src/hash/hash_autop.c \
+ $(BDB_TOP)/src/heap/heap_autop.c \
+ $(BDB_TOP)/src/qam/qam_autop.c \
+ $(BDB_TOP)/src/repmgr/repmgr_autop.c \
+ $(BDB_TOP)/src/txn/txn_autop.c
+
+# Import common flags
+LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
+LOCAL_CFLAGS += $(COMMON_CFLAGS)
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+
+################################################################################
+##device commande line tool:db_recover
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_recover
+include $(CLEAR_VARS)
+LOCAL_MODULE := db_recover
+
+LOCAL_ARM_MODE := arm
+LOCAL_STATIC_LIBRARIES := libdb_sql_static # Based on above static library
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_recover.c \
+ $(BDB_TOP)/src/common/util_sig.c
+
+# Import common flags
+LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
+LOCAL_CFLAGS += $(COMMON_CFLAGS)
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+
+################################################################################
+##device commande line tool:db_replicate
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_replicate
+include $(CLEAR_VARS)
+LOCAL_MODULE := db_replicate
+
+LOCAL_ARM_MODE := arm
+LOCAL_STATIC_LIBRARIES := libdb_sql_static # Based on above static library
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_replicate.c \
+ $(BDB_TOP)/src/common/util_sig.c
+
+# Import common flags
+LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
+LOCAL_CFLAGS += $(COMMON_CFLAGS)
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+
+################################################################################
+##device commande line tool:db_stat
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_stat
+include $(CLEAR_VARS)
+LOCAL_MODULE := db_stat
+
+LOCAL_ARM_MODE := arm
+LOCAL_STATIC_LIBRARIES := libdb_sql_static # Based on above static library
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_stat.c \
+ $(BDB_TOP)/src/common/util_cache.c \
+ $(BDB_TOP)/src/common/util_sig.c
+
+# Import common flags
+LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
+LOCAL_CFLAGS += $(COMMON_CFLAGS)
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+
+################################################################################
+##device commande line tool:db_tuner
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_tuner
+include $(CLEAR_VARS)
+LOCAL_MODULE := db_tuner
+
+LOCAL_ARM_MODE := arm
+LOCAL_STATIC_LIBRARIES := libdb_sql_static # Based on above static library
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_tuner.c \
+ $(BDB_TOP)/src/common/util_sig.c
+
+# Import common flags
+LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
+LOCAL_CFLAGS += $(COMMON_CFLAGS)
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+
+################################################################################
+##device commande line tool:db_upgrade
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_upgrade
+include $(CLEAR_VARS)
+LOCAL_MODULE := db_upgrade
+
+LOCAL_ARM_MODE := arm
+LOCAL_STATIC_LIBRARIES := libdb_sql_static # Based on above static library
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_upgrade.c \
+ $(BDB_TOP)/src/common/util_sig.c
+
+# Import common flags
+LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
+LOCAL_CFLAGS += $(COMMON_CFLAGS)
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+
+################################################################################
+##device commande line tool:db_verify
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_verify
+include $(CLEAR_VARS)
+LOCAL_MODULE := db_verify
+
+LOCAL_ARM_MODE := arm
+LOCAL_STATIC_LIBRARIES := libdb_sql_static # Based on above static library
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_verify.c \
+ $(BDB_TOP)/src/common/util_cache.c \
+ $(BDB_TOP)/src/common/util_sig.c
+
+# Import common flags
+LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
+LOCAL_CFLAGS += $(COMMON_CFLAGS)
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
+
+
+################################################################################
+##device commande line tool:db_log_verify
+################################################################################
+ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of db_log_verify
+include $(CLEAR_VARS)
+LOCAL_MODULE := db_log_verify
+
+LOCAL_ARM_MODE := arm
+LOCAL_STATIC_LIBRARIES := libdb_sql_static # Based on above static library
+LOCAL_SRC_FILES := \
+ $(BDB_TOP)/util/db_log_verify.c \
+ $(BDB_TOP)/src/common/util_cache.c \
+ $(BDB_TOP)/src/common/util_sig.c
+
+# Import common flags
+LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
+LOCAL_CFLAGS += $(COMMON_CFLAGS)
+
+ifneq ($(TARGET_ARCH),arm)
+LOCAL_LDLIBS += -lpthread -ldl
+endif
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+include $(BUILD_EXECUTABLE)
+endif # !SDK_ONLY
diff --git a/build_android/sql/config.h b/build_android/sql/config.h
index 5a854d04..9c000289 100644
--- a/build_android/sql/config.h
+++ b/build_android/sql/config.h
@@ -90,13 +90,13 @@
#define PACKAGE_NAME "sqlite"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "sqlite 3.7.6.2"
+#define PACKAGE_STRING "sqlite 3.8.3.1"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "sqlite"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "3.7.6.2"
+#define PACKAGE_VERSION "3.8.3.1"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1