mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
[t:3400], fix other memory leak
git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@30232 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
efeac44123
commit
acb8f19711
1 changed files with 13 additions and 6 deletions
|
@ -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,
|
||||||
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,
|
||||||
|
|
||||||
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;
|
||||||
|
|
Loading…
Reference in a new issue