Commit 34aef7ac authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Put mysql into the repository

git-svn-id: file:///svn/tokudb@10 c7de825b-a66e-492c-adef-691d508d4ae1
parent 7cd72fee
......@@ -109,7 +109,13 @@ struct yobi_db_env {
int (*set_lk_max) (DB_ENV *, u_int32_t);
int (*log_archive) (DB_ENV *, char **[], u_int32_t);
int (*txn_stat) (DB_ENV *, DB_TXN_STAT **, u_int32_t);
#ifdef _YDB_WRAP_H
#undef txn_begin
#endif
int (*txn_begin) (DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t);
#ifdef _YDB_WRAP_H
#define txn_begin txn_begin_ydb
#endif
// Internal state
struct db_env_ydb_internal *i;
};
......
......@@ -37,9 +37,9 @@ C_OBJS= mut_pthread.lo \
install: libdb.so
cp libdb.so ../src/
libdb.so: ydb.lo bdbw.lo
libdb.so: ydb.lo bdbw.lo noticecall.lo
echo cc ydb.lo bdbw.lo BDB-OBJS -shared -fPIC -o libdb.so $(CFLAGS)
@cc ydb.lo bdbw.lo $(patsubst %,/home/bradley/mysql/build-bdb-with-uniquename/bdb/build_unix/%,$(C_OBJS)) -shared -fPIC -o libdb.so $(CFLAGS)
@cc ydb.lo bdbw.lo noticecall.lo $(patsubst %,/home/bradley/mysql/build-bdb-with-uniquename/bdb/build_unix/%,$(C_OBJS)) -shared -fPIC -o libdb.so $(CFLAGS)
ydb.lo: bdbw.h
bdbw.lo: CPPFLAGS=-I/home/bradley/mysql/build-bdb-with-uniquename/bdb/build_unix
%.lo: %.c
......
#include <db.h>
#include <pthread.h>
#define MANAGER_BERKELEY_LOG_CLEANUP (1L << 0)
ulong volatile manager_status;
pthread_mutex_t LOCK_manager;
pthread_cond_t COND_manager;
void berkeley_noticecall(DB_ENV *db_env, db_notices notice)
{
switch (notice)
{
case DB_NOTICE_LOGFILE_CHANGED: /* purecov: tested */
pthread_mutex_lock(&LOCK_manager);
manager_status |= MANAGER_BERKELEY_LOG_CLEANUP;
pthread_mutex_unlock(&LOCK_manager);
pthread_cond_signal(&COND_manager);
break;
}
}
#define uint5korr(A) ((unsigned long long)(((unsigned long long) ((unsigned char) (A)[0])) +\
(((unsigned long long) ((unsigned char) (A)[1])) << 8) +\
(((unsigned long long) ((unsigned char) (A)[2])) << 16) +\
(((unsigned long long) ((unsigned char) (A)[3])) << 24)) +\
(((unsigned long long) ((unsigned char) (A)[4])) << 32))
int
berkeley_cmp_hidden_key(DB* file, const DBT *new_key, const DBT *saved_key)
{
unsigned long long a=uint5korr((char*) new_key->data);
unsigned long long b=uint5korr((char*) saved_key->data);
return a < b ? -1 : (a > b ? 1 : 0);
}
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