Commit 9a97c6b5 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:2770], fix leak of tmp_txn

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@21645 c7de825b-a66e-492c-adef-691d508d4ae1
parent 4035b8da
...@@ -685,6 +685,7 @@ static bool tokudb_show_data_size(THD * thd, stat_print_fn * stat_print, bool ex ...@@ -685,6 +685,7 @@ static bool tokudb_show_data_size(THD * thd, stat_print_fn * stat_print, bool ex
DBC* tmp_table_cursor = NULL; DBC* tmp_table_cursor = NULL;
DBT curr_key; DBT curr_key;
DBT curr_val; DBT curr_val;
DB_TXN* tmp_txn = NULL;
char data_amount_msg[50] = {0}; char data_amount_msg[50] = {0};
memset(&curr_key, 0, sizeof curr_key); memset(&curr_key, 0, sizeof curr_key);
memset(&curr_val, 0, sizeof curr_val); memset(&curr_val, 0, sizeof curr_val);
...@@ -699,7 +700,7 @@ static bool tokudb_show_data_size(THD * thd, stat_print_fn * stat_print, bool ex ...@@ -699,7 +700,7 @@ static bool tokudb_show_data_size(THD * thd, stat_print_fn * stat_print, bool ex
goto cleanup; goto cleanup;
} }
while (error == 0) { while (error == 0) {
DB_TXN* tmp_txn = NULL; tmp_txn = NULL;
// //
// here, and in other places, check if process has been killed // here, and in other places, check if process has been killed
// if so, get out of function so user is not stalled // if so, get out of function so user is not stalled
...@@ -839,6 +840,9 @@ static bool tokudb_show_data_size(THD * thd, stat_print_fn * stat_print, bool ex ...@@ -839,6 +840,9 @@ static bool tokudb_show_data_size(THD * thd, stat_print_fn * stat_print, bool ex
int r = curr_db->close(curr_db, 0); int r = curr_db->close(curr_db, 0);
assert(r==0); assert(r==0);
} }
if (tmp_txn) {
commit_txn(tmp_txn, 0);
}
if (txn) { if (txn) {
commit_txn(txn, 0); commit_txn(txn, 0);
} }
......
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