Commit 1582aa54 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

addresses #1569

redo create_sub_table so that it can be more easily modified
all cosmetic

git-svn-id: file:///svn/mysql/tokudb-engine/src@10923 c7de825b-a66e-492c-adef-691d508d4ae1
parent 71f6bc07
...@@ -3559,22 +3559,31 @@ THR_LOCK_DATA **ha_tokudb::store_lock(THD * thd, THR_LOCK_DATA ** to, enum thr_l ...@@ -3559,22 +3559,31 @@ THR_LOCK_DATA **ha_tokudb::store_lock(THD * thd, THR_LOCK_DATA ** to, enum thr_l
static int create_sub_table(const char *table_name, int flags) { static int create_sub_table(const char *table_name, int flags) {
TOKUDB_DBUG_ENTER("create_sub_table"); TOKUDB_DBUG_ENTER("create_sub_table");
int error; int error;
DB *file; DB *file = NULL;
DBUG_PRINT("enter", ("flags: %d", flags)); DBUG_PRINT("enter", ("flags: %d", flags));
if (!(error = db_create(&file, db_env, 0))) { error = db_create(&file, db_env, 0);
if (error) {
DBUG_PRINT("error", ("Got error: %d when creating table", error));
my_errno = error;
goto exit;
}
file->set_flags(file, flags); file->set_flags(file, flags);
error = (file->open(file, NULL, table_name, NULL, DB_BTREE, DB_THREAD | DB_CREATE, my_umask)); error = file->open(file, NULL, table_name, NULL, DB_BTREE, DB_THREAD | DB_CREATE, my_umask);
if (error) { if (error) {
DBUG_PRINT("error", ("Got error: %d when opening table '%s'", error, table_name)); DBUG_PRINT("error", ("Got error: %d when opening table '%s'", error, table_name));
(void) file->remove(file, table_name, NULL, 0); goto exit;
} else }
(void) file->close(file, 0); (void) file->close(file, 0);
} else { error = 0;
DBUG_PRINT("error", ("Got error: %d when creating table", error)); exit:
if (error) {
if (file != NULL) {
(void) file->remove(file, table_name, NULL, 0);
}
} }
if (error)
my_errno = error;
TOKUDB_DBUG_RETURN(error); TOKUDB_DBUG_RETURN(error);
} }
......
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