mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
[t:3400], fix usage of smartDBTs
git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@30477 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
2af613ff76
commit
d37c7e5b97
2 changed files with 12 additions and 8 deletions
|
@ -2051,7 +2051,9 @@ static int
|
||||||
smart_dbt_callback_verify_frm (DBT const *key, DBT const *row, void *context) {
|
smart_dbt_callback_verify_frm (DBT const *key, DBT const *row, void *context) {
|
||||||
DBT* stored_frm = (DBT *)context;
|
DBT* stored_frm = (DBT *)context;
|
||||||
stored_frm->size = row->size;
|
stored_frm->size = row->size;
|
||||||
stored_frm->data = row->data;
|
stored_frm->data = (uchar *)my_malloc(row->size, MYF(MY_WME));
|
||||||
|
assert(stored_frm->data);
|
||||||
|
memcpy(stored_frm->data, row->data, row->size);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2109,6 +2111,7 @@ cleanup:
|
||||||
commit_txn(txn, 0);
|
commit_txn(txn, 0);
|
||||||
}
|
}
|
||||||
my_free(mysql_frm_data, MYF(MY_ALLOW_ZERO_PTR));
|
my_free(mysql_frm_data, MYF(MY_ALLOW_ZERO_PTR));
|
||||||
|
my_free(stored_frm.data, MYF(MY_ALLOW_ZERO_PTR));
|
||||||
TOKUDB_DBUG_RETURN(error);
|
TOKUDB_DBUG_RETURN(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -795,7 +795,9 @@ static int
|
||||||
smart_dbt_callback_verify_frm (DBT const *key, DBT const *row, void *context) {
|
smart_dbt_callback_verify_frm (DBT const *key, DBT const *row, void *context) {
|
||||||
DBT* stored_frm = (DBT *)context;
|
DBT* stored_frm = (DBT *)context;
|
||||||
stored_frm->size = row->size;
|
stored_frm->size = row->size;
|
||||||
stored_frm->data = row->data;
|
stored_frm->data = (uchar *)my_malloc(row->size, MYF(MY_WME));
|
||||||
|
assert(stored_frm->data);
|
||||||
|
memcpy(stored_frm->data, row->data, row->size);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
static int tokudb_discover(handlerton *hton, THD* thd, const char *db,
|
static int tokudb_discover(handlerton *hton, THD* thd, const char *db,
|
||||||
|
@ -808,9 +810,10 @@ static int tokudb_discover(handlerton *hton, THD* thd, const char *db,
|
||||||
DB* status_db = NULL;
|
DB* status_db = NULL;
|
||||||
DB_TXN* txn = NULL;
|
DB_TXN* txn = NULL;
|
||||||
char path[FN_REFLEN + 1];
|
char path[FN_REFLEN + 1];
|
||||||
uchar* saved_frm_data = NULL;
|
|
||||||
HA_METADATA_KEY curr_key = hatoku_frm_data;
|
HA_METADATA_KEY curr_key = hatoku_frm_data;
|
||||||
DBT key, value;
|
DBT key, value;
|
||||||
|
bzero(&key, sizeof(key));
|
||||||
|
bzero(&value, sizeof(&value));
|
||||||
|
|
||||||
error = db_env->txn_begin(db_env, 0, &txn, 0);
|
error = db_env->txn_begin(db_env, 0, &txn, 0);
|
||||||
if (error) { goto cleanup; }
|
if (error) { goto cleanup; }
|
||||||
|
@ -834,9 +837,7 @@ static int tokudb_discover(handlerton *hton, THD* thd, const char *db,
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
saved_frm_data = (uchar *)my_malloc(value.size, MYF(MY_WME));
|
*frmblob = (uchar *)value.data;
|
||||||
memcpy(saved_frm_data, value.data, value.size);
|
|
||||||
*frmblob = saved_frm_data;
|
|
||||||
*frmlen = value.size;
|
*frmlen = value.size;
|
||||||
|
|
||||||
error = 0;
|
error = 0;
|
||||||
|
|
Loading…
Reference in a new issue