Commit 8516fa4e authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:2151], more changes as result of code review

git-svn-id: file:///svn/mysql/tokudb-engine/src@16278 c7de825b-a66e-492c-adef-691d508d4ae1
parent b7501f62
...@@ -3202,10 +3202,7 @@ int ha_tokudb::remove_key(DB_TXN * trans, uint keynr, const uchar * record, DBT ...@@ -3202,10 +3202,7 @@ int ha_tokudb::remove_key(DB_TXN * trans, uint keynr, const uchar * record, DBT
DBUG_PRINT("primary", ("index: %d", primary_key)); DBUG_PRINT("primary", ("index: %d", primary_key));
DBUG_DUMP("prim_key", (uchar *) prim_key->data, prim_key->size); DBUG_DUMP("prim_key", (uchar *) prim_key->data, prim_key->size);
if (keynr == active_index && cursor) { if (keynr == primary_key) { // Unique key
error = cursor->c_del(cursor, 0);
}
else if (keynr == primary_key) { // Unique key
DBUG_PRINT("Primary key", ("index: %d", keynr)); DBUG_PRINT("Primary key", ("index: %d", keynr));
error = share->key_file[keynr]->del(share->key_file[keynr], trans, prim_key , DB_DELETE_ANY); error = share->key_file[keynr]->del(share->key_file[keynr], trans, prim_key , DB_DELETE_ANY);
} }
......
...@@ -293,17 +293,13 @@ static int tokudb_init_func(void *p) { ...@@ -293,17 +293,13 @@ static int tokudb_init_func(void *p) {
} }
r= metadata_db->open(metadata_db, 0, TOKU_METADB_NAME, NULL, DB_BTREE, DB_THREAD, 0); r= metadata_db->open(metadata_db, NULL, TOKU_METADB_NAME, NULL, DB_BTREE, DB_THREAD, 0);
if (r) { if (r) {
if (r != ENOENT) { if (r != ENOENT) {
sql_print_error("Got error %d when trying to open metadata_db", r); sql_print_error("Got error %d when trying to open metadata_db", r);
goto error; goto error;
} }
sql_print_warning("No metadata table exists, so creating it"); sql_print_warning("No metadata table exists, so creating it");
r= metadata_db->open(metadata_db, NULL, TOKU_METADB_NAME, NULL, DB_BTREE, DB_THREAD | DB_CREATE | DB_EXCL, my_umask);
if (r) {
goto error;
}
r = metadata_db->close(metadata_db,0); r = metadata_db->close(metadata_db,0);
assert(r == 0); assert(r == 0);
r = db_create(&metadata_db, db_env, 0); r = db_create(&metadata_db, db_env, 0);
...@@ -311,7 +307,8 @@ static int tokudb_init_func(void *p) { ...@@ -311,7 +307,8 @@ static int tokudb_init_func(void *p) {
DBUG_PRINT("info", ("failed to create metadata db %d\n", r)); DBUG_PRINT("info", ("failed to create metadata db %d\n", r));
goto error; goto error;
} }
r= metadata_db->open(metadata_db, 0, TOKU_METADB_NAME, NULL, DB_BTREE, DB_THREAD, 0);
r= metadata_db->open(metadata_db, NULL, TOKU_METADB_NAME, NULL, DB_BTREE, DB_THREAD | DB_CREATE | DB_EXCL, my_umask);
if (r) { if (r) {
goto error; goto 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