Commit acb8f197 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:3400], fix other memory leak

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@30232 c7de825b-a66e-492c-adef-691d508d4ae1
parent efeac441
...@@ -791,6 +791,13 @@ static int tokudb_release_savepoint(handlerton * hton, THD * thd, void *savepoin ...@@ -791,6 +791,13 @@ static int tokudb_release_savepoint(handlerton * hton, THD * thd, void *savepoin
TOKUDB_DBUG_RETURN(error); TOKUDB_DBUG_RETURN(error);
} }
static int
smart_dbt_callback_verify_frm (DBT const *key, DBT const *row, void *context) {
DBT* stored_frm = (DBT *)context;
stored_frm->size = row->size;
stored_frm->data = row->data;
return 0;
}
static int tokudb_discover(handlerton *hton, THD* thd, const char *db, static int tokudb_discover(handlerton *hton, THD* thd, const char *db,
const char *name, const char *name,
uchar **frmblob, uchar **frmblob,
...@@ -800,7 +807,6 @@ static int tokudb_discover(handlerton *hton, THD* thd, const char *db, ...@@ -800,7 +807,6 @@ static int tokudb_discover(handlerton *hton, THD* thd, const char *db,
int error; int error;
DB* status_db = NULL; DB* status_db = NULL;
DB_TXN* txn = NULL; DB_TXN* txn = NULL;
// TODO: open status dictionary, read frmdata, and pass it back, and figure out how to free it
char path[FN_REFLEN + 1]; char path[FN_REFLEN + 1];
uchar* saved_frm_data = NULL; uchar* saved_frm_data = NULL;
HA_METADATA_KEY curr_key = hatoku_frm_data; HA_METADATA_KEY curr_key = hatoku_frm_data;
...@@ -815,13 +821,14 @@ static int tokudb_discover(handlerton *hton, THD* thd, const char *db, ...@@ -815,13 +821,14 @@ static int tokudb_discover(handlerton *hton, THD* thd, const char *db,
key.data = &curr_key; key.data = &curr_key;
key.size = sizeof(curr_key); key.size = sizeof(curr_key);
value.flags = DB_DBT_MALLOC;
error = status_db->get( error = status_db->getf_set(
status_db, status_db,
txn, txn,
0,
&key, &key,
&value, smart_dbt_callback_verify_frm,
0 &value
); );
if (error) { if (error) {
goto cleanup; goto cleanup;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment