mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
db-insert compiles (from db-benchmark-test). [t:1904]
git-svn-id: file:///svn/toku/tokudb@13637 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
9354698cde
commit
57940a6cca
3 changed files with 35 additions and 3 deletions
|
@ -1 +1,3 @@
|
|||
CPPFLAGS = -I../include
|
||||
LDFLAGS = -L../.. -lfractaltreeindex -Wl,-rpath,../..
|
||||
default: db-insert
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
|
||||
|
||||
/* Insert a bunch of stuff */
|
||||
#include <db.h>
|
||||
#include <inttypes.h>
|
||||
#include <tokudb.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
@ -11,6 +12,10 @@
|
|||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static inline float toku_tdiff (struct timeval *a, struct timeval *b) {
|
||||
return (a->tv_sec - b->tv_sec) +1e-6*(a->tv_usec - b->tv_usec);
|
||||
}
|
||||
|
||||
#if !defined(DB_YESOVERWRITE)
|
||||
#define DB_YESOVERWRITE 0
|
||||
#endif
|
||||
|
@ -206,7 +211,7 @@ static void benchmark_shutdown (void) {
|
|||
if (singlex_child) fprintf(stderr, "SKIPPED 'small rolltmp' test for child txn\n");
|
||||
else
|
||||
assert(s->rolltmp_raw_count < 100); // gross test, not worth investigating details
|
||||
os_free(s);
|
||||
free(s);
|
||||
//system("ls -l bench.tokudb");
|
||||
#endif
|
||||
}
|
||||
|
@ -380,6 +385,8 @@ static int print_usage (const char *argv0) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
#define UU(x) x __attribute__((__unused__))
|
||||
|
||||
#if defined(TOKUDB)
|
||||
static int
|
||||
nothing(DBT const* UU(key), DBT const* UU(val), void* UU(extra)) {
|
||||
|
|
|
@ -35,7 +35,30 @@ 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>
|
||||
|
||||
// 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; //Hash table holding list of dictionaries this txn has touched
|
||||
u_int32_t flags;
|
||||
DB_TXN *child;
|
||||
};
|
||||
|
||||
struct __toku_dbc_internal {
|
||||
struct brt_cursor *c;
|
||||
DB_TXN *txn;
|
||||
struct simple_dbt skey_s,sval_s;
|
||||
struct simple_dbt *skey,*sval;
|
||||
};
|
||||
|
||||
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) */
|
Loading…
Add table
Reference in a new issue