Commit b3458e03 authored by Rich Prohaska's avatar Rich Prohaska

define DB_NODUPDATA to get our bdb tests to compile. closes #142

git-svn-id: file:///svn/tokudb@999 c7de825b-a66e-492c-adef-691d508d4ae1
parent 21ecb0d5
...@@ -53,6 +53,7 @@ typedef enum { ...@@ -53,6 +53,7 @@ typedef enum {
#define DB_LOCK_RANDOM 7 #define DB_LOCK_RANDOM 7
#define DB_DUP 2 #define DB_DUP 2
#define DB_DUPSORT 4 #define DB_DUPSORT 4
#define DB_NODUPDATA 22
#define DB_NOOVERWRITE 23 #define DB_NOOVERWRITE 23
#define DB_INIT_LOCK 4096 #define DB_INIT_LOCK 4096
#define DB_INIT_LOG 8192 #define DB_INIT_LOG 8192
......
...@@ -53,6 +53,7 @@ typedef enum { ...@@ -53,6 +53,7 @@ typedef enum {
#define DB_LOCK_RANDOM 8 #define DB_LOCK_RANDOM 8
#define DB_DUP 2 #define DB_DUP 2
#define DB_DUPSORT 4 #define DB_DUPSORT 4
#define DB_NODUPDATA 21
#define DB_NOOVERWRITE 22 #define DB_NOOVERWRITE 22
#define DB_INIT_LOCK 8192 #define DB_INIT_LOCK 8192
#define DB_INIT_LOG 16384 #define DB_INIT_LOG 16384
......
...@@ -53,6 +53,7 @@ typedef enum { ...@@ -53,6 +53,7 @@ typedef enum {
#define DB_LOCK_RANDOM 8 #define DB_LOCK_RANDOM 8
#define DB_DUP 16384 #define DB_DUP 16384
#define DB_DUPSORT 32768 #define DB_DUPSORT 32768
#define DB_NODUPDATA 21
#define DB_NOOVERWRITE 22 #define DB_NOOVERWRITE 22
#define DB_INIT_LOCK 16384 #define DB_INIT_LOCK 16384
#define DB_INIT_LOG 32768 #define DB_INIT_LOG 32768
......
...@@ -53,6 +53,7 @@ typedef enum { ...@@ -53,6 +53,7 @@ typedef enum {
#define DB_LOCK_RANDOM 8 #define DB_LOCK_RANDOM 8
#define DB_DUP 32768 #define DB_DUP 32768
#define DB_DUPSORT 65536 #define DB_DUPSORT 65536
#define DB_NODUPDATA 19
#define DB_NOOVERWRITE 20 #define DB_NOOVERWRITE 20
#define DB_INIT_LOCK 32768 #define DB_INIT_LOCK 32768
#define DB_INIT_LOG 65536 #define DB_INIT_LOG 65536
......
...@@ -53,6 +53,7 @@ typedef enum { ...@@ -53,6 +53,7 @@ typedef enum {
#define DB_LOCK_RANDOM 8 #define DB_LOCK_RANDOM 8
#define DB_DUP 32768 #define DB_DUP 32768
#define DB_DUPSORT 65536 #define DB_DUPSORT 65536
#define DB_NODUPDATA 19
#define DB_NOOVERWRITE 20 #define DB_NOOVERWRITE 20
#define DB_INIT_LOCK 131072 #define DB_INIT_LOCK 131072
#define DB_INIT_LOG 262144 #define DB_INIT_LOG 262144
......
...@@ -57,6 +57,7 @@ void print_defines (void) { ...@@ -57,6 +57,7 @@ void print_defines (void) {
dodefine(DB_DUP); dodefine(DB_DUP);
dodefine(DB_DUPSORT); dodefine(DB_DUPSORT);
dodefine(DB_NODUPDATA);
dodefine(DB_NOOVERWRITE); dodefine(DB_NOOVERWRITE);
dodefine(DB_INIT_LOCK); dodefine(DB_INIT_LOCK);
......
...@@ -53,6 +53,7 @@ typedef enum { ...@@ -53,6 +53,7 @@ typedef enum {
#define DB_LOCK_RANDOM 8 #define DB_LOCK_RANDOM 8
#define DB_DUP 16384 #define DB_DUP 16384
#define DB_DUPSORT 32768 #define DB_DUPSORT 32768
#define DB_NODUPDATA 21
#define DB_NOOVERWRITE 22 #define DB_NOOVERWRITE 22
#define DB_INIT_LOCK 16384 #define DB_INIT_LOCK 16384
#define DB_INIT_LOG 32768 #define DB_INIT_LOG 32768
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
#include "test.h" #include "test.h"
int errors;
DBT *dbt_init(DBT *dbt, void *data, u_int32_t size) { DBT *dbt_init(DBT *dbt, void *data, u_int32_t size) {
memset(dbt, 0, sizeof *dbt); memset(dbt, 0, sizeof *dbt);
dbt->data = data; dbt->data = data;
...@@ -31,7 +33,7 @@ void db_put(DB *db, int k, int v, u_int32_t put_flags, int rexpect) { ...@@ -31,7 +33,7 @@ void db_put(DB *db, int k, int v, u_int32_t put_flags, int rexpect) {
int r = db->put(db, 0, dbt_init(&key, &k, sizeof k), dbt_init(&val, &v, sizeof v), put_flags); int r = db->put(db, 0, dbt_init(&key, &k, sizeof k), dbt_init(&val, &v, sizeof v), put_flags);
if (r != rexpect) { if (r != rexpect) {
printf("Expected %d, got %d\n", rexpect, r); printf("Expected %d, got %d\n", rexpect, r);
assert(r == rexpect); if (r != rexpect) errors = 1;
} }
} }
...@@ -102,5 +104,6 @@ int main(int argc, const char *argv[]) { ...@@ -102,5 +104,6 @@ int main(int argc, const char *argv[]) {
test_dup_dup(DB_DUP | DB_DUPSORT, 0, 0, DB_KEYEXIST); test_dup_dup(DB_DUP | DB_DUPSORT, 0, 0, DB_KEYEXIST);
test_dup_dup(DB_DUP | DB_DUPSORT, DB_NODUPDATA, 0, DB_KEYEXIST); test_dup_dup(DB_DUP | DB_DUPSORT, DB_NODUPDATA, 0, DB_KEYEXIST);
test_dup_dup(DB_DUP | DB_DUPSORT, DB_NOOVERWRITE, 0, DB_KEYEXIST); test_dup_dup(DB_DUP | DB_DUPSORT, DB_NOOVERWRITE, 0, DB_KEYEXIST);
return 0;
return errors;
} }
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