mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
Put mysql into the repository
git-svn-id: file:///svn/tokudb@10 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
848669dce8
commit
8fc339df49
3 changed files with 43 additions and 2 deletions
|
@ -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
|
||||
|
|
35
src-bdbwrap/noticecall.c
Normal file
35
src-bdbwrap/noticecall.c
Normal file
|
@ -0,0 +1,35 @@
|
|||
#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);
|
||||
}
|
Loading…
Add table
Reference in a new issue