revert tokudb changes that caused crashes
This commit is contained in:
parent
e27c338634
commit
d8edb88cb1
@ -2110,8 +2110,8 @@ int ha_tokudb::verify_frm_data(const char* frm_name, DB_TXN* txn) {
|
||||
TOKUDB_HANDLER_DBUG_ENTER("%s", frm_name);
|
||||
uchar* mysql_frm_data = NULL;
|
||||
size_t mysql_frm_len = 0;
|
||||
DBT key; LINT_INIT_STRUCT(key);
|
||||
DBT stored_frm; LINT_INIT_STRUCT(stored_frm);
|
||||
DBT key = {};
|
||||
DBT stored_frm = {};
|
||||
int error = 0;
|
||||
HA_METADATA_KEY curr_key = hatoku_frm_data;
|
||||
|
||||
|
@ -972,8 +972,8 @@ static int tokudb_discover3(handlerton *hton, THD* thd, const char *db, const ch
|
||||
DB* status_db = NULL;
|
||||
DB_TXN* txn = NULL;
|
||||
HA_METADATA_KEY curr_key = hatoku_frm_data;
|
||||
DBT key; LINT_INIT_STRUCT(key);
|
||||
DBT value; LINT_INIT_STRUCT(value);
|
||||
DBT key = {};
|
||||
DBT value = {};
|
||||
bool do_commit;
|
||||
|
||||
#if 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100099
|
||||
@ -1713,8 +1713,7 @@ static int tokudb_report_fractal_tree_block_map_iterator(uint64_t checkpoint_cou
|
||||
static int tokudb_report_fractal_tree_block_map_for_db(const DBT *dname, const DBT *iname, TABLE *table, THD *thd) {
|
||||
int error;
|
||||
DB *db;
|
||||
struct tokudb_report_fractal_tree_block_map_iterator_extra e; // avoid struct initializers so that we can compile with older gcc versions
|
||||
LINT_INIT_STRUCT(e);
|
||||
struct tokudb_report_fractal_tree_block_map_iterator_extra e = {}; // avoid struct initializers so that we can compile with older gcc versions
|
||||
|
||||
error = db_create(&db, db_env, 0);
|
||||
if (error) {
|
||||
|
@ -233,8 +233,8 @@ namespace tokudb {
|
||||
for (uint64_t i = 0; i < num_key_parts; i++)
|
||||
unique_rows[i] = 1;
|
||||
// stop looking when the entire dictionary was analyzed, or a cap on execution time was reached, or the analyze was killed.
|
||||
DBT key; LINT_INIT_STRUCT(key); key.flags = DB_DBT_REALLOC;
|
||||
DBT prev_key; LINT_INIT_STRUCT(prev_key); prev_key.flags = DB_DBT_REALLOC;
|
||||
DBT key = {}; key.flags = DB_DBT_REALLOC;
|
||||
DBT prev_key = {}; prev_key.flags = DB_DBT_REALLOC;
|
||||
while (1) {
|
||||
error = cursor->c_get(cursor, &key, 0, DB_NEXT);
|
||||
if (error != 0) {
|
||||
|
@ -112,8 +112,8 @@ namespace tokudb {
|
||||
// get the value for a given key in the status dictionary. copy the value to the supplied buffer.
|
||||
// returns 0 if successful.
|
||||
int get_status(DB *status_db, DB_TXN *txn, HA_METADATA_KEY k, void *p, size_t s, size_t *sp) {
|
||||
DBT key; LINT_INIT_STRUCT(key); key.data = &k; key.size = sizeof k;
|
||||
DBT val; LINT_INIT_STRUCT(val); val.data = p; val.ulen = (uint32_t) s; val.flags = DB_DBT_USERMEM;
|
||||
DBT key = {}; key.data = &k; key.size = sizeof k;
|
||||
DBT val = {}; val.data = p; val.ulen = (uint32_t) s; val.flags = DB_DBT_USERMEM;
|
||||
int error = status_db->get(status_db, txn, &key, &val, 0);
|
||||
if (error == 0) {
|
||||
*sp = val.size;
|
||||
@ -124,8 +124,8 @@ namespace tokudb {
|
||||
// get the value for a given key in the status dictionary. put the value in a realloced buffer.
|
||||
// returns 0 if successful.
|
||||
int get_status_realloc(DB *status_db, DB_TXN *txn, HA_METADATA_KEY k, void **pp, size_t *sp) {
|
||||
DBT key; LINT_INIT_STRUCT(key); key.data = &k; key.size = sizeof k;
|
||||
DBT val; LINT_INIT_STRUCT(val); val.data = *pp; val.size = (uint32_t) *sp; val.flags = DB_DBT_REALLOC;
|
||||
DBT key = {}; key.data = &k; key.size = sizeof k;
|
||||
DBT val = {}; val.data = *pp; val.size = (uint32_t) *sp; val.flags = DB_DBT_REALLOC;
|
||||
int error = status_db->get(status_db, txn, &key, &val, 0);
|
||||
if (error == 0) {
|
||||
*pp = val.data;
|
||||
@ -138,8 +138,8 @@ namespace tokudb {
|
||||
// auto create a txn if necessary.
|
||||
// returns 0 if successful.
|
||||
int write_metadata(DB *status_db, void *key_data, uint key_size, void* val_data, uint val_size, DB_TXN *txn) {
|
||||
DBT key; LINT_INIT_STRUCT(key); key.data = key_data; key.size = key_size;
|
||||
DBT value; LINT_INIT_STRUCT(value); value.data = val_data; value.size = val_size;
|
||||
DBT key = {}; key.data = key_data; key.size = key_size;
|
||||
DBT value = {}; value.data = val_data; value.size = val_size;
|
||||
int error = status_db->put(status_db, txn, &key, &value, 0);
|
||||
return error;
|
||||
}
|
||||
@ -155,7 +155,7 @@ namespace tokudb {
|
||||
// auto create a txn if necessary.
|
||||
// returns 0 if successful.
|
||||
int remove_metadata(DB *status_db, void *key_data, uint key_size, DB_TXN *txn) {
|
||||
DBT key; LINT_INIT_STRUCT(key); key.data = key_data; key.size = key_size;
|
||||
DBT key = {}; key.data = key_data; key.size = key_size;
|
||||
int error = status_db->del(status_db, txn, &key, DB_DELETE_ANY);
|
||||
return error;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user