mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 20:11:42 +01:00
refs #25. Fix (test-only) bug where db_env_set_toku_product_name would not get called for some tests because they were lower than ydb layer
This commit is contained in:
parent
a5770c1ce1
commit
7f84d4b7a4
6 changed files with 22 additions and 25 deletions
|
@ -6209,6 +6209,8 @@ int toku_ft_layer_init(void) {
|
||||||
//Portability must be initialized first
|
//Portability must be initialized first
|
||||||
r = toku_portability_init();
|
r = toku_portability_init();
|
||||||
if (r) { goto exit; }
|
if (r) { goto exit; }
|
||||||
|
r = db_env_set_toku_product_name("tokudb");
|
||||||
|
if (r) { goto exit; }
|
||||||
|
|
||||||
partitioned_counters_init();
|
partitioned_counters_init();
|
||||||
status_init();
|
status_init();
|
||||||
|
|
19
ft/ft.cc
19
ft/ft.cc
|
@ -1170,3 +1170,22 @@ toku_single_process_unlock(int *lockfd) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int tokudb_num_envs = 0;
|
||||||
|
int
|
||||||
|
db_env_set_toku_product_name(const char *name) {
|
||||||
|
if (tokudb_num_envs > 0) {
|
||||||
|
return EINVAL;
|
||||||
|
}
|
||||||
|
if (!name || strlen(name) < 1) {
|
||||||
|
return EINVAL;
|
||||||
|
}
|
||||||
|
if (strlen(name) >= sizeof(toku_product_name)) {
|
||||||
|
return ENAMETOOLONG;
|
||||||
|
}
|
||||||
|
if (strncmp(toku_product_name, name, sizeof(toku_product_name))) {
|
||||||
|
strcpy(toku_product_name, name);
|
||||||
|
tokudb_update_product_name_strings();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
1
ft/ft.h
1
ft/ft.h
|
@ -215,4 +215,5 @@ struct toku_product_name_strings_struct {
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct toku_product_name_strings_struct toku_product_name_strings;
|
extern struct toku_product_name_strings_struct toku_product_name_strings;
|
||||||
|
extern int tokudb_num_envs;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -238,9 +238,6 @@ toku_ydb_init(void) {
|
||||||
int r = 0;
|
int r = 0;
|
||||||
//Lower level must be initialized first.
|
//Lower level must be initialized first.
|
||||||
r = toku_ft_layer_init();
|
r = toku_ft_layer_init();
|
||||||
if (r!=0) goto exit;
|
|
||||||
r = db_env_set_toku_product_name("tokudb");
|
|
||||||
exit:
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2230,8 +2227,6 @@ env_get_cursor_for_directory(DB_ENV* env, DB_TXN* txn, DBC** c) {
|
||||||
return toku_db_cursor(env->i->directory, txn, c, 0);
|
return toku_db_cursor(env->i->directory, txn, c, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int tokudb_num_envs = 0;
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
toku_env_create(DB_ENV ** envp, uint32_t flags) {
|
toku_env_create(DB_ENV ** envp, uint32_t flags) {
|
||||||
int r = ENOSYS;
|
int r = ENOSYS;
|
||||||
|
|
|
@ -226,21 +226,3 @@ db_env_set_num_bucket_mutexes(uint32_t num_mutexes) {
|
||||||
toku_pair_list_set_lock_size(num_mutexes);
|
toku_pair_list_set_lock_size(num_mutexes);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
db_env_set_toku_product_name(const char *name) {
|
|
||||||
if (tokudb_num_envs > 0) {
|
|
||||||
return EINVAL;
|
|
||||||
}
|
|
||||||
if (!name || strlen(name) < 1) {
|
|
||||||
return EINVAL;
|
|
||||||
}
|
|
||||||
if (strlen(name) >= sizeof(toku_product_name)) {
|
|
||||||
return ENAMETOOLONG;
|
|
||||||
}
|
|
||||||
if (strncmp(toku_product_name, name, sizeof(toku_product_name))) {
|
|
||||||
strcpy(toku_product_name, name);
|
|
||||||
tokudb_update_product_name_strings();
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -105,6 +105,4 @@ void setup_dlmalloc(void) __attribute__((__visibility__("default")));
|
||||||
// Test-only function
|
// Test-only function
|
||||||
void toku_env_increase_last_xid(DB_ENV *env, uint64_t increment);
|
void toku_env_increase_last_xid(DB_ENV *env, uint64_t increment);
|
||||||
|
|
||||||
extern int tokudb_num_envs;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue