mirror of
https://github.com/MariaDB/server.git
synced 2025-11-30 05:23:50 +03:00
add DbEnv::set_flags addresses #229
git-svn-id: file:///svn/tokudb@1413 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
@@ -48,6 +48,11 @@ int DbEnv::set_cachesize(u_int32_t gbytes, u_int32_t bytes, int ncache) {
|
|||||||
return maybe_throw_error(ret);
|
return maybe_throw_error(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int DbEnv::set_flags(u_int32_t flags, int onoff) {
|
||||||
|
int ret = the_env->set_flags(the_env, flags, onoff);
|
||||||
|
return maybe_throw_error(ret);
|
||||||
|
}
|
||||||
|
|
||||||
#if DB_VERSION_MAJOR<4 || (DB_VERSION_MAJOR==4 && DB_VERSION_MINOR<=4)
|
#if DB_VERSION_MAJOR<4 || (DB_VERSION_MAJOR==4 && DB_VERSION_MINOR<=4)
|
||||||
int DbEnv::set_lk_max(u_int32_t flags) {
|
int DbEnv::set_lk_max(u_int32_t flags) {
|
||||||
int ret = the_env->set_lk_max(the_env, flags);
|
int ret = the_env->set_lk_max(the_env, flags);
|
||||||
|
|||||||
14
cxx/tests/test_env_set_flags.cpp
Normal file
14
cxx/tests/test_env_set_flags.cpp
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#include <assert.h>
|
||||||
|
#include <db_cxx.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
int r;
|
||||||
|
|
||||||
|
DbEnv env(DB_CXX_NO_EXCEPTIONS);
|
||||||
|
r = env.set_flags(0, 0); assert(r == 0);
|
||||||
|
r = env.set_flags(0, 1); assert(r == 0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -139,6 +139,7 @@ class DbEnv {
|
|||||||
int close(u_int32_t);
|
int close(u_int32_t);
|
||||||
int open(const char *, u_int32_t, int);
|
int open(const char *, u_int32_t, int);
|
||||||
int set_cachesize(u_int32_t, u_int32_t, int);
|
int set_cachesize(u_int32_t, u_int32_t, int);
|
||||||
|
int set_flags(u_int32_t, int);
|
||||||
#if DB_VERSION_MAJOR<4 || (DB_VERSION_MAJOR==4 && DB_VERSION_MINOR<=4)
|
#if DB_VERSION_MAJOR<4 || (DB_VERSION_MAJOR==4 && DB_VERSION_MINOR<=4)
|
||||||
// set_lk_max is only defined for versions up to 4.4
|
// set_lk_max is only defined for versions up to 4.4
|
||||||
int set_lk_max(u_int32_t);
|
int set_lk_max(u_int32_t);
|
||||||
|
|||||||
Reference in New Issue
Block a user