Commit 2d528980 authored by Yoni Fogel's avatar Yoni Fogel

Closes #1378 Merged all changes into main.

git-svn-id: file:///svn/toku/tokudb@9507 c7de825b-a66e-492c-adef-691d508d4ae1
parent a619466c
......@@ -28,6 +28,9 @@ typedef struct __toku_db_txn_stat DB_TXN_STAT;
typedef struct __toku_dbc DBC;
typedef struct __toku_dbt DBT;
typedef u_int32_t db_recno_t;
typedef int(*YDB_CALLBACK_FUNCTION)(DBT const*, DBT const*, void*);
typedef int(*YDB_HEAVISIDE_CALLBACK_FUNCTION)(DBT const *key, DBT const *value, void *extra_f, int r_h);
typedef int(*YDB_HEAVISIDE_FUNCTION)(const DBT *key, const DBT *value, void *extra_h);
typedef enum {
DB_BTREE=1,
DB_UNKNOWN=5
......@@ -69,7 +72,6 @@ typedef enum {
#define DB_INIT_TXN 32768
#define DB_USE_ENVIRON 512
#define DB_USE_ENVIRON_ROOT 1024
#define DB_KEYEMPTY -30998
#define DB_KEYEXIST -30997
#define DB_LOCK_DEADLOCK -30996
#define DB_LOCK_NOTGRANTED -30995
......@@ -103,6 +105,8 @@ typedef enum {
#define TOKUDB_OUT_OF_LOCKS -100000
#define TOKUDB_SUCCEEDED_EARLY -100001
#define TOKUDB_DIRTY_DICTIONARY -100004
#define TOKUDB_FOUND_BUT_REJECTED -100002
#define TOKUDB_USER_CALLBACK_ERROR -100003
/* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/
#ifdef _TOKUDB_WRAP_H
#undef txn_begin
......@@ -182,16 +186,14 @@ struct __toku_db {
void* __toku_dummy0[26];
char __toku_dummy1[96];
void *api_internal; /* 32-bit offset=236 size=4, 64=bit offset=376 size=8 */
void* __toku_dummy2[4];
int (*associate) (DB*, DB_TXN*, DB*, int(*)(DB*, const DBT*, const DBT*, DBT*), u_int32_t); /* 32-bit offset=256 size=4, 64=bit offset=416 size=8 */
void* __toku_dummy2[5];
int (*close) (DB*, u_int32_t); /* 32-bit offset=260 size=4, 64=bit offset=424 size=8 */
int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t); /* 32-bit offset=264 size=4, 64=bit offset=432 size=8 */
int (*del) (DB *, DB_TXN *, DBT *, u_int32_t); /* 32-bit offset=268 size=4, 64=bit offset=440 size=8 */
void* __toku_dummy3[2];
int (*fd) (DB *, int *); /* 32-bit offset=280 size=4, 64=bit offset=464 size=8 */
int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t); /* 32-bit offset=284 size=4, 64=bit offset=472 size=8 */
int (*pget) (DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t); /* 32-bit offset=288 size=4, 64=bit offset=480 size=8 */
void* __toku_dummy4[3];
void* __toku_dummy4[4];
int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t); /* 32-bit offset=304 size=4, 64=bit offset=512 size=8 */
int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int); /* 32-bit offset=308 size=4, 64=bit offset=520 size=8 */
int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t); /* 32-bit offset=312 size=4, 64=bit offset=528 size=8 */
......@@ -249,26 +251,29 @@ struct __toku_db_txn_stat {
struct __toku_dbc {
DB *dbp; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
struct __toku_dbc_internal *i;
int (*c_getf_next)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_next_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_next_no_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_prev)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_prev_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_prev_no_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_current)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_first)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_last)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_heavi)(DBC *, u_int32_t, void(*f)(DBT const *, DBT const *, void *, int), void *extra_f, int (*h)(const DBT *key, const DBT *value, void *extra_h), void *extra_h, int direction);
void* __toku_dummy0[9];
int (*c_getf_first)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_last)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_next)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_next_dup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_next_nodup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_prev)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_prev_dup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_prev_nodup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_current)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_current_binding)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_heaviside)(DBC *, u_int32_t, YDB_HEAVISIDE_CALLBACK_FUNCTION f, void *extra_f, YDB_HEAVISIDE_FUNCTION h, void *extra_h, int direction);
int (*c_getf_set)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_set_range)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_get_both)(DBC *, u_int32_t, DBT *, DBT *, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_get_both_range)(DBC *, u_int32_t, DBT *, DBT *, YDB_CALLBACK_FUNCTION, void *);
void* __toku_dummy0[4];
char __toku_dummy1[104];
int (*c_close) (DBC *); /* 32-bit offset=188 size=4, 64=bit offset=272 size=8 */
int (*c_count) (DBC *, db_recno_t *, u_int32_t); /* 32-bit offset=192 size=4, 64=bit offset=280 size=8 */
int (*c_del) (DBC *, u_int32_t); /* 32-bit offset=196 size=4, 64=bit offset=288 size=8 */
void* __toku_dummy2[1];
int (*c_get) (DBC *, DBT *, DBT *, u_int32_t); /* 32-bit offset=204 size=4, 64=bit offset=304 size=8 */
int (*c_pget) (DBC *, DBT *, DBT *, DBT *, u_int32_t); /* 32-bit offset=208 size=4, 64=bit offset=312 size=8 */
int (*c_put) (DBC *, DBT *, DBT *, u_int32_t); /* 32-bit offset=212 size=4, 64=bit offset=320 size=8 */
void* __toku_dummy3[9]; /* Padding at the end */
void* __toku_dummy3[11]; /* Padding at the end */
};
struct __toku_dbt {
void*data; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
......
......@@ -28,6 +28,9 @@ typedef struct __toku_db_txn_stat DB_TXN_STAT;
typedef struct __toku_dbc DBC;
typedef struct __toku_dbt DBT;
typedef u_int32_t db_recno_t;
typedef int(*YDB_CALLBACK_FUNCTION)(DBT const*, DBT const*, void*);
typedef int(*YDB_HEAVISIDE_CALLBACK_FUNCTION)(DBT const *key, DBT const *value, void *extra_f, int r_h);
typedef int(*YDB_HEAVISIDE_FUNCTION)(const DBT *key, const DBT *value, void *extra_h);
typedef enum {
DB_BTREE=1,
DB_UNKNOWN=5
......@@ -69,7 +72,6 @@ typedef enum {
#define DB_INIT_TXN 131072
#define DB_USE_ENVIRON 1024
#define DB_USE_ENVIRON_ROOT 2048
#define DB_KEYEMPTY -30997
#define DB_KEYEXIST -30996
#define DB_LOCK_DEADLOCK -30995
#define DB_LOCK_NOTGRANTED -30994
......@@ -105,6 +107,8 @@ typedef enum {
#define TOKUDB_OUT_OF_LOCKS -100000
#define TOKUDB_SUCCEEDED_EARLY -100001
#define TOKUDB_DIRTY_DICTIONARY -100004
#define TOKUDB_FOUND_BUT_REJECTED -100002
#define TOKUDB_USER_CALLBACK_ERROR -100003
/* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/
#ifdef _TOKUDB_WRAP_H
#undef txn_begin
......@@ -192,16 +196,14 @@ struct __toku_db {
void* __toku_dummy0[29];
char __toku_dummy1[96];
void *api_internal; /* 32-bit offset=248 size=4, 64=bit offset=400 size=8 */
void* __toku_dummy2[4];
int (*associate) (DB*, DB_TXN*, DB*, int(*)(DB*, const DBT*, const DBT*, DBT*), u_int32_t); /* 32-bit offset=268 size=4, 64=bit offset=440 size=8 */
void* __toku_dummy2[5];
int (*close) (DB*, u_int32_t); /* 32-bit offset=272 size=4, 64=bit offset=448 size=8 */
int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t); /* 32-bit offset=276 size=4, 64=bit offset=456 size=8 */
int (*del) (DB *, DB_TXN *, DBT *, u_int32_t); /* 32-bit offset=280 size=4, 64=bit offset=464 size=8 */
void* __toku_dummy3[3];
int (*fd) (DB *, int *); /* 32-bit offset=296 size=4, 64=bit offset=496 size=8 */
int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t); /* 32-bit offset=300 size=4, 64=bit offset=504 size=8 */
int (*pget) (DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t); /* 32-bit offset=304 size=4, 64=bit offset=512 size=8 */
void* __toku_dummy4[7];
void* __toku_dummy4[8];
int (*get_flags) (DB *, u_int32_t *); /* 32-bit offset=336 size=4, 64=bit offset=576 size=8 */
void* __toku_dummy5[2];
int (*get_pagesize) (DB *, u_int32_t *); /* 32-bit offset=348 size=4, 64=bit offset=600 size=8 */
......@@ -265,26 +267,29 @@ struct __toku_db_txn_stat {
struct __toku_dbc {
DB *dbp; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
struct __toku_dbc_internal *i;
int (*c_getf_next)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_next_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_next_no_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_prev)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_prev_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_prev_no_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_current)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_first)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_last)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_heavi)(DBC *, u_int32_t, void(*f)(DBT const *, DBT const *, void *, int), void *extra_f, int (*h)(const DBT *key, const DBT *value, void *extra_h), void *extra_h, int direction);
void* __toku_dummy0[7];
int (*c_getf_first)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_last)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_next)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_next_dup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_next_nodup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_prev)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_prev_dup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_prev_nodup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_current)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_current_binding)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_heaviside)(DBC *, u_int32_t, YDB_HEAVISIDE_CALLBACK_FUNCTION f, void *extra_f, YDB_HEAVISIDE_FUNCTION h, void *extra_h, int direction);
int (*c_getf_set)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_set_range)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_get_both)(DBC *, u_int32_t, DBT *, DBT *, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_get_both_range)(DBC *, u_int32_t, DBT *, DBT *, YDB_CALLBACK_FUNCTION, void *);
void* __toku_dummy0[2];
char __toku_dummy1[112];
int (*c_close) (DBC *); /* 32-bit offset=188 size=4, 64=bit offset=264 size=8 */
int (*c_count) (DBC *, db_recno_t *, u_int32_t); /* 32-bit offset=192 size=4, 64=bit offset=272 size=8 */
int (*c_del) (DBC *, u_int32_t); /* 32-bit offset=196 size=4, 64=bit offset=280 size=8 */
void* __toku_dummy2[1];
int (*c_get) (DBC *, DBT *, DBT *, u_int32_t); /* 32-bit offset=204 size=4, 64=bit offset=296 size=8 */
int (*c_pget) (DBC *, DBT *, DBT *, DBT *, u_int32_t); /* 32-bit offset=208 size=4, 64=bit offset=304 size=8 */
int (*c_put) (DBC *, DBT *, DBT *, u_int32_t); /* 32-bit offset=212 size=4, 64=bit offset=312 size=8 */
void* __toku_dummy3[8]; /* Padding at the end */
void* __toku_dummy3[10]; /* Padding at the end */
};
struct __toku_dbt {
void*data; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
......
......@@ -28,6 +28,9 @@ typedef struct __toku_db_txn_stat DB_TXN_STAT;
typedef struct __toku_dbc DBC;
typedef struct __toku_dbt DBT;
typedef u_int32_t db_recno_t;
typedef int(*YDB_CALLBACK_FUNCTION)(DBT const*, DBT const*, void*);
typedef int(*YDB_HEAVISIDE_CALLBACK_FUNCTION)(DBT const *key, DBT const *value, void *extra_f, int r_h);
typedef int(*YDB_HEAVISIDE_FUNCTION)(const DBT *key, const DBT *value, void *extra_h);
typedef enum {
DB_BTREE=1,
DB_UNKNOWN=5
......@@ -70,7 +73,6 @@ typedef enum {
#define DB_USE_ENVIRON 2048
#define DB_USE_ENVIRON_ROOT 4096
#define DB_READ_UNCOMMITTED 67108864
#define DB_KEYEMPTY -30997
#define DB_KEYEXIST -30996
#define DB_LOCK_DEADLOCK -30995
#define DB_LOCK_NOTGRANTED -30994
......@@ -106,6 +108,8 @@ typedef enum {
#define TOKUDB_OUT_OF_LOCKS -100000
#define TOKUDB_SUCCEEDED_EARLY -100001
#define TOKUDB_DIRTY_DICTIONARY -100004
#define TOKUDB_FOUND_BUT_REJECTED -100002
#define TOKUDB_USER_CALLBACK_ERROR -100003
/* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/
#ifdef _TOKUDB_WRAP_H
#undef txn_begin
......@@ -195,8 +199,7 @@ struct __toku_db {
void* __toku_dummy0[31];
char __toku_dummy1[96];
void *api_internal; /* 32-bit offset=256 size=4, 64=bit offset=416 size=8 */
void* __toku_dummy2[4];
int (*associate) (DB*, DB_TXN*, DB*, int(*)(DB*, const DBT*, const DBT*, DBT*), u_int32_t); /* 32-bit offset=276 size=4, 64=bit offset=456 size=8 */
void* __toku_dummy2[5];
int (*close) (DB*, u_int32_t); /* 32-bit offset=280 size=4, 64=bit offset=464 size=8 */
void* __toku_dummy3[1];
int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t); /* 32-bit offset=288 size=4, 64=bit offset=480 size=8 */
......@@ -211,28 +214,28 @@ struct __toku_db {
void* __toku_dummy7[8];
int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t); /* 32-bit offset=408 size=4, 64=bit offset=720 size=8 */
int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int); /* 32-bit offset=412 size=4, 64=bit offset=728 size=8 */
int (*pget) (DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t); /* 32-bit offset=416 size=4, 64=bit offset=736 size=8 */
void* __toku_dummy8[1];
int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t); /* 32-bit offset=420 size=4, 64=bit offset=744 size=8 */
int (*remove) (DB *, const char *, const char *, u_int32_t); /* 32-bit offset=424 size=4, 64=bit offset=752 size=8 */
int (*rename) (DB *, const char *, const char *, const char *, u_int32_t); /* 32-bit offset=428 size=4, 64=bit offset=760 size=8 */
void* __toku_dummy8[2];
void* __toku_dummy9[2];
int (*set_bt_compare) (DB *, int (*)(DB *, const DBT *, const DBT *)); /* 32-bit offset=440 size=4, 64=bit offset=784 size=8 */
void* __toku_dummy9[3];
void* __toku_dummy10[3];
int (*set_dup_compare) (DB *, int (*)(DB *, const DBT *, const DBT *)); /* 32-bit offset=456 size=4, 64=bit offset=816 size=8 */
void* __toku_dummy10[2];
void (*set_errfile) (DB *, FILE*); /* 32-bit offset=468 size=4, 64=bit offset=840 size=8 */
void* __toku_dummy11[2];
void (*set_errfile) (DB *, FILE*); /* 32-bit offset=468 size=4, 64=bit offset=840 size=8 */
void* __toku_dummy12[2];
int (*set_flags) (DB *, u_int32_t); /* 32-bit offset=480 size=4, 64=bit offset=864 size=8 */
void* __toku_dummy12[6];
int (*set_pagesize) (DB *, u_int32_t); /* 32-bit offset=508 size=4, 64=bit offset=920 size=8 */
void* __toku_dummy13[6];
int (*set_pagesize) (DB *, u_int32_t); /* 32-bit offset=508 size=4, 64=bit offset=920 size=8 */
void* __toku_dummy14[6];
int (*stat) (DB *, void *, u_int32_t); /* 32-bit offset=536 size=4, 64=bit offset=976 size=8 */
void* __toku_dummy14[2];
void* __toku_dummy15[2];
int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t); /* 32-bit offset=548 size=4, 64=bit offset=1000 size=8 */
void* __toku_dummy15[1];
void* __toku_dummy16[1];
int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t); /* 32-bit offset=556 size=4, 64=bit offset=1016 size=8 */
void* __toku_dummy16[5]; /* Padding at the end */
char __toku_dummy17[16]; /* Padding at the end */
void* __toku_dummy17[5]; /* Padding at the end */
char __toku_dummy18[16]; /* Padding at the end */
};
struct __toku_db_txn_active {
u_int32_t txnid; /* 32-bit offset=0 size=4, 64=bit offset=0 size=4 */
......@@ -271,26 +274,29 @@ struct __toku_db_txn_stat {
struct __toku_dbc {
DB *dbp; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
struct __toku_dbc_internal *i;
int (*c_getf_next)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_next_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_next_no_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_prev)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_prev_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_prev_no_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_current)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_first)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_last)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_heavi)(DBC *, u_int32_t, void(*f)(DBT const *, DBT const *, void *, int), void *extra_f, int (*h)(const DBT *key, const DBT *value, void *extra_h), void *extra_h, int direction);
void* __toku_dummy0[9];
int (*c_getf_first)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_last)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_next)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_next_dup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_next_nodup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_prev)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_prev_dup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_prev_nodup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_current)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_current_binding)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_heaviside)(DBC *, u_int32_t, YDB_HEAVISIDE_CALLBACK_FUNCTION f, void *extra_f, YDB_HEAVISIDE_FUNCTION h, void *extra_h, int direction);
int (*c_getf_set)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_set_range)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_get_both)(DBC *, u_int32_t, DBT *, DBT *, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_get_both_range)(DBC *, u_int32_t, DBT *, DBT *, YDB_CALLBACK_FUNCTION, void *);
void* __toku_dummy0[4];
char __toku_dummy1[104];
int (*c_close) (DBC *); /* 32-bit offset=188 size=4, 64=bit offset=272 size=8 */
int (*c_count) (DBC *, db_recno_t *, u_int32_t); /* 32-bit offset=192 size=4, 64=bit offset=280 size=8 */
int (*c_del) (DBC *, u_int32_t); /* 32-bit offset=196 size=4, 64=bit offset=288 size=8 */
void* __toku_dummy2[1];
int (*c_get) (DBC *, DBT *, DBT *, u_int32_t); /* 32-bit offset=204 size=4, 64=bit offset=304 size=8 */
int (*c_pget) (DBC *, DBT *, DBT *, DBT *, u_int32_t); /* 32-bit offset=208 size=4, 64=bit offset=312 size=8 */
int (*c_put) (DBC *, DBT *, DBT *, u_int32_t); /* 32-bit offset=212 size=4, 64=bit offset=320 size=8 */
void* __toku_dummy3[8]; /* Padding at the end */
void* __toku_dummy3[10]; /* Padding at the end */
};
struct __toku_dbt {
void*data; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
......
......@@ -28,6 +28,9 @@ typedef struct __toku_db_txn_stat DB_TXN_STAT;
typedef struct __toku_dbc DBC;
typedef struct __toku_dbt DBT;
typedef u_int32_t db_recno_t;
typedef int(*YDB_CALLBACK_FUNCTION)(DBT const*, DBT const*, void*);
typedef int(*YDB_HEAVISIDE_CALLBACK_FUNCTION)(DBT const *key, DBT const *value, void *extra_f, int r_h);
typedef int(*YDB_HEAVISIDE_FUNCTION)(const DBT *key, const DBT *value, void *extra_h);
typedef enum {
DB_BTREE=1,
DB_UNKNOWN=5
......@@ -70,7 +73,6 @@ typedef enum {
#define DB_USE_ENVIRON 4096
#define DB_USE_ENVIRON_ROOT 8192
#define DB_READ_UNCOMMITTED 134217728
#define DB_KEYEMPTY -30997
#define DB_KEYEXIST -30996
#define DB_LOCK_DEADLOCK -30995
#define DB_LOCK_NOTGRANTED -30994
......@@ -106,6 +108,8 @@ typedef enum {
#define TOKUDB_OUT_OF_LOCKS -100000
#define TOKUDB_SUCCEEDED_EARLY -100001
#define TOKUDB_DIRTY_DICTIONARY -100004
#define TOKUDB_FOUND_BUT_REJECTED -100002
#define TOKUDB_USER_CALLBACK_ERROR -100003
/* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/
#ifdef _TOKUDB_WRAP_H
#undef txn_begin
......@@ -194,8 +198,7 @@ struct __toku_db {
void* __toku_dummy0[34];
char __toku_dummy1[96];
void *api_internal; /* 32-bit offset=268 size=4, 64=bit offset=440 size=8 */
void* __toku_dummy2[4];
int (*associate) (DB*, DB_TXN*, DB*, int(*)(DB*, const DBT*, const DBT*, DBT*), u_int32_t); /* 32-bit offset=288 size=4, 64=bit offset=480 size=8 */
void* __toku_dummy2[5];
int (*close) (DB*, u_int32_t); /* 32-bit offset=292 size=4, 64=bit offset=488 size=8 */
void* __toku_dummy3[1];
int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t); /* 32-bit offset=300 size=4, 64=bit offset=504 size=8 */
......@@ -210,28 +213,28 @@ struct __toku_db {
void* __toku_dummy7[8];
int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t); /* 32-bit offset=420 size=4, 64=bit offset=744 size=8 */
int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int); /* 32-bit offset=424 size=4, 64=bit offset=752 size=8 */
int (*pget) (DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t); /* 32-bit offset=428 size=4, 64=bit offset=760 size=8 */
void* __toku_dummy8[1];
int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t); /* 32-bit offset=432 size=4, 64=bit offset=768 size=8 */
int (*remove) (DB *, const char *, const char *, u_int32_t); /* 32-bit offset=436 size=4, 64=bit offset=776 size=8 */
int (*rename) (DB *, const char *, const char *, const char *, u_int32_t); /* 32-bit offset=440 size=4, 64=bit offset=784 size=8 */
void* __toku_dummy8[2];
void* __toku_dummy9[2];
int (*set_bt_compare) (DB *, int (*)(DB *, const DBT *, const DBT *)); /* 32-bit offset=452 size=4, 64=bit offset=808 size=8 */
void* __toku_dummy9[3];
void* __toku_dummy10[3];
int (*set_dup_compare) (DB *, int (*)(DB *, const DBT *, const DBT *)); /* 32-bit offset=468 size=4, 64=bit offset=840 size=8 */
void* __toku_dummy10[2];
void (*set_errfile) (DB *, FILE*); /* 32-bit offset=480 size=4, 64=bit offset=864 size=8 */
void* __toku_dummy11[2];
void (*set_errfile) (DB *, FILE*); /* 32-bit offset=480 size=4, 64=bit offset=864 size=8 */
void* __toku_dummy12[2];
int (*set_flags) (DB *, u_int32_t); /* 32-bit offset=492 size=4, 64=bit offset=888 size=8 */
void* __toku_dummy12[6];
int (*set_pagesize) (DB *, u_int32_t); /* 32-bit offset=520 size=4, 64=bit offset=944 size=8 */
void* __toku_dummy13[6];
int (*set_pagesize) (DB *, u_int32_t); /* 32-bit offset=520 size=4, 64=bit offset=944 size=8 */
void* __toku_dummy14[6];
int (*stat) (DB *, void *, u_int32_t); /* 32-bit offset=548 size=4, 64=bit offset=1000 size=8 */
void* __toku_dummy14[2];
void* __toku_dummy15[2];
int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t); /* 32-bit offset=560 size=4, 64=bit offset=1024 size=8 */
void* __toku_dummy15[1];
void* __toku_dummy16[1];
int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t); /* 32-bit offset=568 size=4, 64=bit offset=1040 size=8 */
void* __toku_dummy16[5]; /* Padding at the end */
char __toku_dummy17[16]; /* Padding at the end */
void* __toku_dummy17[5]; /* Padding at the end */
char __toku_dummy18[16]; /* Padding at the end */
};
struct __toku_db_txn_active {
u_int32_t txnid; /* 32-bit offset=0 size=4, 64=bit offset=0 size=4 */
......@@ -270,26 +273,29 @@ struct __toku_db_txn_stat {
struct __toku_dbc {
DB *dbp; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
struct __toku_dbc_internal *i;
int (*c_getf_next)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_next_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_next_no_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_prev)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_prev_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_prev_no_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_current)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_first)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_last)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_heavi)(DBC *, u_int32_t, void(*f)(DBT const *, DBT const *, void *, int), void *extra_f, int (*h)(const DBT *key, const DBT *value, void *extra_h), void *extra_h, int direction);
void* __toku_dummy0[13];
int (*c_getf_first)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_last)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_next)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_next_dup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_next_nodup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_prev)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_prev_dup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_prev_nodup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_current)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_current_binding)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_heaviside)(DBC *, u_int32_t, YDB_HEAVISIDE_CALLBACK_FUNCTION f, void *extra_f, YDB_HEAVISIDE_FUNCTION h, void *extra_h, int direction);
int (*c_getf_set)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_set_range)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_get_both)(DBC *, u_int32_t, DBT *, DBT *, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_get_both_range)(DBC *, u_int32_t, DBT *, DBT *, YDB_CALLBACK_FUNCTION, void *);
void* __toku_dummy0[8];
char __toku_dummy1[104];
int (*c_close) (DBC *); /* 32-bit offset=204 size=4, 64=bit offset=304 size=8 */
int (*c_count) (DBC *, db_recno_t *, u_int32_t); /* 32-bit offset=208 size=4, 64=bit offset=312 size=8 */
int (*c_del) (DBC *, u_int32_t); /* 32-bit offset=212 size=4, 64=bit offset=320 size=8 */
void* __toku_dummy2[1];
int (*c_get) (DBC *, DBT *, DBT *, u_int32_t); /* 32-bit offset=220 size=4, 64=bit offset=336 size=8 */
int (*c_pget) (DBC *, DBT *, DBT *, DBT *, u_int32_t); /* 32-bit offset=224 size=4, 64=bit offset=344 size=8 */
int (*c_put) (DBC *, DBT *, DBT *, u_int32_t); /* 32-bit offset=228 size=4, 64=bit offset=352 size=8 */
void* __toku_dummy3[8]; /* Padding at the end */
void* __toku_dummy3[10]; /* Padding at the end */
};
struct __toku_dbt {
void*data; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
......
......@@ -28,6 +28,9 @@ typedef struct __toku_db_txn_stat DB_TXN_STAT;
typedef struct __toku_dbc DBC;
typedef struct __toku_dbt DBT;
typedef u_int32_t db_recno_t;
typedef int(*YDB_CALLBACK_FUNCTION)(DBT const*, DBT const*, void*);
typedef int(*YDB_HEAVISIDE_CALLBACK_FUNCTION)(DBT const *key, DBT const *value, void *extra_f, int r_h);
typedef int(*YDB_HEAVISIDE_FUNCTION)(const DBT *key, const DBT *value, void *extra_h);
typedef enum {
DB_BTREE=1,
DB_UNKNOWN=5
......@@ -70,7 +73,6 @@ typedef enum {
#define DB_USE_ENVIRON 16384
#define DB_USE_ENVIRON_ROOT 32768
#define DB_READ_UNCOMMITTED 134217728
#define DB_KEYEMPTY -30997
#define DB_KEYEXIST -30996
#define DB_LOCK_DEADLOCK -30995
#define DB_LOCK_NOTGRANTED -30994
......@@ -89,6 +91,7 @@ typedef enum {
#define DB_NEXT_DUP 17
#define DB_NEXT_NODUP 18
#define DB_PREV 23
#define DB_PREV_DUP 24
#define DB_PREV_NODUP 25
#define DB_SET 26
#define DB_SET_RANGE 27
......@@ -107,6 +110,8 @@ typedef enum {
#define TOKUDB_OUT_OF_LOCKS -100000
#define TOKUDB_SUCCEEDED_EARLY -100001
#define TOKUDB_DIRTY_DICTIONARY -100004
#define TOKUDB_FOUND_BUT_REJECTED -100002
#define TOKUDB_USER_CALLBACK_ERROR -100003
/* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/
#ifdef _TOKUDB_WRAP_H
#undef txn_begin
......@@ -197,8 +202,7 @@ struct __toku_db {
void* __toku_dummy1[38];
char __toku_dummy2[80];
void *api_internal; /* 32-bit offset=276 size=4, 64=bit offset=464 size=8 */
void* __toku_dummy3[4];
int (*associate) (DB*, DB_TXN*, DB*, int(*)(DB*, const DBT*, const DBT*, DBT*), u_int32_t); /* 32-bit offset=296 size=4, 64=bit offset=504 size=8 */
void* __toku_dummy3[5];
int (*close) (DB*, u_int32_t); /* 32-bit offset=300 size=4, 64=bit offset=512 size=8 */
void* __toku_dummy4[1];
int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t); /* 32-bit offset=308 size=4, 64=bit offset=528 size=8 */
......@@ -213,28 +217,28 @@ struct __toku_db {
void* __toku_dummy8[9];
int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t); /* 32-bit offset=440 size=4, 64=bit offset=792 size=8 */
int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int); /* 32-bit offset=444 size=4, 64=bit offset=800 size=8 */
int (*pget) (DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t); /* 32-bit offset=448 size=4, 64=bit offset=808 size=8 */
void* __toku_dummy9[1];
int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t); /* 32-bit offset=452 size=4, 64=bit offset=816 size=8 */
int (*remove) (DB *, const char *, const char *, u_int32_t); /* 32-bit offset=456 size=4, 64=bit offset=824 size=8 */
int (*rename) (DB *, const char *, const char *, const char *, u_int32_t); /* 32-bit offset=460 size=4, 64=bit offset=832 size=8 */
void* __toku_dummy9[2];
void* __toku_dummy10[2];
int (*set_bt_compare) (DB *, int (*)(DB *, const DBT *, const DBT *)); /* 32-bit offset=472 size=4, 64=bit offset=856 size=8 */
void* __toku_dummy10[3];
void* __toku_dummy11[3];
int (*set_dup_compare) (DB *, int (*)(DB *, const DBT *, const DBT *)); /* 32-bit offset=488 size=4, 64=bit offset=888 size=8 */
void* __toku_dummy11[2];
void (*set_errfile) (DB *, FILE*); /* 32-bit offset=500 size=4, 64=bit offset=912 size=8 */
void* __toku_dummy12[2];
void (*set_errfile) (DB *, FILE*); /* 32-bit offset=500 size=4, 64=bit offset=912 size=8 */
void* __toku_dummy13[2];
int (*set_flags) (DB *, u_int32_t); /* 32-bit offset=512 size=4, 64=bit offset=936 size=8 */
void* __toku_dummy13[7];
int (*set_pagesize) (DB *, u_int32_t); /* 32-bit offset=544 size=4, 64=bit offset=1000 size=8 */
void* __toku_dummy14[7];
int (*set_pagesize) (DB *, u_int32_t); /* 32-bit offset=544 size=4, 64=bit offset=1000 size=8 */
void* __toku_dummy15[7];
int (*stat) (DB *, void *, u_int32_t); /* 32-bit offset=576 size=4, 64=bit offset=1064 size=8 */
void* __toku_dummy15[2];
void* __toku_dummy16[2];
int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t); /* 32-bit offset=588 size=4, 64=bit offset=1088 size=8 */
void* __toku_dummy16[1];
void* __toku_dummy17[1];
int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t); /* 32-bit offset=596 size=4, 64=bit offset=1104 size=8 */
void* __toku_dummy17[5]; /* Padding at the end */
char __toku_dummy18[16]; /* Padding at the end */
void* __toku_dummy18[5]; /* Padding at the end */
char __toku_dummy19[16]; /* Padding at the end */
};
struct __toku_db_txn_active {
u_int32_t txnid; /* 32-bit offset=0 size=4, 64=bit offset=0 size=4 */
......@@ -274,26 +278,29 @@ struct __toku_db_txn_stat {
struct __toku_dbc {
DB *dbp; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
struct __toku_dbc_internal *i;
int (*c_getf_next)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_next_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_next_no_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_prev)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_prev_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_prev_no_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_current)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_first)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_last)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_heavi)(DBC *, u_int32_t, void(*f)(DBT const *, DBT const *, void *, int), void *extra_f, int (*h)(const DBT *key, const DBT *value, void *extra_h), void *extra_h, int direction);
void* __toku_dummy0[23];
int (*c_getf_first)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_last)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_next)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_next_dup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_next_nodup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_prev)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_prev_dup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_prev_nodup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_current)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_current_binding)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_heaviside)(DBC *, u_int32_t, YDB_HEAVISIDE_CALLBACK_FUNCTION f, void *extra_f, YDB_HEAVISIDE_FUNCTION h, void *extra_h, int direction);
int (*c_getf_set)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_set_range)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_get_both)(DBC *, u_int32_t, DBT *, DBT *, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_get_both_range)(DBC *, u_int32_t, DBT *, DBT *, YDB_CALLBACK_FUNCTION, void *);
void* __toku_dummy0[18];
char __toku_dummy1[104];
int (*c_close) (DBC *); /* 32-bit offset=244 size=4, 64=bit offset=384 size=8 */
int (*c_count) (DBC *, db_recno_t *, u_int32_t); /* 32-bit offset=248 size=4, 64=bit offset=392 size=8 */
int (*c_del) (DBC *, u_int32_t); /* 32-bit offset=252 size=4, 64=bit offset=400 size=8 */
void* __toku_dummy2[1];
int (*c_get) (DBC *, DBT *, DBT *, u_int32_t); /* 32-bit offset=260 size=4, 64=bit offset=416 size=8 */
int (*c_pget) (DBC *, DBT *, DBT *, DBT *, u_int32_t); /* 32-bit offset=264 size=4, 64=bit offset=424 size=8 */
int (*c_put) (DBC *, DBT *, DBT *, u_int32_t); /* 32-bit offset=268 size=4, 64=bit offset=432 size=8 */
void* __toku_dummy3[8]; /* Padding at the end */
void* __toku_dummy3[10]; /* Padding at the end */
};
struct __toku_dbt {
void*data; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
......
......@@ -32,6 +32,8 @@ void print_db_notices (void) {
enum {
TOKUDB_OUT_OF_LOCKS = -100000,
TOKUDB_SUCCEEDED_EARLY = -100001,
TOKUDB_FOUND_BUT_REJECTED = -100002,
TOKUDB_USER_CALLBACK_ERROR = -100003,
TOKUDB_DIRTY_DICTIONARY = -100004
};
......@@ -85,7 +87,7 @@ void print_defines (void) {
#ifdef DB_READ_UNCOMMITTED
dodefine(DB_READ_UNCOMMITTED);
#endif
dodefine(DB_KEYEMPTY);
//dodefine(DB_KEYEMPTY); /// KEYEMPTY is no longer used. We just use DB_NOTFOUND
dodefine(DB_KEYEXIST);
dodefine(DB_LOCK_DEADLOCK);
dodefine(DB_LOCK_NOTGRANTED);
......@@ -107,8 +109,7 @@ void print_defines (void) {
dodefine(DB_NEXT_DUP);
dodefine(DB_NEXT_NODUP);
dodefine(DB_PREV);
#if 0 && defined(DB_PREV_DUP)
// DB_PREV_DUP isn't working in tdb, so don't use it.
#if defined(DB_PREV_DUP)
dodefine(DB_PREV_DUP);
#endif
dodefine(DB_PREV_NODUP);
......@@ -140,6 +141,8 @@ void print_defines (void) {
dodefine(TOKUDB_OUT_OF_LOCKS);
dodefine(TOKUDB_SUCCEEDED_EARLY);
dodefine(TOKUDB_DIRTY_DICTIONARY);
dodefine(TOKUDB_FOUND_BUT_REJECTED);
dodefine(TOKUDB_USER_CALLBACK_ERROR);
}
//#define DECL_LIMIT 100
......@@ -290,6 +293,9 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__un
printf("typedef struct __toku_dbc DBC;\n");
printf("typedef struct __toku_dbt DBT;\n");
printf("typedef u_int32_t db_recno_t;\n");
printf("typedef int(*YDB_CALLBACK_FUNCTION)(DBT const*, DBT const*, void*);\n");
printf("typedef int(*YDB_HEAVISIDE_CALLBACK_FUNCTION)(DBT const *key, DBT const *value, void *extra_f, int r_h);\n");
printf("typedef int(*YDB_HEAVISIDE_FUNCTION)(const DBT *key, const DBT *value, void *extra_h);\n");
print_dbtype();
// print_db_notices();
print_defines();
......@@ -332,18 +338,24 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__un
print_struct("db_txn_stat", 0, db_txn_stat_fields32, db_txn_stat_fields64, sizeof(db_txn_stat_fields32)/sizeof(db_txn_stat_fields32[0]), 0);
{
const char *extra[]={"int (*c_getf_next)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *)",
"int (*c_getf_next_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *)",
"int (*c_getf_next_no_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *)",
"int (*c_getf_prev)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *)",
"int (*c_getf_prev_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *)",
"int (*c_getf_prev_no_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *)",
"int (*c_getf_current)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *)",
"int (*c_getf_first)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *)",
"int (*c_getf_last)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *)",
"int (*c_getf_heavi)(DBC *, u_int32_t, "
"void(*f)(DBT const *, DBT const *, void *, int), void *extra_f, "
"int (*h)(const DBT *key, const DBT *value, void *extra_h), void *extra_h, int direction)",
const char *extra[]={
"int (*c_getf_first)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
"int (*c_getf_last)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
"int (*c_getf_next)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
"int (*c_getf_next_dup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
"int (*c_getf_next_nodup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
"int (*c_getf_prev)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
"int (*c_getf_prev_dup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
"int (*c_getf_prev_nodup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
"int (*c_getf_current)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
"int (*c_getf_current_binding)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
"int (*c_getf_heaviside)(DBC *, u_int32_t, "
"YDB_HEAVISIDE_CALLBACK_FUNCTION f, void *extra_f, "
"YDB_HEAVISIDE_FUNCTION h, void *extra_h, int direction)",
"int (*c_getf_set)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *)",
"int (*c_getf_set_range)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *)",
"int (*c_getf_get_both)(DBC *, u_int32_t, DBT *, DBT *, YDB_CALLBACK_FUNCTION, void *)",
"int (*c_getf_get_both_range)(DBC *, u_int32_t, DBT *, DBT *, YDB_CALLBACK_FUNCTION, void *)",
NULL};
assert(sizeof(dbc_fields32)==sizeof(dbc_fields64));
print_struct("dbc", 1, dbc_fields32, dbc_fields64, sizeof(dbc_fields32)/sizeof(dbc_fields32[0]), extra);
......
......@@ -126,7 +126,6 @@ void sample_db_offsets (void) {
field_counter=0;
STRUCT_SETUP(DB, api_internal, "void *%s"); /* Used for C++ hacking. */
STRUCT_SETUP(DB, app_private, "void *%s");
STRUCT_SETUP(DB, associate, "int (*%s) (DB*, DB_TXN*, DB*, int(*)(DB*, const DBT*, const DBT*, DBT*), u_int32_t)");
STRUCT_SETUP(DB, close, "int (*%s) (DB*, u_int32_t)");
STRUCT_SETUP(DB, cursor, "int (*%s) (DB *, DB_TXN *, DBC **, u_int32_t)");
STRUCT_SETUP(DB, dbenv, "DB_ENV *%s");
......@@ -139,7 +138,6 @@ void sample_db_offsets (void) {
#endif
STRUCT_SETUP(DB, key_range, "int (*%s) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)");
STRUCT_SETUP(DB, open, "int (*%s) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)");
STRUCT_SETUP(DB, pget, "int (*%s) (DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t)");
STRUCT_SETUP(DB, put, "int (*%s) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)");
STRUCT_SETUP(DB, remove, "int (*%s) (DB *, const char *, const char *, u_int32_t)");
STRUCT_SETUP(DB, rename, "int (*%s) (DB *, const char *, const char *, const char *, u_int32_t)");
......@@ -185,8 +183,6 @@ void sample_dbc_offsets (void) {
STRUCT_SETUP(DBC, c_count, "int (*%s) (DBC *, db_recno_t *, u_int32_t)");
STRUCT_SETUP(DBC, c_del, "int (*%s) (DBC *, u_int32_t)");
STRUCT_SETUP(DBC, c_get, "int (*%s) (DBC *, DBT *, DBT *, u_int32_t)");
STRUCT_SETUP(DBC, c_pget, "int (*%s) (DBC *, DBT *, DBT *, DBT *, u_int32_t)");
STRUCT_SETUP(DBC, c_put, "int (*%s) (DBC *, DBT *, DBT *, u_int32_t)");
STRUCT_SETUP(DBC, dbp, "DB *%s");
sort_and_dump_fields("dbc", sizeof(DBC));
}
......
......@@ -47,13 +47,11 @@ struct fieldinfo db_fields32[] = {
{"void *app_private", 16, 4},
{"DB_ENV *dbenv", 20, 4},
{"void *api_internal", 236, 4},
{"int (*associate) (DB*, DB_TXN*, DB*, int(*)(DB*, const DBT*, const DBT*, DBT*), u_int32_t)", 256, 4},
{"int (*close) (DB*, u_int32_t)", 260, 4},
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 264, 4},
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 268, 4},
{"int (*fd) (DB *, int *)", 280, 4},
{"int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 284, 4},
{"int (*pget) (DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t)", 288, 4},
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 304, 4},
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 308, 4},
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 312, 4},
......@@ -94,8 +92,6 @@ struct fieldinfo dbc_fields32[] = {
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 192, 4},
{"int (*c_del) (DBC *, u_int32_t)", 196, 4},
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 204, 4},
{"int (*c_pget) (DBC *, DBT *, DBT *, DBT *, u_int32_t)", 208, 4},
{"int (*c_put) (DBC *, DBT *, DBT *, u_int32_t)", 212, 4},
{0, 252, 252} /* size of whole struct */
};
struct fieldinfo dbt_fields32[] = {
......
......@@ -51,13 +51,11 @@ struct fieldinfo db_fields32[] = {
{"void *app_private", 16, 4},
{"DB_ENV *dbenv", 20, 4},
{"void *api_internal", 248, 4},
{"int (*associate) (DB*, DB_TXN*, DB*, int(*)(DB*, const DBT*, const DBT*, DBT*), u_int32_t)", 268, 4},
{"int (*close) (DB*, u_int32_t)", 272, 4},
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 276, 4},
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 280, 4},
{"int (*fd) (DB *, int *)", 296, 4},
{"int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 300, 4},
{"int (*pget) (DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t)", 304, 4},
{"int (*get_flags) (DB *, u_int32_t *)", 336, 4},
{"int (*get_pagesize) (DB *, u_int32_t *)", 348, 4},
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 364, 4},
......@@ -100,8 +98,6 @@ struct fieldinfo dbc_fields32[] = {
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 192, 4},
{"int (*c_del) (DBC *, u_int32_t)", 196, 4},
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 204, 4},
{"int (*c_pget) (DBC *, DBT *, DBT *, DBT *, u_int32_t)", 208, 4},
{"int (*c_put) (DBC *, DBT *, DBT *, u_int32_t)", 212, 4},
{0, 248, 248} /* size of whole struct */
};
struct fieldinfo dbt_fields32[] = {
......
......@@ -51,7 +51,6 @@ struct fieldinfo db_fields32[] = {
{"void *app_private", 16, 4},
{"DB_ENV *dbenv", 20, 4},
{"void *api_internal", 256, 4},
{"int (*associate) (DB*, DB_TXN*, DB*, int(*)(DB*, const DBT*, const DBT*, DBT*), u_int32_t)", 276, 4},
{"int (*close) (DB*, u_int32_t)", 280, 4},
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 288, 4},
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 292, 4},
......@@ -61,7 +60,6 @@ struct fieldinfo db_fields32[] = {
{"int (*get_pagesize) (DB *, u_int32_t *)", 372, 4},
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 408, 4},
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 412, 4},
{"int (*pget) (DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t)", 416, 4},
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 420, 4},
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 424, 4},
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 428, 4},
......@@ -100,8 +98,6 @@ struct fieldinfo dbc_fields32[] = {
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 192, 4},
{"int (*c_del) (DBC *, u_int32_t)", 196, 4},
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 204, 4},
{"int (*c_pget) (DBC *, DBT *, DBT *, DBT *, u_int32_t)", 208, 4},
{"int (*c_put) (DBC *, DBT *, DBT *, u_int32_t)", 212, 4},
{0, 248, 248} /* size of whole struct */
};
struct fieldinfo dbt_fields32[] = {
......
......@@ -50,7 +50,6 @@ struct fieldinfo db_fields32[] = {
{"void *app_private", 16, 4},
{"DB_ENV *dbenv", 20, 4},
{"void *api_internal", 268, 4},
{"int (*associate) (DB*, DB_TXN*, DB*, int(*)(DB*, const DBT*, const DBT*, DBT*), u_int32_t)", 288, 4},
{"int (*close) (DB*, u_int32_t)", 292, 4},
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 300, 4},
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 304, 4},
......@@ -60,7 +59,6 @@ struct fieldinfo db_fields32[] = {
{"int (*get_pagesize) (DB *, u_int32_t *)", 384, 4},
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 420, 4},
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 424, 4},
{"int (*pget) (DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t)", 428, 4},
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 432, 4},
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 436, 4},
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 440, 4},
......@@ -99,8 +97,6 @@ struct fieldinfo dbc_fields32[] = {
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 208, 4},
{"int (*c_del) (DBC *, u_int32_t)", 212, 4},
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 220, 4},
{"int (*c_pget) (DBC *, DBT *, DBT *, DBT *, u_int32_t)", 224, 4},
{"int (*c_put) (DBC *, DBT *, DBT *, u_int32_t)", 228, 4},
{0, 264, 264} /* size of whole struct */
};
struct fieldinfo dbt_fields32[] = {
......
......@@ -50,7 +50,6 @@ struct fieldinfo db_fields32[] = {
{"void *app_private", 20, 4},
{"DB_ENV *dbenv", 24, 4},
{"void *api_internal", 276, 4},
{"int (*associate) (DB*, DB_TXN*, DB*, int(*)(DB*, const DBT*, const DBT*, DBT*), u_int32_t)", 296, 4},
{"int (*close) (DB*, u_int32_t)", 300, 4},
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 308, 4},
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 312, 4},
......@@ -60,7 +59,6 @@ struct fieldinfo db_fields32[] = {
{"int (*get_pagesize) (DB *, u_int32_t *)", 400, 4},
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 440, 4},
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 444, 4},
{"int (*pget) (DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t)", 448, 4},
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 452, 4},
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 456, 4},
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 460, 4},
......@@ -99,8 +97,6 @@ struct fieldinfo dbc_fields32[] = {
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 248, 4},
{"int (*c_del) (DBC *, u_int32_t)", 252, 4},
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 260, 4},
{"int (*c_pget) (DBC *, DBT *, DBT *, DBT *, u_int32_t)", 264, 4},
{"int (*c_put) (DBC *, DBT *, DBT *, u_int32_t)", 268, 4},
{0, 304, 304} /* size of whole struct */
};
struct fieldinfo dbt_fields32[] = {
......
......@@ -47,13 +47,11 @@ struct fieldinfo db_fields64[] = {
{"void *app_private", 32, 8},
{"DB_ENV *dbenv", 40, 8},
{"void *api_internal", 376, 8},
{"int (*associate) (DB*, DB_TXN*, DB*, int(*)(DB*, const DBT*, const DBT*, DBT*), u_int32_t)", 416, 8},
{"int (*close) (DB*, u_int32_t)", 424, 8},
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 432, 8},
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 440, 8},
{"int (*fd) (DB *, int *)", 464, 8},
{"int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 472, 8},
{"int (*pget) (DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t)", 480, 8},
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 512, 8},
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 520, 8},
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 528, 8},
......@@ -94,8 +92,6 @@ struct fieldinfo dbc_fields64[] = {
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 280, 8},
{"int (*c_del) (DBC *, u_int32_t)", 288, 8},
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 304, 8},
{"int (*c_pget) (DBC *, DBT *, DBT *, DBT *, u_int32_t)", 312, 8},
{"int (*c_put) (DBC *, DBT *, DBT *, u_int32_t)", 320, 8},
{0, 400, 400} /* size of whole struct */
};
struct fieldinfo dbt_fields64[] = {
......
......@@ -51,13 +51,11 @@ struct fieldinfo db_fields64[] = {
{"void *app_private", 32, 8},
{"DB_ENV *dbenv", 40, 8},
{"void *api_internal", 400, 8},
{"int (*associate) (DB*, DB_TXN*, DB*, int(*)(DB*, const DBT*, const DBT*, DBT*), u_int32_t)", 440, 8},
{"int (*close) (DB*, u_int32_t)", 448, 8},
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 456, 8},
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 464, 8},
{"int (*fd) (DB *, int *)", 496, 8},
{"int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 504, 8},
{"int (*pget) (DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t)", 512, 8},
{"int (*get_flags) (DB *, u_int32_t *)", 576, 8},
{"int (*get_pagesize) (DB *, u_int32_t *)", 600, 8},
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 632, 8},
......@@ -100,8 +98,6 @@ struct fieldinfo dbc_fields64[] = {
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 272, 8},
{"int (*c_del) (DBC *, u_int32_t)", 280, 8},
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 296, 8},
{"int (*c_pget) (DBC *, DBT *, DBT *, DBT *, u_int32_t)", 304, 8},
{"int (*c_put) (DBC *, DBT *, DBT *, u_int32_t)", 312, 8},
{0, 384, 384} /* size of whole struct */
};
struct fieldinfo dbt_fields64[] = {
......
......@@ -51,7 +51,6 @@ struct fieldinfo db_fields64[] = {
{"void *app_private", 32, 8},
{"DB_ENV *dbenv", 40, 8},
{"void *api_internal", 416, 8},
{"int (*associate) (DB*, DB_TXN*, DB*, int(*)(DB*, const DBT*, const DBT*, DBT*), u_int32_t)", 456, 8},
{"int (*close) (DB*, u_int32_t)", 464, 8},
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 480, 8},
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 488, 8},
......@@ -61,7 +60,6 @@ struct fieldinfo db_fields64[] = {
{"int (*get_pagesize) (DB *, u_int32_t *)", 648, 8},
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 720, 8},
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 728, 8},
{"int (*pget) (DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t)", 736, 8},
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 744, 8},
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 752, 8},
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 760, 8},
......@@ -100,8 +98,6 @@ struct fieldinfo dbc_fields64[] = {
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 280, 8},
{"int (*c_del) (DBC *, u_int32_t)", 288, 8},
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 304, 8},
{"int (*c_pget) (DBC *, DBT *, DBT *, DBT *, u_int32_t)", 312, 8},
{"int (*c_put) (DBC *, DBT *, DBT *, u_int32_t)", 320, 8},
{0, 392, 392} /* size of whole struct */
};
struct fieldinfo dbt_fields64[] = {
......
......@@ -50,7 +50,6 @@ struct fieldinfo db_fields64[] = {
{"void *app_private", 32, 8},
{"DB_ENV *dbenv", 40, 8},
{"void *api_internal", 440, 8},
{"int (*associate) (DB*, DB_TXN*, DB*, int(*)(DB*, const DBT*, const DBT*, DBT*), u_int32_t)", 480, 8},
{"int (*close) (DB*, u_int32_t)", 488, 8},
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 504, 8},
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 512, 8},
......@@ -60,7 +59,6 @@ struct fieldinfo db_fields64[] = {
{"int (*get_pagesize) (DB *, u_int32_t *)", 672, 8},
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 744, 8},
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 752, 8},
{"int (*pget) (DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t)", 760, 8},
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 768, 8},
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 776, 8},
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 784, 8},
......@@ -99,8 +97,6 @@ struct fieldinfo dbc_fields64[] = {
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 312, 8},
{"int (*c_del) (DBC *, u_int32_t)", 320, 8},
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 336, 8},
{"int (*c_pget) (DBC *, DBT *, DBT *, DBT *, u_int32_t)", 344, 8},
{"int (*c_put) (DBC *, DBT *, DBT *, u_int32_t)", 352, 8},
{0, 424, 424} /* size of whole struct */
};
struct fieldinfo dbt_fields64[] = {
......
......@@ -50,7 +50,6 @@ struct fieldinfo db_fields64[] = {
{"void *app_private", 32, 8},
{"DB_ENV *dbenv", 40, 8},
{"void *api_internal", 464, 8},
{"int (*associate) (DB*, DB_TXN*, DB*, int(*)(DB*, const DBT*, const DBT*, DBT*), u_int32_t)", 504, 8},
{"int (*close) (DB*, u_int32_t)", 512, 8},
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 528, 8},
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 536, 8},
......@@ -60,7 +59,6 @@ struct fieldinfo db_fields64[] = {
{"int (*get_pagesize) (DB *, u_int32_t *)", 712, 8},
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 792, 8},
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 800, 8},
{"int (*pget) (DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t)", 808, 8},
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 816, 8},
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 824, 8},
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 832, 8},
......@@ -99,8 +97,6 @@ struct fieldinfo dbc_fields64[] = {
{"int (*c_count) (DBC *, db_recno_t *, u_int32_t)", 392, 8},
{"int (*c_del) (DBC *, u_int32_t)", 400, 8},
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 416, 8},
{"int (*c_pget) (DBC *, DBT *, DBT *, DBT *, u_int32_t)", 424, 8},
{"int (*c_put) (DBC *, DBT *, DBT *, u_int32_t)", 432, 8},
{0, 504, 504} /* size of whole struct */
};
struct fieldinfo dbt_fields64[] = {
......
......@@ -89,11 +89,6 @@ int Db::get(DbTxn *txn, Dbt *key, Dbt *data, u_int32_t flags) {
return the_Env->maybe_throw_error(ret);
}
int Db::pget(DbTxn *txn, Dbt *key, Dbt *pkey, Dbt *data, u_int32_t flags) {
int ret = the_db->pget(the_db, txn->get_DB_TXN(), key->get_DBT(), pkey->get_DBT(), data->get_DBT(), flags);
return the_Env->maybe_throw_error(ret);
}
int Db::put(DbTxn *txn, Dbt *key, Dbt *data, u_int32_t flags) {
int ret = the_db->put(the_db, txn->get_DB_TXN(), key->get_DBT(), data->get_DBT(), flags);
return the_Env->maybe_throw_error(ret);
......@@ -152,26 +147,6 @@ int Db::set_dup_compare(int (*dup_compare_callback)(Db *, const Dbt *, const Dbt
return the_Env->maybe_throw_error(ret);
}
// Q: How to convert callback types in the most simple way?
// A: (Bradley) I see three ways to do this: The issue is that we have a C++ callback function, and we want to pass it to a C function.
// The fastest way is wrong: You cannot just pass the C++ function pointer since you cannot mix function pointers to C and C++.
// The "right" way is to declare an "extern C" function and do all the conversions. Create a Dbt from a DBT, and then call the C function. For returned data we would have do something too. But it turns out that DBT and Dbt pointers are interchangable so that leads to
// The "fast" way. Declare an "extern C" function, and then use Dbt::get_const_Dbt() to do the conversion quickly.
extern "C" int toku_associate_callback_c (DB*db_c, const DBT *k, const DBT *d, DBT *result) {
assert(db_c!=0);
Db *db_cxx=Db::get_Db(db_c);
assert(db_cxx);
return (*db_cxx->associate_callback_cxx)(db_cxx, Dbt::get_const_Dbt(k), Dbt::get_const_Dbt(d), Dbt::get_Dbt(result));
}
int Db::associate(DbTxn *txnid, Db *secondary, int (*callback)(Db *secondary, const Dbt *key, const Dbt *data, Dbt *result), u_int32_t flags) {
// secondary->set_associate_callback(callback);
secondary->associate_callback_cxx = callback;
int ret = the_db->associate(the_db, txnid->get_DB_TXN(), secondary->get_DB(), toku_associate_callback_c, flags);
return the_Env->maybe_throw_error(ret);
}
void Db::set_errpfx(const char *errpfx) {
the_Env->set_errpfx(errpfx);
}
......
......@@ -15,14 +15,6 @@ int Dbc::get(Dbt* key, Dbt *data, u_int32_t flags) {
return env->maybe_throw_error(ret);
}
int Dbc::pget(Dbt* key, Dbt *pkey, Dbt *data, u_int32_t flags) {
DBC *dbc = this;
int ret = dbc->c_pget(dbc, key, pkey, data, flags);
DB_ENV *dbenv_c=dbc->dbp->dbenv;
DbEnv *env = (DbEnv*)dbenv_c->api1_internal;
return env->maybe_throw_error(ret);
}
int Dbc::del(u_int32_t flags) {
DBC *dbc = this;
int ret = dbc->c_del(dbc, flags);
......@@ -39,14 +31,6 @@ int Dbc::count(db_recno_t *count, u_int32_t flags) {
return env->maybe_throw_error(ret);
}
int Dbc::put(Dbt* key, Dbt *data, u_int32_t flags) {
DBC *dbc = this;
int ret = dbc->c_put(dbc, key, data, flags);
DB_ENV *dbenv_c=dbc->dbp->dbenv;
DbEnv *env = (DbEnv*)dbenv_c->api1_internal;
return env->maybe_throw_error(ret);
}
// Not callable, but some compilers require it to be defined anyway.
Dbc::~Dbc()
{
......
......@@ -84,7 +84,7 @@ void DbEnv::set_errpfx(const char *errpfx) {
}
int DbEnv::maybe_throw_error(int err, DbEnv *env, int no_exceptions) throw (DbException) {
if (err==0 || err==DB_NOTFOUND || err==DB_KEYEXIST || err==DB_KEYEMPTY) return err;
if (err==0 || err==DB_NOTFOUND || err==DB_KEYEXIST) return err;
if (no_exceptions) return err;
if (err==DB_LOCK_DEADLOCK) {
DbDeadlockException e(env);
......
......@@ -97,7 +97,6 @@ check: $(TARGETS) \
check_create_dump_diff \
check_test1 \
check_test_errpfx \
check_test_db_assoc3 \
check_test_cursor_count \
check_test_error_stream \
check_test_reverse_compare_fun \
......
......@@ -12,6 +12,10 @@
#define DB_DELETE_ANY 0
#endif
#ifndef DB_KEYEMPTY
#define DB_KEYEMPTY DB_NOTFOUND
#endif
int verbose = 0;
#define TC(expr, expect) \
......
This diff is collapsed.
......@@ -9,7 +9,7 @@
.DEFAULT_GOAL= build
TOKUROOT=../
INCLUDEDIRS=-I. -I../ -I$(TOKUROOT)newbrt -I../range_tree -I../lock_tree
INCLUDEDIRS=-I. -I../ -I$(TOKUROOT)include -I$(TOKUROOT)toku_include -I$(TOKUROOT)newbrt -I../range_tree -I../lock_tree
DEPEND_COMPILE += \
./*.h \
#end
......
/* Scan the bench.tokudb/bench.db over and over. */
#define DONT_DEPRECATE_MALLOC
#include <toku_portability.h>
#include <assert.h>
......@@ -8,9 +9,12 @@
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#ifdef TOKUDB
#include "key.h"
#endif
const char *pname;
enum run_mode { RUN_HWC, RUN_LWC, RUN_VERIFY } run_mode = RUN_HWC;
enum run_mode { RUN_HWC, RUN_LWC, RUN_VERIFY, RUN_HEAVI } run_mode = RUN_HWC;
int do_txns=1, prelock=0, prelockflag=0;
u_int32_t lock_flag = 0;
long limitcount=-1;
......@@ -34,6 +38,10 @@ static void parse_args (int argc, const char *argv[]) {
run_mode = RUN_HWC;
} else if (strcmp(*argv, "--prelock")==0) prelock=1;
#ifdef TOKUDB
else if (strcmp(*argv, "--heavi")==0) {
if (specified_run_mode && run_mode!=RUN_HEAVI) goto two_modes;
run_mode = RUN_HEAVI;
}
else if (strcmp(*argv, "--prelockflag")==0) { prelockflag=1; lock_flag = DB_PRELOCKED; }
else if (strcmp(*argv, "--prelockwriteflag")==0) { prelockflag=1; lock_flag = DB_PRELOCKED_WRITE; }
#endif
......@@ -185,7 +193,7 @@ struct extra_count {
int rowcounter;
};
static void counttotalbytes (DBT const *key, DBT const *data, void *extrav) {
static int counttotalbytes (DBT const *key, DBT const *data, void *extrav) {
struct extra_count *e=extrav;
e->totalbytes += key->size + data->size;
e->rowcounter++;
......@@ -196,6 +204,7 @@ static void counttotalbytes (DBT const *key, DBT const *data, void *extrav) {
printf("%s:%d %"PRId64" %"PRId64"\n", __FUNCTION__, __LINE__, k, expect_key);
expect_key = k + 1;
}
return 0;
}
static void scanscan_lwc (void) {
......@@ -222,13 +231,106 @@ static void scanscan_lwc (void) {
}
}
struct extra_heavi {
long long totalbytes;
int rowcounter;
DBT key;
DBT val;
};
static int
copy_dbt(DBT *target, DBT const *source) {
int r;
if (target->ulen < source->size) {
target->data = realloc(target->data, source->size);
target->ulen = source->size;
}
if (!target->data) r = ENOMEM;
else {
target->size = source->size;
memcpy(target->data, source->data, target->size);
r = 0;
}
return r;
}
typedef struct foo{int a; } FOO;
static int
heaviside_next(const DBT *key, const DBT *val, void *extra_h) {
struct extra_heavi *e=extra_h;
int cmp;
cmp = toku_default_compare_fun(db, key, &e->key);
if (cmp != 0) return cmp;
if (val) cmp = toku_default_compare_fun(db, val, &e->val);
if (cmp != 0) return cmp;
return -1; //Return negative on <=, positive on >
}
static int copy_and_counttotalbytes (DBT const *key, DBT const *val, void *extrav, int r_h) {
assert(r_h>0);
struct extra_heavi *e=extrav;
e->totalbytes += key->size + val->size;
e->rowcounter++;
int r;
r = copy_dbt(&e->key, key);
if (r==0) r = copy_dbt(&e->val, val);
return r;
}
static void scanscan_heaviside (void) {
int r;
int counter=0;
for (counter=0; counter<2; counter++) {
struct extra_heavi e;
memset(&e, 0, sizeof(e));
e.key.flags = DB_DBT_REALLOC;
e.val.flags = DB_DBT_REALLOC;
double prevtime = gettime();
DBC *dbc;
r = db->cursor(db, tid, &dbc, 0); assert(r==0);
u_int32_t f_flags = 0;
if (prelockflag && (counter || prelock)) {
f_flags |= lock_flag;
}
//Get first manually.
long rowcounter=1;
r = dbc->c_get(dbc, &e.key, &e.val, DB_FIRST | f_flags); assert(r==0);
e.rowcounter = 1;
e.totalbytes = e.key.size + e.val.size;
while (0 == (r = dbc->c_getf_heaviside(dbc, f_flags,
copy_and_counttotalbytes, &e,
heaviside_next, &e,
1))) {
rowcounter++;
if (limitcount>0 && rowcounter>=limitcount) break;
}
assert(rowcounter==e.rowcounter);
if (e.key.data) {
free(e.key.data);
e.key.data = NULL;
}
if (e.val.data) {
free(e.val.data);
e.val.data = NULL;
}
r = dbc->c_close(dbc); assert(r==0);
double thistime = gettime();
double tdiff = thistime-prevtime;
printf("LWC Scan %lld bytes (%d rows) in %9.6fs at %9fMB/s\n", e.totalbytes, e.rowcounter, tdiff, 1e-6*e.totalbytes/tdiff);
}
}
struct extra_verify {
long long totalbytes;
int rowcounter;
DBT k,v; // the k and v are gotten using the old cursor
};
static void checkbytes (DBT const *key, DBT const *data, void *extrav) {
static int
checkbytes (DBT const *key, DBT const *data, void *extrav) {
struct extra_verify *e=extrav;
e->totalbytes += key->size + data->size;
e->rowcounter++;
......@@ -238,6 +340,7 @@ static void checkbytes (DBT const *key, DBT const *data, void *extrav) {
assert(memcmp(e->v.data, data->data, data->size)==0);
assert(e->k.data != key->data);
assert(e->v.data != data->data);
return 0;
}
......@@ -287,6 +390,7 @@ int main (int argc, const char *argv[]) {
#ifdef TOKUDB
case RUN_LWC: scanscan_lwc(); break;
case RUN_VERIFY: scanscan_verify(); break;
case RUN_HEAVI: scanscan_heaviside(); break;
#else
default: assert(0); break;
#endif
......
......@@ -28,6 +28,9 @@ typedef struct __toku_db_txn_stat DB_TXN_STAT;
typedef struct __toku_dbc DBC;
typedef struct __toku_dbt DBT;
typedef u_int32_t db_recno_t;
typedef int(*YDB_CALLBACK_FUNCTION)(DBT const*, DBT const*, void*);
typedef int(*YDB_HEAVISIDE_CALLBACK_FUNCTION)(DBT const *key, DBT const *value, void *extra_f, int r_h);
typedef int(*YDB_HEAVISIDE_FUNCTION)(const DBT *key, const DBT *value, void *extra_h);
typedef enum {
DB_BTREE=1,
DB_UNKNOWN=5
......@@ -70,7 +73,6 @@ typedef enum {
#define DB_USE_ENVIRON 16384
#define DB_USE_ENVIRON_ROOT 32768
#define DB_READ_UNCOMMITTED 134217728
#define DB_KEYEMPTY -30997
#define DB_KEYEXIST -30996
#define DB_LOCK_DEADLOCK -30995
#define DB_LOCK_NOTGRANTED -30994
......@@ -89,6 +91,7 @@ typedef enum {
#define DB_NEXT_DUP 17
#define DB_NEXT_NODUP 18
#define DB_PREV 23
#define DB_PREV_DUP 24
#define DB_PREV_NODUP 25
#define DB_SET 26
#define DB_SET_RANGE 27
......@@ -107,6 +110,8 @@ typedef enum {
#define TOKUDB_OUT_OF_LOCKS -100000
#define TOKUDB_SUCCEEDED_EARLY -100001
#define TOKUDB_DIRTY_DICTIONARY -100004
#define TOKUDB_FOUND_BUT_REJECTED -100002
#define TOKUDB_USER_CALLBACK_ERROR -100003
/* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/
#ifdef _TOKUDB_WRAP_H
#undef txn_begin
......@@ -197,8 +202,7 @@ struct __toku_db {
void* __toku_dummy1[38];
char __toku_dummy2[80];
void *api_internal; /* 32-bit offset=276 size=4, 64=bit offset=464 size=8 */
void* __toku_dummy3[4];
int (*associate) (DB*, DB_TXN*, DB*, int(*)(DB*, const DBT*, const DBT*, DBT*), u_int32_t); /* 32-bit offset=296 size=4, 64=bit offset=504 size=8 */
void* __toku_dummy3[5];
int (*close) (DB*, u_int32_t); /* 32-bit offset=300 size=4, 64=bit offset=512 size=8 */
void* __toku_dummy4[1];
int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t); /* 32-bit offset=308 size=4, 64=bit offset=528 size=8 */
......@@ -213,28 +217,28 @@ struct __toku_db {
void* __toku_dummy8[9];
int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t); /* 32-bit offset=440 size=4, 64=bit offset=792 size=8 */
int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int); /* 32-bit offset=444 size=4, 64=bit offset=800 size=8 */
int (*pget) (DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t); /* 32-bit offset=448 size=4, 64=bit offset=808 size=8 */
void* __toku_dummy9[1];
int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t); /* 32-bit offset=452 size=4, 64=bit offset=816 size=8 */
int (*remove) (DB *, const char *, const char *, u_int32_t); /* 32-bit offset=456 size=4, 64=bit offset=824 size=8 */
int (*rename) (DB *, const char *, const char *, const char *, u_int32_t); /* 32-bit offset=460 size=4, 64=bit offset=832 size=8 */
void* __toku_dummy9[2];
void* __toku_dummy10[2];
int (*set_bt_compare) (DB *, int (*)(DB *, const DBT *, const DBT *)); /* 32-bit offset=472 size=4, 64=bit offset=856 size=8 */
void* __toku_dummy10[3];
void* __toku_dummy11[3];
int (*set_dup_compare) (DB *, int (*)(DB *, const DBT *, const DBT *)); /* 32-bit offset=488 size=4, 64=bit offset=888 size=8 */
void* __toku_dummy11[2];
void (*set_errfile) (DB *, FILE*); /* 32-bit offset=500 size=4, 64=bit offset=912 size=8 */
void* __toku_dummy12[2];
void (*set_errfile) (DB *, FILE*); /* 32-bit offset=500 size=4, 64=bit offset=912 size=8 */
void* __toku_dummy13[2];
int (*set_flags) (DB *, u_int32_t); /* 32-bit offset=512 size=4, 64=bit offset=936 size=8 */
void* __toku_dummy13[7];
int (*set_pagesize) (DB *, u_int32_t); /* 32-bit offset=544 size=4, 64=bit offset=1000 size=8 */
void* __toku_dummy14[7];
int (*set_pagesize) (DB *, u_int32_t); /* 32-bit offset=544 size=4, 64=bit offset=1000 size=8 */
void* __toku_dummy15[7];
int (*stat) (DB *, void *, u_int32_t); /* 32-bit offset=576 size=4, 64=bit offset=1064 size=8 */
void* __toku_dummy15[2];
void* __toku_dummy16[2];
int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t); /* 32-bit offset=588 size=4, 64=bit offset=1088 size=8 */
void* __toku_dummy16[1];
void* __toku_dummy17[1];
int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t); /* 32-bit offset=596 size=4, 64=bit offset=1104 size=8 */
void* __toku_dummy17[5]; /* Padding at the end */
char __toku_dummy18[16]; /* Padding at the end */
void* __toku_dummy18[5]; /* Padding at the end */
char __toku_dummy19[16]; /* Padding at the end */
};
struct __toku_db_txn_active {
u_int32_t txnid; /* 32-bit offset=0 size=4, 64=bit offset=0 size=4 */
......@@ -274,26 +278,29 @@ struct __toku_db_txn_stat {
struct __toku_dbc {
DB *dbp; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
struct __toku_dbc_internal *i;
int (*c_getf_next)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_next_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_next_no_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_prev)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_prev_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_prev_no_dup)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_current)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_first)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_last)(DBC *, u_int32_t, void(*)(DBT const *, DBT const *, void *), void *);
int (*c_getf_heavi)(DBC *, u_int32_t, void(*f)(DBT const *, DBT const *, void *, int), void *extra_f, int (*h)(const DBT *key, const DBT *value, void *extra_h), void *extra_h, int direction);
void* __toku_dummy0[23];
int (*c_getf_first)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_last)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_next)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_next_dup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_next_nodup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_prev)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_prev_dup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_prev_nodup)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_current)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_current_binding)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_heaviside)(DBC *, u_int32_t, YDB_HEAVISIDE_CALLBACK_FUNCTION f, void *extra_f, YDB_HEAVISIDE_FUNCTION h, void *extra_h, int direction);
int (*c_getf_set)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_set_range)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_get_both)(DBC *, u_int32_t, DBT *, DBT *, YDB_CALLBACK_FUNCTION, void *);
int (*c_getf_get_both_range)(DBC *, u_int32_t, DBT *, DBT *, YDB_CALLBACK_FUNCTION, void *);
void* __toku_dummy0[18];
char __toku_dummy1[104];
int (*c_close) (DBC *); /* 32-bit offset=244 size=4, 64=bit offset=384 size=8 */
int (*c_count) (DBC *, db_recno_t *, u_int32_t); /* 32-bit offset=248 size=4, 64=bit offset=392 size=8 */
int (*c_del) (DBC *, u_int32_t); /* 32-bit offset=252 size=4, 64=bit offset=400 size=8 */
void* __toku_dummy2[1];
int (*c_get) (DBC *, DBT *, DBT *, u_int32_t); /* 32-bit offset=260 size=4, 64=bit offset=416 size=8 */
int (*c_pget) (DBC *, DBT *, DBT *, DBT *, u_int32_t); /* 32-bit offset=264 size=4, 64=bit offset=424 size=8 */
int (*c_put) (DBC *, DBT *, DBT *, u_int32_t); /* 32-bit offset=268 size=4, 64=bit offset=432 size=8 */
void* __toku_dummy3[8]; /* Padding at the end */
void* __toku_dummy3[10]; /* Padding at the end */
};
struct __toku_dbt {
void*data; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
......
......@@ -109,7 +109,6 @@ class Db {
int del(DbTxn */*txn*/, Dbt */*key*/, u_int32_t /*flags*/);
int get(DbTxn */*txn*/, Dbt */*key*/, Dbt */*data*/, u_int32_t /*flags*/);
int pget(DbTxn *, Dbt *, Dbt *, Dbt *, u_int32_t);
int put(DbTxn *, Dbt *, Dbt *, u_int32_t);
......@@ -217,10 +216,8 @@ class Dbc : protected DBC {
public:
int close(void);
int get(Dbt *, Dbt *, u_int32_t);
int pget(Dbt *, Dbt *, Dbt *, u_int32_t);
int del(u_int32_t);
int count(db_recno_t *, u_int32_t);
int put(Dbt *, Dbt *, u_int32_t);
private:
Dbc(); // User may not call it.
~Dbc(); // User may not delete it.
......
libtokudb.so
libtokudbtrace.so
......@@ -2,6 +2,8 @@
.DEFAULT_GOAL=install
TOKUROOT=../
INCLUDEDIRS=-I.
SKIP_LIBPORTABILITYRULE=1
include $(TOKUROOT)toku_include/Makefile.include
OPT_AROPT=-qnoipo #Disable ipo for lib creation even when optimization is on.
......@@ -10,15 +12,16 @@ SRCS = $(wildcard *.c)
OBJS = $(patsubst %.c,%.$(OEXT),$(SRCS))
TARGET = libtokuportability.$(AEXT)
$(OBJS): CFLAGS += -DTOKU_ALLOW_DEPRECATED
build install: $(LIBPORTABILITY)
install: $(TARGET)
cp $(TARGET) $(LIBPORTABILITY)
$(LIBPORTABILITY): $(TARGET)
if ! diff $< $@ 2>/dev/null; then cp $< $@; fi
$(TARGET): $(OBJS)
$(OBJS): CFLAGS += -DTOKU_ALLOW_DEPRECATED
#Blank on purpose
clean:
rm -rf $(TARGET) $(LIBPORTABILITY)
# For build, do nothing
build:
......@@ -48,6 +48,7 @@ BRT_SOURCES = \
fingerprint \
key \
leafentry \
leaflock \
log \
log_code \
memarena \
......
......@@ -15,6 +15,7 @@ typedef void *OMTVALUE;
#include "omt.h"
#include "leafentry.h"
#include "block_table.h"
#include "leaflock.h"
#ifndef BRT_FANOUT
#define BRT_FANOUT 16
......@@ -94,6 +95,7 @@ struct brtnode {
} n;
struct leaf {
OMT buffer;
LEAFLOCK leaflock;
unsigned int n_bytes_in_buffer; /* How many bytes to represent the OMT (including the per-key overheads, but not including the overheads for the node. */
unsigned int seqinsert; /* number of sequential inserts to this leaf */
struct mempool buffer_mempool;
......@@ -152,8 +154,6 @@ struct brt {
int (*dup_compare)(DB*,const DBT*,const DBT*);
DB *db; // To pass to the compare fun
void *skey,*sval; /* Used for DBT return values. */
OMT txns; // transactions that are using this OMT (note that the transaction checks the cf also)
// If a transaction created this BRT, which one?
......@@ -208,18 +208,31 @@ extern u_int32_t toku_calc_fingerprint_cmdstruct (BRT_CMD cmd);
unsigned int toku_brt_pivot_key_len (BRT, struct kv_pair *); // Given the tree
unsigned int toku_brtnode_pivot_key_len (BRTNODE, struct kv_pair *); // Given the node
// Values to be used to update brtcursor if a search is successful.
struct brt_cursor_leaf_info_to_be {
u_int32_t index;
OMT omt;
};
// Values to be used to pin a leaf for shortcut searches
// and to access the leaflock.
struct brt_cursor_leaf_info {
BLOCKNUM blocknumber;
u_int32_t fullhash;
LEAFLOCK leaflock;
struct brt_cursor_leaf_info_to_be to_be;
};
/* a brt cursor is represented as a kv pair in a tree */
struct brt_cursor {
struct list cursors_link;
BRT brt;
BOOL current_in_omt, prev_in_omt;
BOOL current_in_omt;
BOOL prefetching;
DBT key, val; // The key-value pair that the cursor currently points to
DBT prevkey, prevval; // The key-value pair that the cursor pointed to previously. (E.g., when we do a DB_NEXT)
int is_temporary_cursor; // If it is a temporary cursor then use the following skey and sval to return tokudb-managed values in dbts. Otherwise use the brt's skey and skval.
void *skey, *sval;
OMTCURSOR omtcursor;
u_int64_t root_put_counter; // what was the count on the BRT when we validated the cursor?
struct brt_cursor_leaf_info leaf_info;
};
// logs the memory allocation, but not the creation of the new node
......
......@@ -592,6 +592,8 @@ int toku_deserialize_brtnode_from (int fd, BLOCKNUM blocknum, u_int32_t fullhash
if (0) { died_21: toku_omt_destroy(&result->u.l.buffer); }
return toku_db_badformat();
}
r = toku_leaflock_borrow(&result->u.l.leaflock);
if (r!=0) goto died_21;
result->u.l.buffer_mempool.frag_size = start_of_data;
result->u.l.buffer_mempool.free_offset = end_of_data;
......
This diff is collapsed.
......@@ -12,6 +12,20 @@
#include "log.h"
#include "brt-search.h"
// A callback function is invoked with the key, and the data.
// The pointers (to the bytevecs) must not be modified. The data must be copied out before the callback function returns.
// Note: In the thread-safe version, the brt node remains locked while the callback function runs. So return soon, and don't call the BRT code from the callback function.
// If the callback function returns a nonzero value (an error code), then that error code is returned from the get function itself.
// The cursor object will have been updated (so that if result==0 the current value is the value being passed)
// (If r!=0 then the cursor won't have been updated.)
// If r!=0, it's up to the callback function to return that value of r.
//A 'key' bytevec of NULL means that element is not found (effectively infinity or
//-infinity depending on direction)
typedef int(*BRT_GET_CALLBACK_FUNCTION)(ITEMLEN, bytevec, ITEMLEN, bytevec, void*);
//Same as BRT_GET_CALLBACK_FUNCTION but returns both the answer to the query and
//the element on the other side of the border (as in heaviside function).
typedef int(*BRT_GET_STRADDLE_CALLBACK_FUNCTION)(ITEMLEN, bytevec, ITEMLEN, bytevec, ITEMLEN, bytevec, ITEMLEN, bytevec, void*);
int toku_open_brt (const char *fname, const char *dbname, int is_create, BRT *, int nodesize, CACHETABLE, TOKUTXN, int(*)(DB*,const DBT*,const DBT*), DB*);
int toku_brt_create(BRT *);
......@@ -27,7 +41,7 @@ int toku_brt_open(BRT, const char *fname, const char *fname_in_env, const char *
int toku_brt_remove_subdb(BRT brt, const char *dbname, u_int32_t flags);
int toku_brt_insert (BRT, DBT *, DBT *, TOKUTXN);
int toku_brt_lookup (BRT brt, DBT *k, DBT *v);
int toku_brt_lookup (BRT brt, DBT *k, DBT *v, BRT_GET_CALLBACK_FUNCTION getf, void *getf_v);
int toku_brt_delete (BRT brt, DBT *k, TOKUTXN);
int toku_brt_delete_both (BRT brt, DBT *k, DBT *v, TOKUTXN); // Delete a pair only if both k and v are equal according to the comparison function.
int toku_close_brt (BRT, TOKULOGGER, char **error_string);
......@@ -61,44 +75,45 @@ int toku_verify_brt (BRT brt);
//int show_brt_blocknumbers(BRT);
typedef struct brt_cursor *BRT_CURSOR;
int toku_brt_cursor (BRT, BRT_CURSOR*, int is_temporary_cursor);
int toku_brt_cursor_get (BRT_CURSOR cursor, DBT *kbt, DBT *vbt, int brtc_flags, TOKUTXN);
struct heavi_wrapper {
int (*h)(const DBT *key, const DBT *value, void *extra_h);
int toku_brt_cursor (BRT, BRT_CURSOR*);
// get is deprecated in favor of the individual functions below
int toku_brt_cursor_get (BRT_CURSOR cursor, DBT *key, DBT *val, BRT_GET_CALLBACK_FUNCTION getf, void *getf_v, int get_flags, TOKUTXN txn);
int toku_brt_cursor_first(BRT_CURSOR cursor, BRT_GET_CALLBACK_FUNCTION getf, void *getf_v, TOKULOGGER logger);
int toku_brt_cursor_last(BRT_CURSOR cursor, BRT_GET_CALLBACK_FUNCTION getf, void *getf_v, TOKULOGGER logger);
int toku_brt_cursor_next(BRT_CURSOR cursor, BRT_GET_CALLBACK_FUNCTION getf, void *getf_v, TOKULOGGER logger);
int toku_brt_cursor_next_nodup(BRT_CURSOR cursor, BRT_GET_CALLBACK_FUNCTION getf, void *getf_v, TOKULOGGER logger);
int toku_brt_cursor_next_dup(BRT_CURSOR cursor, BRT_GET_CALLBACK_FUNCTION getf, void *getf_v, TOKULOGGER logger);
int toku_brt_cursor_prev(BRT_CURSOR cursor, BRT_GET_CALLBACK_FUNCTION getf, void *getf_v, TOKULOGGER logger);
int toku_brt_cursor_prev_nodup(BRT_CURSOR cursor, BRT_GET_CALLBACK_FUNCTION getf, void *getf_v, TOKULOGGER logger);
int toku_brt_cursor_prev_dup(BRT_CURSOR cursor, BRT_GET_CALLBACK_FUNCTION getf, void *getf_v, TOKULOGGER logger);
int toku_brt_cursor_current(BRT_CURSOR cursor, int op, BRT_GET_CALLBACK_FUNCTION getf, void *getf_v, TOKULOGGER logger);
int toku_brt_cursor_set(BRT_CURSOR cursor, DBT *key, DBT *val, BRT_GET_CALLBACK_FUNCTION getf, void *getf_v, TOKULOGGER logger);
int toku_brt_cursor_set_range(BRT_CURSOR cursor, DBT *key, BRT_GET_CALLBACK_FUNCTION getf, void *getf_v, TOKULOGGER logger);
int toku_brt_cursor_get_both_range(BRT_CURSOR cursor, DBT *key, DBT *val, BRT_GET_CALLBACK_FUNCTION getf, void *getf_v, TOKULOGGER logger);
typedef struct {
YDB_HEAVISIDE_FUNCTION h;
void *extra_h;
int r_h;
};
typedef struct heavi_wrapper *HEAVI_WRAPPER;
int toku_brt_cursor_get_heavi (BRT_CURSOR cursor, DBT *outkey, DBT *outval, TOKUTXN txn, int direction, HEAVI_WRAPPER wrapper);
int toku_brt_cursor_peek_prev(BRT_CURSOR cursor, DBT *outkey, DBT *outval);
int toku_brt_cursor_peek_next(BRT_CURSOR cursor, DBT *outkey, DBT *outval);
int toku_brt_cursor_before(BRT_CURSOR cursor, DBT *key, DBT *val, DBT *outkey, DBT *outval, TOKUTXN txn);
int toku_brt_cursor_after(BRT_CURSOR cursor, DBT *key, DBT *val, DBT *outkey, DBT *outval, TOKUTXN txn);
int direction;
} *HEAVI_WRAPPER, HEAVI_WRAPPER_S;
int toku_brt_cursor_heaviside(BRT_CURSOR cursor, BRT_GET_STRADDLE_CALLBACK_FUNCTION getf, void *getf_v, TOKULOGGER logger, HEAVI_WRAPPER wrapper);
int toku_brt_cursor_delete(BRT_CURSOR cursor, int flags, TOKUTXN);
int toku_brt_cursor_close (BRT_CURSOR curs);
BOOL toku_brt_cursor_uninitialized(BRT_CURSOR c);
DBT *brt_cursor_peek_prev_key(BRT_CURSOR cursor);
DBT *brt_cursor_peek_prev_val(BRT_CURSOR cursor);
DBT *brt_cursor_peek_current_key(BRT_CURSOR cursor);
DBT *brt_cursor_peek_current_val(BRT_CURSOR cursor);
void brt_cursor_peek_current(BRT_CURSOR cursor, const DBT **pkey, const DBT **pval);
void brt_cursor_restore_state_from_prev(BRT_CURSOR cursor);
void toku_brt_cursor_peek(BRT_CURSOR cursor, const DBT **pkey, const DBT **pval);
typedef struct brtenv *BRTENV;
int brtenv_checkpoint (BRTENV env);
extern int toku_brt_do_push_cmd; // control whether push occurs eagerly.
// TODO: Get rid of this
int toku_brt_dbt_set(DBT* key, DBT* key_source);
int toku_brt_cursor_dbts_set(BRT_CURSOR cursor,
DBT* key, DBT* key_source, BOOL key_disposable,
DBT* val, DBT* val_source, BOOL val_disposable);
int toku_brt_cursor_dbts_set_with_dat(BRT_CURSOR cursor, BRT pdb,
DBT* key, DBT* key_source, BOOL key_disposable,
DBT* val, DBT* val_source, BOOL val_disposable,
DBT* dat, DBT* dat_source, BOOL dat_disposable);
int toku_brt_get_fd(BRT, int *);
......
......@@ -117,4 +117,9 @@ build_brt_cmd (enum brt_cmd_type type, TXNID xid, DBT *key, DBT *val) {
typedef struct leafentry *LEAFENTRY;
struct simple_dbt {
u_int32_t len;
void *data;
};
#endif
......@@ -88,19 +88,6 @@ int toku_keycompare (bytevec key1, ITEMLEN key1len, bytevec key2, ITEMLEN key2le
#endif
void
toku_test_keycompare (void) {
assert(toku_keycompare("a",1, "a",1)==0);
assert(toku_keycompare("aa",2, "a",1)>0);
assert(toku_keycompare("a",1, "aa",2)<0);
assert(toku_keycompare("b",1, "aa",2)>0);
assert(toku_keycompare("aa",2, "b",1)<0);
assert(toku_keycompare("aaaba",5, "aaaba",5)==0);
assert(toku_keycompare("aaaba",5, "aaaaa",5)>0);
assert(toku_keycompare("aaaaa",5, "aaaba",5)<0);
assert(toku_keycompare("aaaaa",3, "aaaba",3)==0);
}
int
toku_default_compare_fun (DB *db __attribute__((__unused__)), const DBT *a, const DBT*b) {
return toku_keycompare(a->data, a->size, b->data, b->size);
......
......@@ -6,5 +6,5 @@
int toku_keycompare (bytevec key1, ITEMLEN key1len, bytevec key2, ITEMLEN key2len);
void toku_test_keycompare (void) ;
int toku_default_compare_fun (DB *, const DBT *, const DBT*);
int toku_default_compare_fun (DB *, const DBT *, const DBT*) __attribute__((__visibility__("default")));
int toku_dont_call_this_compare_fun (DB *, const DBT *, const DBT*);
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
#include "toku_portability.h"
#include "toku_pthread.h"
#include "leaflock.h"
#include "toku_assert.h"
#include "memory.h"
#include <errno.h>
#include <string.h>
// See ticket 1423.
//
// Purpose of this file is to manage a pool of locks that are used
// to lock brt leaf nodes and the cursors that point to them.
// Each lock protects one set of cursors, the cursors that point
// to a single brt leaf node. (Actually, the cursors point to
// a leaf node's omt.)
// Because the cursors that point to a brt leaf node are organized
// in a linked list (whose head is in the brt leaf node), the
// operations listed below are not threadsafe.
//
// It is necessary to hold the lock around following operations:
// - associate cursor with brt block (brt_cursor_update())
// [ puts cursor on linked list ]
// - invalidate cursor (done only by search path)
// [ removes cursor from linked list ]
// - invalidate all cursors associated with a brt block
// (done only by (a) writer thread or (b) insert/delete,
// at least until we have brt-node-level locks)
// [ removes all cursors from linked list ]
//
// When a leaf is created, it borrows ownership of a leaflock.
// The leaf has a reference to the leaflock.
//
// When a leaf is evicted, ownership of the leaflock returns to the
// pool of available leaflocks.
//
// The reason an unused leaflock (which is no longer associated with
// any particular leaf node) is kept in a pool (rather than destroyed)
// is that some client thread may be waiting on the lock or about to
// request the lock.
//
// The brt leaf node has a reference to the leaflock, and there is
// a reference to the leaflock in every cursor that references the
// brt leaf node.
//
static u_int32_t numlocks = 0; // how many locks ever created?
static u_int32_t pool_high_water_mark = 0; // max number of locks ever in pool
static u_int32_t num_in_pool = 0; // number of locks currently in pool
struct leaflock {
toku_pthread_mutex_t lock;
LEAFLOCK next;
int id;
};
static LEAFLOCK free_list;
static toku_pthread_mutex_t pool_mutex;
static void
leaflock_pool_lock(void) {
int r = toku_pthread_mutex_lock(&pool_mutex); assert(r==0);
}
static void
leaflock_pool_unlock(void) {
int r = toku_pthread_mutex_unlock(&pool_mutex); assert(r==0);
}
void
toku_leaflock_init(void) {
int r = toku_pthread_mutex_init(&pool_mutex, NULL);
assert(r == 0);
free_list = NULL;
}
void
toku_leaflock_destroy(void) {
leaflock_pool_lock();
int r;
assert(num_in_pool==numlocks);
while (free_list) {
LEAFLOCK to_free = free_list;
free_list = free_list->next;
r = toku_pthread_mutex_destroy(&to_free->lock); assert(r==0);
toku_free(to_free);
}
leaflock_pool_unlock();
r = toku_pthread_mutex_destroy(&pool_mutex); assert(r == 0);
}
int
toku_leaflock_borrow(LEAFLOCK *leaflockp) {
leaflock_pool_lock();
LEAFLOCK loaner;
int r;
if (free_list) {
assert(num_in_pool>0);
num_in_pool--;
loaner = free_list;
free_list = free_list->next;
r = 0;
}
else {
numlocks++;
//Create one
MALLOC(loaner);
if (loaner==NULL) r = ENOMEM;
else {
memset(loaner, 0, sizeof(*loaner));
loaner->id = numlocks;
r = toku_pthread_mutex_init(&loaner->lock, NULL); assert(r==0);
}
}
if (r==0) {
loaner->next = NULL;
*leaflockp = loaner;
}
leaflock_pool_unlock();
return r;
}
//Caller of this function must be holding the lock being returned.
void
toku_leaflock_unlock_and_return(LEAFLOCK *leaflockp) {
leaflock_pool_lock();
LEAFLOCK loaner = *leaflockp;
*leaflockp = NULL; //Take away caller's reference for good hygiene.
toku_leaflock_unlock_by_leaf(loaner);
num_in_pool++;
if (num_in_pool > pool_high_water_mark)
pool_high_water_mark = num_in_pool;
assert (num_in_pool <= numlocks);
loaner->next = free_list;
free_list = loaner;
leaflock_pool_unlock();
}
void
toku_leaflock_lock_by_leaf(LEAFLOCK leaflock) {
assert(leaflock->next==NULL);
int r = toku_pthread_mutex_lock(&leaflock->lock); assert(r==0);
}
void
toku_leaflock_unlock_by_leaf(LEAFLOCK leaflock) {
assert(leaflock->next==NULL);
int r = toku_pthread_mutex_unlock(&leaflock->lock); assert(r==0);
}
void
toku_leaflock_lock_by_cursor(LEAFLOCK leaflock) {
int r = toku_pthread_mutex_lock(&leaflock->lock); assert(r==0);
}
void
toku_leaflock_unlock_by_cursor(LEAFLOCK leaflock) {
int r = toku_pthread_mutex_unlock(&leaflock->lock); assert(r==0);
}
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
#ifndef TOKU_LEAFLOCK_H
#define TOKU_LEAFLOCK_H
typedef struct leaflock *LEAFLOCK;
void toku_leaflock_init(void);
void toku_leaflock_destroy(void);
int toku_leaflock_borrow(LEAFLOCK *leaflockp);
void toku_leaflock_unlock_and_return(LEAFLOCK *leaflockp);
void toku_leaflock_lock_by_leaf(LEAFLOCK leaflock);
void toku_leaflock_unlock_by_leaf(LEAFLOCK leaflock);
void toku_leaflock_lock_by_cursor(LEAFLOCK leaflock);
void toku_leaflock_unlock_by_cursor(LEAFLOCK leaflock);
#endif
......@@ -3,6 +3,9 @@
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
//TODO: #1378 This is not threadsafe. Make sure when splitting locks
//that we protect these calls.
// This list is intended to be embedded in other data structures.
struct list {
struct list *next, *prev;
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
#include "toku_portability.h"
......@@ -96,6 +97,7 @@ void toku_omt_cursor_set_invalidate_callback(OMTCURSOR c, void (*f)(OMTCURSOR,vo
}
void toku_omt_cursor_invalidate (OMTCURSOR c) {
//If already invalid, do nothing.
if (c==NULL || c->omt==NULL) return;
if (c->invalidate) c->invalidate(c, c->invalidate_extra);
if (c->next == c) {
......@@ -144,6 +146,12 @@ static void associate (OMT omt, OMTCURSOR c)
c->omt = omt;
}
void
toku_omt_cursor_associate(OMT omt, OMTCURSOR c) {
assert(c->omt==NULL||c->omt==omt);
associate(omt, c);
}
static inline u_int32_t nweight(OMT omt, node_idx idx) {
if (idx==NODE_NULL) return 0;
else return (omt->i.t.nodes+idx)->weight;
......@@ -708,6 +716,7 @@ int toku_omt_insert_at(OMT omt, OMTVALUE value, u_int32_t index) {
int toku_omt_set_at (OMT omt, OMTVALUE value, u_int32_t index) {
if (index>=omt_size(omt)) return EINVAL;
invalidate_cursors(omt);
if (omt->is_array) {
set_at_internal_array(omt, value, index);
}
......
......@@ -469,5 +469,19 @@ void toku_omt_cursor_set_invalidate_callback(OMTCURSOR c, void (*f)(OMTCURSOR,vo
// The lifetime of the 'extra' parameter must continue at least till the cursor
// is destroyed.
void toku_omt_cursor_associate(OMT omt, OMTCURSOR c);
// Effect:
// Associates an omtcursor with an omt.
// Requires:
// The omtcursor is not associated with any other omt.
// Requires:
// toku_omt_associate must be called when the omt-lock is held
// Rationale:
// This is used by brt_cursors for omts representing leaf nodes.
// These omts are touched by multiple threads, and therefore require locks
// for modifying the list of omtcursors.
// We do not want to grab two locks (one for omt, and one for the old
// associated omt).
#endif /* #ifndef OMT_H */
......@@ -163,7 +163,6 @@ static void toku_recover_fheader (LSN UU(lsn), TXNID UU(txnid),FILENUM filenum,L
pair->brt->compare_fun = 0;
pair->brt->dup_compare = 0;
pair->brt->db = 0;
pair->brt->skey = pair->brt->sval = 0;
}
pair->brt->h = h;
pair->brt->nodesize = h->nodesize;
......@@ -475,7 +474,6 @@ toku_recover_fopen (LSN UU(lsn), TXNID UU(txnid), BYTESTRING fname, FILENUM file
brt->db = 0;
r = toku_cachetable_openfd(&cf, ct, fd, fixedfname);
assert(r==0);
brt->skey = brt->sval = 0;
brt->cf=cf;
toku_recover_note_cachefile(filenum, cf, brt);
toku_free_BYTESTRING(fname);
......
......@@ -73,6 +73,7 @@ REGRESSION_TESTS_RAW = \
keyrange-unflat \
keyrange-dupsort \
keyrange-dupsort-unflat \
keytest \
log-test \
log-test2 \
log-test3 \
......@@ -127,7 +128,11 @@ check_ok:
# Don't run 1305 under valgrind. It takes way too long.
check_test1305: VGRIND=
check_test1305:
ifeq ($(SKIP_VERY_SLOW_TESTS),1)
check_test1305 check_test1308a:
@echo SKIPPED SLOW TEST $@
endif
check_benchmarktest_256: benchmark-test$(BINSUF)
$(VGRIND) ./$< $(VERBVERBOSE) --valsize 256 --verify 1 $(SUMMARIZE_CMD)
......@@ -157,4 +162,5 @@ clean:
rm -f cachetable-fd-test.ctest2.data test_oexcl.c.tmp
rm -f *.brt *.clean *.dirty *.tdb *.dat *.data *.out
$(BINS):
$(BINS): $(LINK_FILES)
$(BINS): test.h
......@@ -9,7 +9,18 @@ static const char fname[]= __FILE__ ".brt";
static TOKUTXN const null_txn = 0;
static DB * const null_db = 0;
static int
save_data (ITEMLEN UU(keylen), bytevec UU(key), ITEMLEN vallen, bytevec val, void *v) {
assert(key!=NULL);
void **vp = v;
*vp = toku_memdup(val, vallen);
return 0;
}
// Verify that different cursors return different data items when a DBT is initialized to all zeros (no flags)
// Note: The BRT test used to implement DBTs with per-cursor allocated space, but there isn't any such thing any more
// so this test is a little bit obsolete.
static void test_multiple_brt_cursor_dbts(int n, DB *db) {
if (verbose) printf("test_multiple_brt_cursors:%d %p\n", n, db);
......@@ -33,14 +44,14 @@ static void test_multiple_brt_cursor_dbts(int n, DB *db) {
snprintf(key, sizeof key, "k%04d", i);
snprintf(val, sizeof val, "v%04d", i);
r = toku_brt_insert(brt,
toku_fill_dbt(&kbt, key, strlen(key)),
toku_fill_dbt(&vbt, val, strlen(val)),
toku_fill_dbt(&kbt, key, 1+strlen(key)),
toku_fill_dbt(&vbt, val, 1+strlen(val)),
0);
assert(r == 0);
}
for (i=0; i<n; i++) {
r = toku_brt_cursor(brt, &cursors[i], 0);
r = toku_brt_cursor(brt, &cursors[i]);
assert(r == 0);
}
......@@ -50,24 +61,26 @@ static void test_multiple_brt_cursor_dbts(int n, DB *db) {
char key[10];
snprintf(key, sizeof key, "k%04d", i);
r = toku_brt_cursor_get(cursors[i],
toku_fill_dbt(&kbt, key, strlen(key)),
toku_fill_dbt(&kbt, key, 1+strlen(key)),
toku_init_dbt(&vbt),
save_data,
&ptrs[i],
DB_SET,
null_txn);
assert(r == 0);
ptrs[i] = vbt.data;
}
for (i=0; i<n; i++) {
int j;
for (j=i+1; j<n; j++) {
assert(ptrs[i]!=ptrs[j]);
assert(strcmp(ptrs[i],ptrs[j])!=0);
}
}
for (i=0; i<n; i++) {
r = toku_brt_cursor_close(cursors[i]);
assert(r == 0);
toku_free(ptrs[i]);
}
r = toku_close_brt(brt, 0, 0);
......
This diff is collapsed.
......@@ -31,10 +31,7 @@ static void test_named_db (void) {
r = toku_open_brt(n0, "db1", 0, &t0, 1<<12, ct, null_txn, toku_default_compare_fun, null_db); assert(r==0);
{
r = toku_brt_lookup(t0, toku_fill_dbt(&k, "good", 5), toku_init_dbt(&v));
assert(r==0);
assert(v.size==4);
assert(strcmp(v.data,"day")==0);
brt_lookup_and_check_nodup(t0, "good", "day");
}
r = toku_close_brt(t0, 0, 0); assert(r==0);
......
This diff is collapsed.
......@@ -22,10 +22,10 @@ static void test1 (void) {
assert(r==0);
toku_brt_insert(t, toku_fill_dbt(&k, "hello", 6), toku_fill_dbt(&v, "there", 6), null_txn);
{
r = toku_brt_lookup(t, toku_fill_dbt(&k, "hello", 6), toku_init_dbt(&v));
struct check_pair pair = {6, "hello", 6, "there", 0};
r = toku_brt_lookup(t, toku_fill_dbt(&k, "hello", 6), NULL, lookup_checkf, &pair);
assert(r==0);
assert(strcmp(v.data, "there")==0);
assert(v.size==6);
assert(pair.call_count==1);
}
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
......
......@@ -37,14 +37,14 @@ static void test5 (void) {
int rk = random()%limit;
if (values[rk]>=0) {
char key[100], valexpected[100];
DBT k,v;
DBT k;
if (i%1000==0 && verbose) { printf("r"); fflush(stdout); }
snprintf(key, 100, "key%d", rk);
snprintf(valexpected, 100, "val%d", values[rk]);
r = toku_brt_lookup(t, toku_fill_dbt(&k, key, 1+strlen(key)), toku_init_dbt(&v));
struct check_pair pair = {1+strlen(key), key, 1+strlen(valexpected), valexpected, 0};
r = toku_brt_lookup(t, toku_fill_dbt(&k, key, 1+strlen(key)), NULL, lookup_checkf, &pair);
assert(r==0);
assert(v.size==(1+strlen(valexpected)));
assert(memcmp(v.data,valexpected,v.size)==0);
assert(pair.call_count==1);
}
}
if (verbose) printf("\n");
......
......@@ -41,8 +41,11 @@ static void test_flat (void) {
snprintf(key, 100, "%08llu", (unsigned long long)2*i+1);
snprintf(val, 100, "%08llu", (unsigned long long)2*j+1);
DBT k,v;
r = toku_brt_lookup(t, toku_fill_dbt(&k, key, 1+strlen(key)), toku_fill_dbt(&v, val, 1+strlen(val)));
struct check_pair pair = {1+strlen(key), key, 1+strlen(val), val, 0};
r = toku_brt_lookup(t, toku_fill_dbt(&k, key, 1+strlen(key)), toku_fill_dbt(&v, val, 1+strlen(val)),
lookup_checkf, &pair);
assert(r==0);
assert(pair.call_count==1);
}
}
for (i=0; i<limit; i++) {
......
......@@ -30,9 +30,11 @@ static void test_flat (void) {
for (i=0; i<limit; i++) {
char key[100];
snprintf(key, 100, "%08llu", (unsigned long long)2*i+1);
DBT k,v;
r = toku_brt_lookup(t, toku_fill_dbt(&k, key, 1+strlen(key)), toku_init_dbt(&v));
DBT k;
struct check_pair pair = {1+strlen(key), key, 1+strlen(key), key, 0};
r = toku_brt_lookup(t, toku_fill_dbt(&k, key, 1+strlen(key)), NULL, lookup_checkf, &pair);
assert(r==0);
assert(pair.call_count==1);
}
for (i=0; i<limit; i++) {
char key[100];
......
#include "test.h"
#include "key.h"
void
toku_test_keycompare (void) {
assert(toku_keycompare("a",1, "a",1)==0);
assert(toku_keycompare("aa",2, "a",1)>0);
assert(toku_keycompare("a",1, "aa",2)<0);
assert(toku_keycompare("b",1, "aa",2)>0);
assert(toku_keycompare("aa",2, "b",1)<0);
assert(toku_keycompare("aaaba",5, "aaaba",5)==0);
assert(toku_keycompare("aaaba",5, "aaaaa",5)>0);
assert(toku_keycompare("aaaaa",5, "aaaba",5)<0);
assert(toku_keycompare("aaaaa",3, "aaaba",3)==0);
assert(toku_keycompare("\000\000\000\a", 4, "\000\000\000\004", 4)>0);
}
int
test_main (int argc , const char *argv[]) {
default_parse_args(argc, argv);
toku_test_keycompare();
if (verbose) printf("test ok\n");
return 0;
}
......@@ -17,35 +17,40 @@ test_main (int argc __attribute__((__unused__)), const char *argv[] __attribute
int r;
DB a_db;
DB *db = &a_db;
DBT key,val;
unlink_file_and_bit(fname);
r = toku_brt_create_cachetable(&ct, 0, ZERO_LSN, NULL_LOGGER); assert(r==0);
r = toku_open_brt(fname, 0, 1, &brt, 1<<12, ct, null_txn, test_brt_cursor_keycompare, db); assert(r==0);
r = toku_brt_cursor(brt, &cursor, 0); assert(r==0);
r = toku_brt_cursor(brt, &cursor); assert(r==0);
int i;
for (i=0; i<1000; i++) {
char string[100];
snprintf(string, sizeof(string), "%04d", i);
DBT key,val;
r = toku_brt_insert(brt, toku_fill_dbt(&key, string, 5), toku_fill_dbt(&val, string, 5), 0); assert(r==0);
}
r = toku_brt_cursor_get(cursor, &key, &val, DB_NEXT, null_txn); assert(r==0);
assert(strcmp(key.data, "0000")==0);
assert(strcmp(val.data, "0000")==0);
r = toku_brt_cursor_get(cursor, &key, &val, DB_NEXT, null_txn); assert(r==0);
assert(strcmp(key.data, "0001")==0);
assert(strcmp(val.data, "0001")==0);
{
struct check_pair pair = {5, "0000", 5, "0000", 0};
r = toku_brt_cursor_get(cursor, NULL, NULL, lookup_checkf, &pair, DB_NEXT, null_txn); assert(r==0); assert(pair.call_count==1);
}
{
struct check_pair pair = {5, "0001", 5, "0001", 0};
r = toku_brt_cursor_get(cursor, NULL, NULL, lookup_checkf, &pair, DB_NEXT, null_txn); assert(r==0); assert(pair.call_count==1);
}
// This will invalidate due to the root counter bumping, but the OMT itself will still be valid.
{
DBT key, val;
r = toku_brt_insert(brt, toku_fill_dbt(&key, "d", 2), toku_fill_dbt(&val, "w", 2), 0); assert(r==0);
}
r = toku_brt_cursor_get(cursor, &key, &val, DB_NEXT, null_txn); assert(r==0);
assert(strcmp(key.data, "0002")==0);
assert(strcmp(val.data, "0002")==0);
{
struct check_pair pair = {5, "0002", 5, "0002", 0};
r = toku_brt_cursor_get(cursor, NULL, NULL, lookup_checkf, &pair, DB_NEXT, null_txn); assert(r==0); assert(pair.call_count==1);
}
r = toku_brt_cursor_close(cursor); assert(r==0);
r = toku_close_brt(brt, 0, 0); assert(r==0);
......
......@@ -29,15 +29,22 @@ doit (void) {
r = toku_brt_delete_both(t, toku_fill_dbt(&k, "a", 2), toku_fill_dbt(&v, "y", 2), null_txn);
assert(r==0);
r = toku_brt_lookup(t, toku_fill_dbt(&k, "a", 2), toku_init_dbt(&v));
{
struct check_pair pair = {len_ignore, 0, 2, "x", 0};
r = toku_brt_lookup(t, toku_fill_dbt(&k, "a", 2), NULL, lookup_checkf, &pair);
assert(r==0);
assert(v.size==2 && strcmp(v.data, "x")==0);
assert(pair.call_count==1);
}
r = toku_brt_delete_both(t, toku_fill_dbt(&k, "a", 2), toku_fill_dbt(&v, "x", 2), null_txn);
assert(r==0);
r = toku_brt_lookup(t, toku_fill_dbt(&k, "a", 2), toku_init_dbt(&v));
{
struct check_pair pair = {0,0,0,0,0};
r = toku_brt_lookup(t, toku_fill_dbt(&k, "a", 2), NULL, lookup_checkf, &pair);
assert(r==DB_NOTFOUND);
assert(pair.call_count==0);
}
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
......
......@@ -53,8 +53,10 @@ doit (void) {
assert(r==0);
memset(&v, 0, sizeof(v));
r = toku_brt_lookup(t, &k, &v);
struct check_pair pair = {6, "hello", 6, "there", 0};
r = toku_brt_lookup(t, &k, &v, lookup_checkf, &pair);
assert(r==0);
assert(pair.call_count == 1);
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
......
#include "toku_assert.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
......@@ -5,10 +6,64 @@
#include "toku_portability.h"
#include "brt.h"
#define CKERR(r) do { if (r!=0) fprintf(stderr, "%s:%d error %d %s\n", __FILE__, __LINE__, r, strerror(r)); assert(r==0); } while (0)
#define CKERR2(r,r2) do { if (r!=r2) fprintf(stderr, "%s:%d error %d %s, expected %d\n", __FILE__, __LINE__, r, strerror(r), r2); assert(r==r2); } while (0)
#define CKERR2s(r,r2,r3) do { if (r!=r2 && r!=r3) fprintf(stderr, "%s:%d error %d %s, expected %d or %d\n", __FILE__, __LINE__, r, strerror(r), r2,r3); assert(r==r2||r==r3); } while (0)
const ITEMLEN len_ignore = 0xFFFFFFFF;
struct check_pair {
ITEMLEN keylen; // A keylen equal to 0xFFFFFFFF means don't check the keylen or the key.
bytevec key; // A NULL key means don't check the key.
ITEMLEN vallen; // Similarly for vallen and null val.
bytevec val;
int call_count;
};
static int
lookup_checkf (ITEMLEN keylen, bytevec key, ITEMLEN vallen, bytevec val, void *pair_v) {
struct check_pair *pair = pair_v;
if (key!=NULL) {
if (pair->keylen!=len_ignore) {
assert(pair->keylen == keylen);
if (pair->key)
assert(memcmp(pair->key, key, keylen)==0);
}
if (pair->vallen!=len_ignore) {
assert(pair->vallen == vallen);
if (pair->val)
assert(memcmp(pair->val, val, vallen)==0);
}
pair->call_count++; // this call_count is really how many calls were made with r==0
}
return 0;
}
static inline void
brt_lookup_and_check_nodup (BRT t, char *keystring, char *valstring)
{
DBT k = {.size=1+strlen(keystring), .data=keystring};
struct check_pair pair = {1+strlen(keystring), keystring,
1+strlen(valstring), valstring,
0};
int r = toku_brt_lookup(t, &k, 0, lookup_checkf, &pair);
assert(r==0);
assert(pair.call_count==1);
}
static inline void
brt_lookup_and_fail_nodup (BRT t, char *keystring)
{
DBT k = {.size=1+strlen(keystring), .data=keystring};
struct check_pair pair = {1+strlen(keystring), keystring,
0, 0,
0};
int r = toku_brt_lookup(t, &k, 0, lookup_checkf, &pair);
assert(r!=0);
assert(pair.call_count==0);
}
int verbose=0;
void
......
......@@ -2,7 +2,6 @@
#include "toku_portability.h"
#include <assert.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
......
......@@ -5,18 +5,31 @@
#include "includes.h"
static void
cleanup_and_free(struct simple_dbt *v) {
if (v->data) toku_free(v->data);
v->data = NULL;
v->len = 0;
}
static void
cleanup(struct simple_dbt *v) {
v->data = NULL;
v->len = 0;
}
static void ybt_test0 (void) {
void *v0=0,*v1=0;
struct simple_dbt v0 = {0,0}, v1 = {0,0};
DBT t0,t1;
toku_init_dbt(&t0);
toku_init_dbt(&t1);
{
bytevec temp1 = "hello";
toku_dbt_set_value(&t0, &temp1, 6, &v0, FALSE);
toku_dbt_set(6, temp1, &t0, &v0);
}
{
bytevec temp2 = "foo";
toku_dbt_set_value(&t1, &temp2, 4, &v1, FALSE);
toku_dbt_set( 4, temp2, &t1, &v1);
}
assert(t0.size==6);
assert(strcmp(t0.data, "hello")==0);
......@@ -25,14 +38,15 @@ static void ybt_test0 (void) {
{
bytevec temp3 = "byebye";
toku_dbt_set_value(&t1, &temp3, 7, &v0, FALSE); /* Use v0, not v1 */
toku_dbt_set(7, temp3, &t1, &v0); /* Use v0, not v1 */
}
// This assertion would be wrong, since v0 may have been realloc'd, and t0.data may now point
// at the wrong place
//assert(strcmp(t0.data, "byebye")==0); /* t0's data should be changed too, since it used v0 */
assert(strcmp(t1.data, "byebye")==0);
toku_free(v0); toku_free(v1);
cleanup_and_free(&v0);
cleanup_and_free(&v1);
toku_memory_check_all_free();
/* See if we can probe to find out how big something is by setting ulen=0 with YBT_USERMEM */
......@@ -41,7 +55,7 @@ static void ybt_test0 (void) {
t0.ulen = 0;
{
bytevec temp4 = "hello";
toku_dbt_set_value(&t0, &temp4, 6, 0, FALSE);
toku_dbt_set(6, temp4, &t0, 0);
}
assert(t0.data==0);
assert(t0.size==6);
......@@ -49,18 +63,18 @@ static void ybt_test0 (void) {
/* Check realloc. */
toku_init_dbt(&t0);
t0.flags = DB_DBT_REALLOC;
v0 = 0;
cleanup(&v0);
{
bytevec temp5 = "internationalization";
toku_dbt_set_value(&t0, &temp5, 21, &v0, FALSE);
toku_dbt_set(21, temp5, &t0, &v0);
}
assert(v0==0); /* Didn't change v0 */
assert(v0.data==0); /* Didn't change v0 */
assert(t0.size==21);
assert(strcmp(t0.data, "internationalization")==0);
{
bytevec temp6 = "provincial";
toku_dbt_set_value(&t0, &temp6, 11, &v0, FALSE);
toku_dbt_set(11, temp6, &t0, &v0);
}
assert(t0.size==11);
assert(strcmp(t0.data, "provincial")==0);
......
......@@ -47,4 +47,28 @@
fun:deflate
fun:compress2
}
{
compress_is_not_valgrind_clean_ubuntu810
Memcheck:Value8
obj:/usr/lib/libz.so.1.2.3.3
fun:deflate
fun:compress2
}
{
compress_is_not_valgrind_clean2_ubuntu810
Memcheck:Cond
obj:/usr/lib/libz.so.1.2.3.3
obj:/usr/lib/libz.so.1.2.3.3
fun:deflate
fun:compress2
}
{
compress_is_not_valgrind_clean3_ubuntu810
Memcheck:Value8
obj:/usr/lib/libz.so.1.2.3.3
obj:/usr/lib/libz.so.1.2.3.3
obj:/usr/lib/libz.so.1.2.3.3
fun:deflate
fun:compress2
}
This diff is collapsed.
......@@ -10,14 +10,8 @@
DBT* toku_init_dbt (DBT *);
DBT *toku_fill_dbt(DBT *dbt, bytevec k, ITEMLEN len);
int toku_dbt_set (ITEMLEN len, bytevec val, DBT *d, struct simple_dbt *sdbt);
int toku_dbt_set_value (DBT *, bytevec *val, ITEMLEN vallen, void **staticptrp, BOOL ybt1_disposable);
int toku_dbt_set_two_values(DBT* key, bytevec *key_data, ITEMLEN key_len, void** key_staticptrp, BOOL key_disposable,
DBT* val, bytevec *val_data, ITEMLEN val_len, void** val_staticptrp, BOOL val_disposable);
int toku_dbt_set_three_values(
DBT* ybt1, bytevec *ybt1_data, ITEMLEN ybt1_len, void** ybt1_staticptrp, BOOL ybt1_disposable,
DBT* ybt2, bytevec *ybt2_data, ITEMLEN ybt2_len, void** ybt2_staticptrp, BOOL ybt2_disposable,
DBT* ybt3, bytevec *ybt3_data, ITEMLEN ybt3_len, void** ybt3_staticptrp, BOOL ybt3_disposable);
void toku_sdbt_cleanup(struct simple_dbt *sdbt);
#endif
libtokudb.so
libtokudbtrace.so
export.def
......@@ -70,7 +70,7 @@ install: libs install_libs ;
.PHONY: local libs buildlocktrees
libs: $(LIBRARIES) ;
$(LIBRARIES): export.def
$(IPO_YDB) $(NOIPO_YDB) $(LIBRARIES): export.def
export.def: export.map
echo "EXPORTS" > $@
cat export.map |sed -n "s/\([a-zA-Z_0-9][a-zA-Z_0-9]*\);/\t\1 @/g;/@/ P" |sed -n 'P;=' | sed '{;N;s/\n//;}' >> $@
......
EXPORTS
db_create @1
db_env_create @2
db_strerror @3
db_version @4
log_compare @5
db_env_set_func_fsync @6
db_env_set_func_malloc @7
db_env_set_func_realloc @8
db_env_set_func_free @9
db_env_set_func_pwrite @10
db_env_set_func_write @11
toku_os_get_max_rss @12
toku_ydb_error_all_cases @13
toku_set_trace_file @14
toku_close_trace_file @15
toku_add_trace_mem @16
toku_print_trace_mem @17
toku_free @18
toku_malloc @19
toku_os_get_file_size @20
toku_os_getpid @21
toku_os_gettid @22
toku_os_initialize_settings @23
toku_os_is_absolute_name @24
toku_os_mkdir @25
toku_realloc @26
toku_strdup @27
dlmalloc @28
dlrealloc @29
dlfree @30
setup_dlmalloc @31
toku_cachetable_print_hash_histogram @32
......@@ -40,6 +40,8 @@
toku_cachetable_print_hash_histogram;
toku_default_compare_fun;
local: *;
};
......@@ -92,8 +92,8 @@ endif
TLRECOVER = 2 3 4 5 6 7 8 9 10
EXTRA_TDB_TESTS = \
test_db_assoc3.tdbrun_wasbad \
$(patsubst %,test_log%.recover,$(TLRECOVER)) \
# test_db_assoc3.tdbrun_wasbad \# Obsolete right now.
#\ ends prev line
RUN_TDB_TESTS = $(patsubst %.tdb$(BINSUF),%.tdbrun,$(TDB_TESTS)) $(EXTRA_TDB_TESTS)
......@@ -304,11 +304,12 @@ tgbr_%_c.tdbrun: test_get_both_range.tdb$(BINSUF)
# test1426 is run by comparing the BDB output to the TDB output
test1426.tdbrun: test1426.tdb$(BINSUF) test1426.bdb$(BINSUF)
./test1426.tdb -q
./test1426.bdb -q
$(BDBDIR)/bin/db_dump -p -h dir.test1426.c.bdb main > dump.bdb.1426
../../utils/tokudb_dump$(BINSUF) -p -h dir.test1426.c.tdb main > dump.tdb.1426
diff -I db_pagesize=4096 dump.bdb.1426 dump.tdb.1426
(./test1426.tdb -q && \
./test1426.bdb -q && \
$(BDBDIR)/bin/db_dump -p -h dir.test1426.c.bdb main > dump.bdb.1426 && \
../../utils/tokudb_dump$(BINSUF) -p -h dir.test1426.c.tdb main > dump.tdb.1426 && \
diff -I db_pagesize=4096 dump.bdb.1426 dump.tdb.1426 ) \
$(MAYBEINVERTER) $(SUMMARIZE_CMD)
# helgrind1 is supposed to fail.
helgrind1.tdbrun: TDBVGRIND=$(HGRIND) --log-file=helgrind1.tdb.deleteme
......
......@@ -22,6 +22,7 @@ do_db_work(void) {
if (verbose==0) {
error_file = fopen(ENVDIR "/stderr", "w"); assert(error_file);
}
else error_file = stderr;
DB_ENV *env;
DB_TXN *tid;
......@@ -53,7 +54,7 @@ do_db_work(void) {
shutdown1:
r=db->close(db, 0); DOERR(r);
r=env->close(env, 0); DOERR(r);
if (error_file) fclose(error_file);
if (error_file && error_file!=stderr) fclose(error_file);
if (did_fail) return;
}
{
......@@ -64,6 +65,7 @@ do_db_work(void) {
if (verbose==0) {
error_file = fopen(ENVDIR "/stderr", "w"); assert(error_file);
}
else error_file = stderr;
DB_ENV *env;
DB_TXN *tid;
......@@ -125,7 +127,7 @@ do_db_work(void) {
shutdown2:
r=db->close(db, 0); DOERR(r);
r=env->close(env, 0); DOERR(r);
if (error_file) fclose(error_file);
if (error_file && error_file!=stderr) fclose(error_file);
}
}
......
......@@ -11,6 +11,11 @@
#include <limits.h>
#if defined(USE_TDB)
#include "ydb.h"
//TDB uses DB_NOTFOUND for c_del and DB_CURRENT errors.
#ifdef DB_KEYEMPTY
#error
#endif
#define DB_KEYEMPTY DB_NOTFOUND
#endif
#ifndef DB_YESOVERWRITE
#define DB_YESOVERWRITE 0
......
......@@ -103,8 +103,9 @@ test_insert_and_abort_and_insert(u_int32_t num_to_insert) {
#define bit0 (1<<0)
#define bit1 (1<<1)
static void
static int
do_nothing(DBT const *UU(a), DBT const *UU(b), void *UU(c)) {
return 0;
}
static void
......
......@@ -142,8 +142,9 @@ test_insert_and_abort_and_insert(u_int32_t num_to_insert, int abort_type) {
#define bit0 (1<<0)
#define bit1 (1<<1)
static void
static int
do_nothing(DBT const *UU(a), DBT const *UU(b), void *UU(c)) {
return 0;
}
static void
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment