Commit 98ce5154 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:1980], fix problem in rename_table

git-svn-id: file:///svn/mysql/tokudb-engine/src@14495 c7de825b-a66e-492c-adef-691d508d4ae1
parent bcd465f2
...@@ -884,8 +884,8 @@ cleanup: ...@@ -884,8 +884,8 @@ cleanup:
static int rename_table_in_metadata(const char *from, const char *to) { static int rename_table_in_metadata(const char *from, const char *to) {
int error = 0; int error = 0;
DBT from_key; DBT from_key;
DBT to_key; DBT to_key;
DBT val; DBT val;
DB_TXN* txn = NULL; DB_TXN* txn = NULL;
pthread_mutex_lock(&tokudb_meta_mutex); pthread_mutex_lock(&tokudb_meta_mutex);
error = db_env->txn_begin(db_env, 0, &txn, 0); error = db_env->txn_begin(db_env, 0, &txn, 0);
...@@ -911,7 +911,7 @@ static int rename_table_in_metadata(const char *from, const char *to) { ...@@ -911,7 +911,7 @@ static int rename_table_in_metadata(const char *from, const char *to) {
); );
if (error) { if (error) {
goto cleanup; goto cleanup;
} }
error = metadata_db->put( error = metadata_db->put(
...@@ -921,19 +921,19 @@ static int rename_table_in_metadata(const char *from, const char *to) { ...@@ -921,19 +921,19 @@ static int rename_table_in_metadata(const char *from, const char *to) {
&val, &val,
DB_YESOVERWRITE DB_YESOVERWRITE
); );
if (error) { if (error) {
goto cleanup; goto cleanup;
} }
error = metadata_db->del( error = metadata_db->del(
metadata_db, metadata_db,
txn, txn,
&from_key, &from_key,
DB_DELETE_ANY DB_DELETE_ANY
); );
if (error) { if (error) {
goto cleanup; goto cleanup;
} }
error = 0; error = 0;
...@@ -4965,9 +4965,10 @@ int ha_tokudb::rename_table(const char *from, const char *to) { ...@@ -4965,9 +4965,10 @@ int ha_tokudb::rename_table(const char *from, const char *to) {
error = rename(newfrom, newto); error = rename(newfrom, newto);
if (error != 0) { if (error != 0) {
error = my_errno = errno; error = my_errno = errno;
goto cleanup;
} }
rename_table_in_metadata(from, to); error = rename_table_in_metadata(from, to);
cleanup: 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