From 8516fa4e3b6b25e3490af403f4b8ef29e031150a Mon Sep 17 00:00:00 2001 From: Zardosht Kasheff Date: Thu, 3 Dec 2009 17:10:27 +0000 Subject: [PATCH] [t:2151], more changes as result of code review git-svn-id: file:///svn/mysql/tokudb-engine/src@16278 c7de825b-a66e-492c-adef-691d508d4ae1 --- storage/tokudb/ha_tokudb.cc | 5 +---- storage/tokudb/hatoku_hton.cc | 9 +++------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc index 35fa2b33956..e579bc422ed 100644 --- a/storage/tokudb/ha_tokudb.cc +++ b/storage/tokudb/ha_tokudb.cc @@ -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_DUMP("prim_key", (uchar *) prim_key->data, prim_key->size); - if (keynr == active_index && cursor) { - error = cursor->c_del(cursor, 0); - } - else if (keynr == primary_key) { // Unique key + if (keynr == primary_key) { // Unique key DBUG_PRINT("Primary key", ("index: %d", keynr)); error = share->key_file[keynr]->del(share->key_file[keynr], trans, prim_key , DB_DELETE_ANY); } diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc index 82a92cf4c8e..d525d17bf6f 100644 --- a/storage/tokudb/hatoku_hton.cc +++ b/storage/tokudb/hatoku_hton.cc @@ -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 != ENOENT) { sql_print_error("Got error %d when trying to open metadata_db", r); goto error; } 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); assert(r == 0); r = db_create(&metadata_db, db_env, 0); @@ -311,7 +307,8 @@ static int tokudb_init_func(void *p) { DBUG_PRINT("info", ("failed to create metadata db %d\n", r)); 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) { goto error; }