Commit 3ba84a9e authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:2054], some cosmetic changes

git-svn-id: file:///svn/mysql/tokudb-engine/src@15462 c7de825b-a66e-492c-adef-691d508d4ae1
parent 9067dc14
...@@ -4838,6 +4838,8 @@ int ha_tokudb::create(const char *name, TABLE * form, HA_CREATE_INFO * create_in ...@@ -4838,6 +4838,8 @@ int ha_tokudb::create(const char *name, TABLE * form, HA_CREATE_INFO * create_in
uchar* row_desc_buff = NULL; uchar* row_desc_buff = NULL;
KEY* prim_key = NULL; KEY* prim_key = NULL;
char* fn_ret = NULL; char* fn_ret = NULL;
uint version;
uint capabilities;
pthread_mutex_lock(&tokudb_meta_mutex); pthread_mutex_lock(&tokudb_meta_mutex);
bzero(&row_descriptor, sizeof(row_descriptor)); bzero(&row_descriptor, sizeof(row_descriptor));
...@@ -4947,31 +4949,32 @@ int ha_tokudb::create(const char *name, TABLE * form, HA_CREATE_INFO * create_in ...@@ -4947,31 +4949,32 @@ int ha_tokudb::create(const char *name, TABLE * form, HA_CREATE_INFO * create_in
} }
} }
error = db_create(&status_block, db_env, 0);
if (error) { goto cleanup; }
/* Create status.tokudb and save relevant metadata */ /* Create status.tokudb and save relevant metadata */
if (!(error = (db_create(&status_block, db_env, 0)))) { make_name(newname, name, "status");
make_name(newname, name, "status"); fn_ret = fn_format(name_buff, newname, "", 0, MY_UNPACK_FILENAME|MY_SAFE_PATH);
fn_ret = fn_format(name_buff, newname, "", 0, MY_UNPACK_FILENAME|MY_SAFE_PATH); if (fn_ret == NULL) {
if (fn_ret == NULL) { error = HA_ERR_INTERNAL_ERROR;
error = HA_ERR_INTERNAL_ERROR; goto cleanup;
goto cleanup; }
}
if (!(error = (status_block->open(status_block, NULL, name_buff, NULL, DB_BTREE, DB_CREATE, 0)))) { error = status_block->open(status_block, NULL, name_buff, NULL, DB_BTREE, DB_CREATE, 0);
uint version = HA_TOKU_VERSION; if (error) { goto cleanup; }
uint capabilities = HA_TOKU_CAP;
error = write_metadata(status_block, hatoku_version,&version,sizeof(version));
if (error) { goto cleanup; }
error = write_metadata(status_block, hatoku_capabilities,&capabilities,sizeof(capabilities)); version = HA_TOKU_VERSION;
if (error) { goto cleanup; } capabilities = HA_TOKU_CAP;
error = write_metadata(status_block, hatoku_version,&version,sizeof(version));
if (error) { goto cleanup; }
error = write_auto_inc_create(status_block, create_info->auto_increment_value); error = write_metadata(status_block, hatoku_capabilities,&capabilities,sizeof(capabilities));
if (error) { goto cleanup; } if (error) { goto cleanup; }
error = write_auto_inc_create(status_block, create_info->auto_increment_value);
if (error) { goto cleanup; }
}
}
error = add_table_to_metadata(name, form); error = add_table_to_metadata(name, form);
if (error) { if (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