Commit 1a48d758 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

Merge in the 1390 fixes, and delete 1390. Fixes #1390.

{{{
svn merge -r10820:HEAD https://svn.tokutek.com/tokudb/toku/tokudb.1390
}}}


git-svn-id: file:///svn/toku/tokudb@11192 c7de825b-a66e-492c-adef-691d508d4ae1
parent 7ebad62d
......@@ -19,7 +19,7 @@ CFLAGS = -Wall -W -Werror -g $(OPTFLAGS)
runs: runs_mysql runs_installed
samples: sample_offsets_4_6 sample_offsets_4_5 sample_offsets_4_4 sample_offsets_4_3 sample_offsets_4_1
hs: db.h_4_6 db.h_4_5 db.h_4_4 db.h_4_3 db.h_4_1
hs: db.h_4_6 db.h_4_5 db.h_4_4 db.h_4_3 db.h_4_1 tdb.h
# the mysql versions use the header in the mysql distribution.
runs_mysql: ./sample_offsets_mysql
./sample_offsets_mysql
......@@ -30,7 +30,7 @@ sample_offsets_mysql: sample_offsets.c
$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@
make_db_h_4_1.o: make_db_h.c sample_offsets_32_4_1.h sample_offsets_64_4_1.h
$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.1.25/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=1
$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.1.25/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=1 -DTDB_NATIVE=0
db.h_4_1: make_db_h_4_1
./make_db_h_4_1 > $@
sample_offsets_4_1: sample_offsets.c
......@@ -38,7 +38,7 @@ sample_offsets_4_1: sample_offsets.c
./sample_offsets_4_1
make_db_h_4_3.o: make_db_h.c sample_offsets_32_4_3.h sample_offsets_64_4_3.h
$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.3.29/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=3
$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.3.29/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=3 -DTDB_NATIVE=0
db.h_4_3: make_db_h_4_3
./make_db_h_4_3 > $@
sample_offsets_4_3: sample_offsets.c
......@@ -46,7 +46,7 @@ sample_offsets_4_3: sample_offsets.c
./sample_offsets_4_3
make_db_h_4_4.o: make_db_h.c sample_offsets_32_4_4.h sample_offsets_64_4_4.h
$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.4.20/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=4
$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.4.20/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=4 -DTDB_NATIVE=0
db.h_4_4: make_db_h_4_4
./make_db_h_4_4 > $@
sample_offsets_4_4: sample_offsets.c
......@@ -54,7 +54,7 @@ sample_offsets_4_4: sample_offsets.c
./sample_offsets_4_4
make_db_h_4_5.o: make_db_h.c sample_offsets_32_4_5.h sample_offsets_64_4_5.h
$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.5.20/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=5
$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.5.20/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=5 -DTDB_NATIVE=0
db.h_4_5: make_db_h_4_5
./make_db_h_4_5 > $@
sample_offsets_4_5: sample_offsets.c
......@@ -62,19 +62,24 @@ sample_offsets_4_5: sample_offsets.c
./sample_offsets_4_5
make_db_h_4_6.o: make_db_h.c sample_offsets_32_4_6.h sample_offsets_64_4_6.h
$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.6.19/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=6
$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.6.19/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=6 -DTDB_NATIVE=0
db.h_4_6: make_db_h_4_6
./make_db_h_4_6 > $@
sample_offsets_4_6: sample_offsets.c
$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.6.19/build_unix $< -o $@
./sample_offsets_4_6
make_tdb_h.o: make_db_h.c
$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.6.19/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=6 -DTDB_NATIVE=1
tdb.h: make_tdb_h
./make_tdb_h > $@
sample_offsets:
sample_offsets_local: ./db.h
sample_offsets_local: sample_offsets.c
$(CC) $(CFLAGS) -I. -DLOCAL $< -o $@
hfiles: db.h_4_1 db.h_4_3 db.h_4_4 db.h_4_5 db.h_4_6
hfiles: db.h_4_1 db.h_4_3 db.h_4_4 db.h_4_5 db.h_4_6 tdb.h
check32: sample_offsets_local
./sample_offsets_local
......@@ -82,7 +87,9 @@ check32: sample_offsets_local
clean:
rm -f sample_offsets_mysql sample_offsets sample_offsets_?_? *.o make_db_h_?_?
install: db.h_$(BDB)
install: tdb.h
cp tdb.h ../include/db.h
install_bdb_compatible: db.h_$(BDB)
cp db.h_$(BDB) ../include/db.h
# Note: To make the compile work, you must cd to the ../../berkeleydb/db-4.1.25/build_unix
......
......@@ -9,6 +9,7 @@
extern "C" {
#endif
#define TOKUDB 1
#define TOKUDB_NATIVE_H 0
#define DB_VERSION_MAJOR 4
#define DB_VERSION_MINOR 1
#define DB_VERSION_PATCH 25
......@@ -34,6 +35,7 @@ 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);
#include <tdb-internal.h>
typedef struct __toku_db_btree_stat64 {
u_int64_t bt_nkeys; /* how many unique keys (guaranteed only to be an estimate, even when flattened) */
u_int64_t bt_ndata; /* how many key-value pairs (an estimate, but exact when flattened) */
......@@ -122,6 +124,7 @@ typedef enum {
#endif
struct __toku_db_env {
struct __toku_db_env_internal *i;
#define db_env_struct_i(x) ((x)->i)
int (*checkpointing_postpone) (DB_ENV*) /* Use for 'rename table' or any other operation that must be disjoint from a checkpoint */;
int (*checkpointing_resume) (DB_ENV*) /* Alert tokudb 'postpone' is no longer necessary */;
int (*checkpointing_begin_atomic_operation) (DB_ENV*) /* Begin a set of operations (that must be atomic as far as checkpoints are concerned). i.e. inserting into every index in one table */;
......@@ -192,6 +195,7 @@ struct __toku_dbt {
};
struct __toku_db {
struct __toku_db_internal *i;
#define db_struct_i(x) ((x)->i)
int (*key_range64)(DB*, DB_TXN *, DBT *, u_int64_t *less, u_int64_t *equal, u_int64_t *greater, int *is_exact);
int (*stat64)(DB *, DB_TXN *, DB_BTREE_STAT64 *);
int (*pre_acquire_read_lock)(DB*, DB_TXN*, const DBT*, const DBT*, const DBT*, const DBT*);
......@@ -249,6 +253,7 @@ struct __toku_db_txn {
DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
DB_TXN *parent; /* 32-bit offset=4 size=4, 64=bit offset=8 size=8 */
struct __toku_db_txn_internal *i;
#define db_txn_struct_i(x) ((x)->i)
int (*txn_stat)(DB_TXN *, struct txn_stat **);
void* __toku_dummy0[7];
char __toku_dummy1[24];
......@@ -272,6 +277,7 @@ 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;
#define dbc_struct_i(x) ((x)->i)
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 *);
......
......@@ -9,6 +9,7 @@
extern "C" {
#endif
#define TOKUDB 1
#define TOKUDB_NATIVE_H 0
#define DB_VERSION_MAJOR 4
#define DB_VERSION_MINOR 3
#define DB_VERSION_PATCH 29
......@@ -34,6 +35,7 @@ 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);
#include <tdb-internal.h>
typedef struct __toku_db_btree_stat64 {
u_int64_t bt_nkeys; /* how many unique keys (guaranteed only to be an estimate, even when flattened) */
u_int64_t bt_ndata; /* how many key-value pairs (an estimate, but exact when flattened) */
......@@ -124,6 +126,7 @@ typedef enum {
#endif
struct __toku_db_env {
struct __toku_db_env_internal *i;
#define db_env_struct_i(x) ((x)->i)
int (*checkpointing_postpone) (DB_ENV*) /* Use for 'rename table' or any other operation that must be disjoint from a checkpoint */;
int (*checkpointing_resume) (DB_ENV*) /* Alert tokudb 'postpone' is no longer necessary */;
int (*checkpointing_begin_atomic_operation) (DB_ENV*) /* Begin a set of operations (that must be atomic as far as checkpoints are concerned). i.e. inserting into every index in one table */;
......@@ -202,6 +205,7 @@ struct __toku_dbt {
};
struct __toku_db {
struct __toku_db_internal *i;
#define db_struct_i(x) ((x)->i)
int (*key_range64)(DB*, DB_TXN *, DBT *, u_int64_t *less, u_int64_t *equal, u_int64_t *greater, int *is_exact);
int (*stat64)(DB *, DB_TXN *, DB_BTREE_STAT64 *);
int (*pre_acquire_read_lock)(DB*, DB_TXN*, const DBT*, const DBT*, const DBT*, const DBT*);
......@@ -265,6 +269,7 @@ struct __toku_db_txn {
DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
DB_TXN *parent; /* 32-bit offset=4 size=4, 64=bit offset=8 size=8 */
struct __toku_db_txn_internal *i;
#define db_txn_struct_i(x) ((x)->i)
int (*txn_stat)(DB_TXN *, struct txn_stat **);
void* __toku_dummy0[12];
char __toku_dummy1[24];
......@@ -288,6 +293,7 @@ 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;
#define dbc_struct_i(x) ((x)->i)
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 *);
......
......@@ -9,6 +9,7 @@
extern "C" {
#endif
#define TOKUDB 1
#define TOKUDB_NATIVE_H 0
#define DB_VERSION_MAJOR 4
#define DB_VERSION_MINOR 4
#define DB_VERSION_PATCH 20
......@@ -34,6 +35,7 @@ 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);
#include <tdb-internal.h>
typedef struct __toku_db_btree_stat64 {
u_int64_t bt_nkeys; /* how many unique keys (guaranteed only to be an estimate, even when flattened) */
u_int64_t bt_ndata; /* how many key-value pairs (an estimate, but exact when flattened) */
......@@ -125,6 +127,7 @@ typedef enum {
#endif
struct __toku_db_env {
struct __toku_db_env_internal *i;
#define db_env_struct_i(x) ((x)->i)
int (*checkpointing_postpone) (DB_ENV*) /* Use for 'rename table' or any other operation that must be disjoint from a checkpoint */;
int (*checkpointing_resume) (DB_ENV*) /* Alert tokudb 'postpone' is no longer necessary */;
int (*checkpointing_begin_atomic_operation) (DB_ENV*) /* Begin a set of operations (that must be atomic as far as checkpoints are concerned). i.e. inserting into every index in one table */;
......@@ -205,6 +208,7 @@ struct __toku_dbt {
};
struct __toku_db {
struct __toku_db_internal *i;
#define db_struct_i(x) ((x)->i)
int (*key_range64)(DB*, DB_TXN *, DBT *, u_int64_t *less, u_int64_t *equal, u_int64_t *greater, int *is_exact);
int (*stat64)(DB *, DB_TXN *, DB_BTREE_STAT64 *);
int (*pre_acquire_read_lock)(DB*, DB_TXN*, const DBT*, const DBT*, const DBT*, const DBT*);
......@@ -272,6 +276,7 @@ struct __toku_db_txn {
DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
DB_TXN *parent; /* 32-bit offset=4 size=4, 64=bit offset=8 size=8 */
struct __toku_db_txn_internal *i;
#define db_txn_struct_i(x) ((x)->i)
int (*txn_stat)(DB_TXN *, struct txn_stat **);
void* __toku_dummy0[15];
char __toku_dummy1[8];
......@@ -295,6 +300,7 @@ 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;
#define dbc_struct_i(x) ((x)->i)
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 *);
......
......@@ -9,6 +9,7 @@
extern "C" {
#endif
#define TOKUDB 1
#define TOKUDB_NATIVE_H 0
#define DB_VERSION_MAJOR 4
#define DB_VERSION_MINOR 5
#define DB_VERSION_PATCH 20
......@@ -34,6 +35,7 @@ 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);
#include <tdb-internal.h>
typedef struct __toku_db_btree_stat64 {
u_int64_t bt_nkeys; /* how many unique keys (guaranteed only to be an estimate, even when flattened) */
u_int64_t bt_ndata; /* how many key-value pairs (an estimate, but exact when flattened) */
......@@ -125,6 +127,7 @@ typedef enum {
#endif
struct __toku_db_env {
struct __toku_db_env_internal *i;
#define db_env_struct_i(x) ((x)->i)
int (*checkpointing_postpone) (DB_ENV*) /* Use for 'rename table' or any other operation that must be disjoint from a checkpoint */;
int (*checkpointing_resume) (DB_ENV*) /* Alert tokudb 'postpone' is no longer necessary */;
int (*checkpointing_begin_atomic_operation) (DB_ENV*) /* Begin a set of operations (that must be atomic as far as checkpoints are concerned). i.e. inserting into every index in one table */;
......@@ -205,6 +208,7 @@ struct __toku_dbt {
};
struct __toku_db {
struct __toku_db_internal *i;
#define db_struct_i(x) ((x)->i)
int (*key_range64)(DB*, DB_TXN *, DBT *, u_int64_t *less, u_int64_t *equal, u_int64_t *greater, int *is_exact);
int (*stat64)(DB *, DB_TXN *, DB_BTREE_STAT64 *);
int (*pre_acquire_read_lock)(DB*, DB_TXN*, const DBT*, const DBT*, const DBT*, const DBT*);
......@@ -272,6 +276,7 @@ struct __toku_db_txn {
DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
DB_TXN *parent; /* 32-bit offset=4 size=4, 64=bit offset=8 size=8 */
struct __toku_db_txn_internal *i;
#define db_txn_struct_i(x) ((x)->i)
int (*txn_stat)(DB_TXN *, struct txn_stat **);
void* __toku_dummy0[15];
char __toku_dummy1[8];
......@@ -295,6 +300,7 @@ 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;
#define dbc_struct_i(x) ((x)->i)
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 *);
......
......@@ -9,6 +9,7 @@
extern "C" {
#endif
#define TOKUDB 1
#define TOKUDB_NATIVE_H 0
#define DB_VERSION_MAJOR 4
#define DB_VERSION_MINOR 6
#define DB_VERSION_PATCH 19
......@@ -34,6 +35,7 @@ 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);
#include <tdb-internal.h>
typedef struct __toku_db_btree_stat64 {
u_int64_t bt_nkeys; /* how many unique keys (guaranteed only to be an estimate, even when flattened) */
u_int64_t bt_ndata; /* how many key-value pairs (an estimate, but exact when flattened) */
......@@ -127,6 +129,7 @@ typedef enum {
#endif
struct __toku_db_env {
struct __toku_db_env_internal *i;
#define db_env_struct_i(x) ((x)->i)
int (*checkpointing_postpone) (DB_ENV*) /* Use for 'rename table' or any other operation that must be disjoint from a checkpoint */;
int (*checkpointing_resume) (DB_ENV*) /* Alert tokudb 'postpone' is no longer necessary */;
int (*checkpointing_begin_atomic_operation) (DB_ENV*) /* Begin a set of operations (that must be atomic as far as checkpoints are concerned). i.e. inserting into every index in one table */;
......@@ -208,6 +211,7 @@ struct __toku_dbt {
};
struct __toku_db {
struct __toku_db_internal *i;
#define db_struct_i(x) ((x)->i)
int (*key_range64)(DB*, DB_TXN *, DBT *, u_int64_t *less, u_int64_t *equal, u_int64_t *greater, int *is_exact);
int (*stat64)(DB *, DB_TXN *, DB_BTREE_STAT64 *);
char __toku_dummy0[8];
......@@ -276,6 +280,7 @@ struct __toku_db_txn {
DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
DB_TXN *parent; /* 32-bit offset=4 size=4, 64=bit offset=8 size=8 */
struct __toku_db_txn_internal *i;
#define db_txn_struct_i(x) ((x)->i)
int (*txn_stat)(DB_TXN *, struct txn_stat **);
void* __toku_dummy0[16];
char __toku_dummy1[8];
......@@ -300,6 +305,7 @@ 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;
#define dbc_struct_i(x) ((x)->i)
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 *);
......
......@@ -192,7 +192,15 @@ void print_struct (const char *structname, int need_internal, struct fieldinfo *
unsigned int diff = diff64-diff32;
unsigned int n_dummys = diff/4;
if (need_internal && !did_toku_internal) {
printf(" struct __toku_%s_internal *i;\n", structname);
if (TDB_NATIVE &&
(strcmp(structname, "dbc")==0 ||
strcmp(structname, "db_txn")==0)) {
printf(" struct __toku_%s_internal ii;\n", structname);
printf("#define %s_struct_i(x) (&(x)->ii)\n", structname);
} else {
printf(" struct __toku_%s_internal *i;\n", structname);
printf("#define %s_struct_i(x) ((x)->i)\n", structname);
}
n_dummys--;
did_toku_internal=1;
}
......@@ -202,7 +210,9 @@ void print_struct (const char *structname, int need_internal, struct fieldinfo *
n_dummys--;
}
if (n_dummys>0) {
printf(" void* __toku_dummy%d[%d];\n", dummy_counter++, n_dummys);
if (!TDB_NATIVE)
printf(" void* __toku_dummy%d[%d];\n", dummy_counter, n_dummys);
dummy_counter++;
}
diff64-=diff*2;
diff32-=diff;
......@@ -210,7 +220,9 @@ void print_struct (const char *structname, int need_internal, struct fieldinfo *
}
assert(diff32==diff64);
if (diff32>0) {
printf(" char __toku_dummy%d[%d];\n", dummy_counter++, diff32);
if (!TDB_NATIVE)
printf(" char __toku_dummy%d[%d];\n", dummy_counter, diff32);
dummy_counter++;
}
current_32 = this_32;
current_64 = this_64;
......@@ -220,7 +232,10 @@ void print_struct (const char *structname, int need_internal, struct fieldinfo *
}
if (i+1<N) {
assert(strcmp(fields32[i].decl, fields64[i].decl)==0);
printf(" %s; /* 32-bit offset=%d size=%d, 64=bit offset=%d size=%d */\n", fields32[i].decl, fields32[i].off, fields32[i].size, fields64[i].off, fields64[i].size);
printf(" %s;", fields32[i].decl);
if (!TDB_NATIVE)
printf(" /* 32-bit offset=%d size=%d, 64=bit offset=%d size=%d */", fields32[i].off, fields32[i].size, fields64[i].off, fields64[i].size);
printf("\n");
} else {
assert(fields32[i].decl==0);
assert(fields64[i].decl==0);
......@@ -236,16 +251,22 @@ void print_struct (const char *structname, int need_internal, struct fieldinfo *
unsigned int diff64 = this_64-current_64;
if (diff32>0 && diff32<diff64) {
unsigned int diff = diff64-diff32;
printf(" void* __toku_dummy%d[%d]; /* Padding at the end */ \n", dummy_counter++, diff/4);
if (!TDB_NATIVE)
printf(" void* __toku_dummy%d[%d]; /* Padding at the end */ \n", dummy_counter, diff/4);
dummy_counter++;
diff64-=diff*2;
diff32-=diff;
}
if (diff32>0) {
printf(" char __toku_dummy%d[%d]; /* Padding at the end */ \n", dummy_counter++, diff32);
if (!TDB_NATIVE)
printf(" char __toku_dummy%d[%d]; /* Padding at the end */ \n", dummy_counter, diff32);
dummy_counter++;
diff64-=diff32;
diff32=0;
}
if (diff64>0) printf(" /* %d more bytes of alignment in the 64-bit case. */\n", diff64);
if (diff64>0)
if (!TDB_NATIVE)
printf(" /* %d more bytes of alignment in the 64-bit case. */\n", diff64);
assert(diff64<8); /* there could be a few left from alignment. */
}
printf("};\n");
......@@ -266,6 +287,7 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__un
assert(DB_VERSION_MAJOR==DB_VERSION_MAJOR_32);
assert(DB_VERSION_MINOR==DB_VERSION_MINOR_32);
printf("#define TOKUDB 1\n");
printf("#define TOKUDB_NATIVE_H %d\n", TDB_NATIVE);
dodefine(DB_VERSION_MAJOR);
dodefine(DB_VERSION_MINOR);
dodefine(DB_VERSION_PATCH);
......@@ -274,7 +296,7 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__un
printf("#else\n");
printf("#define DB_VERSION_STRING_ydb \"Tokutek: TokuDB (wrapped bdb)\"\n");
printf("#endif\n");
if (0) {
printf("#ifndef __BIT_TYPES_DEFINED__\n");
printf("/* Define some int types if not provided by the system. BIND does this, so we do it too. */\n");
......@@ -303,6 +325,8 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__un
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");
printf("#include <tdb-internal.h>\n");
//stat64
printf("typedef struct __toku_db_btree_stat64 {\n");
printf(" u_int64_t bt_nkeys; /* how many unique keys (guaranteed only to be an estimate, even when flattened) */\n");
......
This diff is collapsed.
This diff is collapsed.
#ifndef _TDB_INTERNAL_H
#define _TDB_INTERNAL_H
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
// Included by db.h, defines some internal structures. These structures are inlined in some versions of db.h
// the types DB_TXN and so forth have been defined.
struct simple_dbt {
u_int32_t len;
void *data;
};
struct __toku_db_txn_internal {
//TXNID txnid64; /* A sixty-four bit txn id. */
struct tokutxn *tokutxn;
struct __toku_lth *lth;
u_int32_t flags;
DB_TXN *child, *next, *prev;
};
struct __toku_dbc_internal {
struct brt_cursor *c;
DB_TXN *txn;
struct simple_dbt skey_s,sval_s;
struct simple_dbt *skey,*sval;
};
// end of _TDB_INTERNAL_H:
#endif
......@@ -2,7 +2,7 @@
.DEFAULT_GOAL= build
TOKUROOT=../
INCLUDEDIRS=-I.
INCLUDEDIRS=-I. -I../include
COMBINE=1
#TODO: Replace DEPEND_COMPILE with auto-dependancy generation.
DEPEND_COMPILE += \
......
......@@ -7,7 +7,7 @@
#define _FILE_OFFSET_BITS 64
#include "brttypes.h"
#include "ybt.h"
#include "../include/db.h"
#include <db.h>
#include "cachetable.h"
#include "log.h"
#include "brt-search.h"
......
......@@ -9,7 +9,7 @@
#endif
#define _FILE_OFFSET_BITS 64
#include "../include/db.h"
#include <db.h>
#include <inttypes.h>
typedef struct brt *BRT;
......@@ -115,9 +115,4 @@ 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
.DEFAULT_GOAL=build
TOKUROOT=../../
INCLUDEDIRS=-I. -I..
INCLUDEDIRS=-I. -I.. -I../../include
ifeq ($(CYGWIN),)
LINK_FILES += $(NEWBRT)
......
......@@ -5,7 +5,7 @@
// brttypes.h must be first to make 64-bit file mode work right in linux.
#include "brttypes.h"
#include "../include/db.h"
#include <db.h>
DBT* toku_init_dbt (DBT *);
......
......@@ -2,7 +2,7 @@
.DEFAULT_GOAL=build
TOKUROOT=../
INCLUDEDIRS=-I$(TOKUROOT)newbrt -I./lock_tree -I./range_tree
INCLUDEDIRS=-I$(TOKUROOT)newbrt -I../include -I./lock_tree -I./range_tree
DEPEND_COMPILE += \
ydb-internal.h \
$(TOKUROOT)include/db.h \
......@@ -10,7 +10,6 @@ DEPEND_COMPILE += \
$(TOKUROOT)newbrt/brt.h \
$(TOKUROOT)newbrt/log.c \
#End of line
ydbtrace.o tdbtrace.o: tdbtrace.h
include $(TOKUROOT)toku_include/Makefile.include
CPPFLAGS+=-D_GNU_SOURCE -D_THREAD_SAFE
......@@ -27,12 +26,9 @@ IPO_YDB = ipo_libtokudb.$(AEXT)
NOIPO_YDB = static_libtokudb.$(AEXT)
LIBNAME=libtokudb
TLIBNAME=libtokudbtrace
LIBRARY=$(LIBNAME).$(SOEXT)
TLIBRARY=$(TLIBNAME).$(SOEXT)
LIBRARY_S=$(LIBNAME).$(AEXT)
TLIBRARY_S=$(TLIBNAME).$(AEXT)
OBJS_RAW = \
ydb_lib \
ydb \
......@@ -44,9 +40,7 @@ OBJS_RAW = \
LIBRARIES= \
$(LIBRARY) \
$(TLIBRARY) \
$(LIBRARY_S) \
$(TLIBRARY_S) \
#Purposely here for \ at end of prev
INSTALL_LIBRARIES= $(patsubst %,%.install,$(LIBRARIES))
......@@ -61,10 +55,6 @@ local: buildlocktrees libs install_libs ;
build_tests: | local
cd tests && $(MAKE) build
TOBJS= tdbtrace.$(OEXT) $(patsubst ydb.$(OEXT),ydbtrace.$(OEXT),$(OBJS))
install_libs: $(INSTALL_LIBRARIES)
%.install: %
if ! diff $* ../lib/$* > /dev/null 2>&1; then cp $* ../lib/; fi
......@@ -82,27 +72,19 @@ export.def: export.map
buildlocktrees: $(LOCKTREE) $(RANGETREE) ;
$(OBJS) $(TOBJS): CPPFLAGS+=-I$(TOKUROOT)include
$(YDB): $(OBJS)
$(TYDB): $(TOBJS)
$(LIBRARY): $(YDB) $(LOCKTREE) $(RANGETREE) $(NEWBRT) $(DEPEND_COMPILE) $(DEPEND_LINK)
$(TLIBRARY): $(TYDB) $(LOCKTREE) $(RANGETREE) $(NEWBRT) $(DEPEND_COMPILE) $(DEPEND_LINK)
$(LIBRARY): LINK_FILES=ydb_lib.$(OEXT) $(YDB) $(LOCKTREE) $(RANGETREE) $(NEWBRT)
$(TLIBRARY): LINK_FILES=$(TYDB) $(LOCKTREE) $(RANGETREE) $(NEWBRT)
#Skip all BDB tests for CYGWIN+ICC
ifeq ($(CYGWIN),)
$(LIBRARY_S): $(patsubst %.$(AEXT),%.bundle, $(YDB) $(LOCKTREE) $(RANGETREE) $(NEWBRT) $(LIBPORTABILITY))
$(TLIBRARY_S): $(TYDB) $(LOCKTREE) $(RANGETREE) $(NEWBRT_BUNDLE) $(LIBPORTABILITY)
else ifneq ($(CC),icc)
$(LIBRARY_S): $(YDB) $(LOCKTREE) $(RANGETREE) $(NEWBRT) $(LIBPORTABILITY)
$(TLIBRARY_S): $(TYDB) $(LOCKTREE) $(RANGETREE) $(NEWBRT) $(LIBPORTABILITY)
else
$(LIBRARY_S): $(LIBRARY) ;
$(TLIBRARY_S): $(TLIBRARY) ;
#$(LIBRARY_S): $(YDB) $(LOCKTREE) $(RANGETREE) $(NEWBRT) $(LIBPORTABILITY)
#$(TLIBRARY_S): $(TYDB) $(LOCKTREE) $(RANGETREE) $(NEWBRT) $(LIBPORTABILITY)
endif
......@@ -136,8 +118,3 @@ clean:
cd tests && $(MAKE) clean
cd lock_tree && $(MAKE) clean
cd range_tree && $(MAKE) clean
ydbtrace.$(OEXT): CPPFLAGS+=-DTOKUTRACE
ydbtrace.$(OEXT): ydb.c $(DEPEND_COMPILE)
$(CC) -c $< $(CPPFLAGS) $(CFLAGS) $(OOUTPUT)$@
This diff is collapsed.
#ifndef TDB_TRACE_H
#define TDB_TRACE_H
int db_env_create_toku10(DB_ENV ** envp, u_int32_t flags);
int db_create_toku10 (DB **, DB_ENV *, u_int32_t flags);
#endif
......@@ -3,7 +3,7 @@
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
#include "../include/db.h"
#include <db.h>
#include "../newbrt/brttypes.h"
#include "../newbrt/brt.h"
#include "../newbrt/list.h"
......@@ -60,22 +60,6 @@ struct __toku_db_env_internal {
toku_ltm* ltm;
};
struct __toku_db_txn_internal {
//TXNID txnid64; /* A sixty-four bit txn id. */
TOKUTXN tokutxn;
toku_lth* lth;
u_int32_t flags;
DB_TXN *child, *next, *prev;
};
struct __toku_dbc_internal {
BRT_CURSOR c;
DB_TXN *txn;
struct simple_dbt skey_s,sval_s;
struct simple_dbt *skey,*sval;
};
/* *********************************************************
Ephemeral locking
......
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