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
static int create_sub_table(const char *table_name, int flags) {
TOKUDB_DBUG_ENTER("create_sub_table");
int error;
DB *file;
DB *file = NULL;
DBUG_PRINT("enter", ("flags: %d", flags));
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);
error = file->open(file, NULL, table_name, NULL, DB_BTREE, DB_THREAD | DB_CREATE, my_umask);
if (error) {
DBUG_PRINT("error", ("Got error: %d when opening table '%s'", error, table_name));
goto exit;
}
if (!(error = db_create(&file, db_env, 0))) {
file->set_flags(file, flags);
error = (file->open(file, NULL, table_name, NULL, DB_BTREE, DB_THREAD | DB_CREATE, my_umask));
if (error) {
DBUG_PRINT("error", ("Got error: %d when opening table '%s'", error, table_name));
(void) file->close(file, 0);
error = 0;
exit:
if (error) {
if (file != NULL) {
(void) file->remove(file, table_name, NULL, 0);
} else
(void) file->close(file, 0);
} else {
DBUG_PRINT("error", ("Got error: %d when creating table", error));
}
}
if (error)
my_errno = 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