Commit 83fd0109 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:1979], remove old hack

git-svn-id: file:///svn/mysql/tokudb-engine/src@16249 c7de825b-a66e-492c-adef-691d508d4ae1
parent 4acb099b
...@@ -1062,10 +1062,10 @@ cleanup: ...@@ -1062,10 +1062,10 @@ cleanup:
return error; return error;
} }
int ha_tokudb::open_main_dictionary(const char* name, int mode, DB_TXN* txn) { int ha_tokudb::open_main_dictionary(const char* name, bool is_read_only, DB_TXN* txn) {
int error; int error;
char* newname = NULL; char* newname = NULL;
uint open_flags = (mode == O_RDONLY ? DB_RDONLY : 0) | DB_THREAD; uint open_flags = (is_read_only ? DB_RDONLY : 0) | DB_THREAD;
open_flags += DB_AUTO_COMMIT; open_flags += DB_AUTO_COMMIT;
assert(share->file == NULL); assert(share->file == NULL);
...@@ -1118,10 +1118,10 @@ exit: ...@@ -1118,10 +1118,10 @@ exit:
// //
// Open a secondary table, the key will be a secondary index, the data will be a primary key // Open a secondary table, the key will be a secondary index, the data will be a primary key
// //
int ha_tokudb::open_secondary_dictionary(DB** ptr, KEY* key_info, const char* name, int mode, DB_TXN* txn) { int ha_tokudb::open_secondary_dictionary(DB** ptr, KEY* key_info, const char* name, bool is_read_only, DB_TXN* txn) {
int error = ENOSYS; int error = ENOSYS;
char dict_name[MAX_DICT_NAME_LEN]; char dict_name[MAX_DICT_NAME_LEN];
uint open_flags = (mode == O_RDONLY ? DB_RDONLY : 0) | DB_THREAD; uint open_flags = (is_read_only ? DB_RDONLY : 0) | DB_THREAD;
char* newname = NULL; char* newname = NULL;
uint newname_len = 0; uint newname_len = 0;
...@@ -1335,7 +1335,7 @@ int ha_tokudb::initialize_share( ...@@ -1335,7 +1335,7 @@ int ha_tokudb::initialize_share(
} }
error = open_main_dictionary(name, mode, NULL); error = open_main_dictionary(name, mode == O_RDONLY, NULL);
if (error) { goto exit; } if (error) { goto exit; }
/* Open other keys; These are part of the share structure */ /* Open other keys; These are part of the share structure */
...@@ -1345,7 +1345,7 @@ int ha_tokudb::initialize_share( ...@@ -1345,7 +1345,7 @@ int ha_tokudb::initialize_share(
&share->key_file[i], &share->key_file[i],
&table_share->key_info[i], &table_share->key_info[i],
name, name,
mode, mode == O_RDONLY,
NULL NULL
); );
if (error) { if (error) {
...@@ -5676,7 +5676,7 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) { ...@@ -5676,7 +5676,7 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) {
&share->key_file[curr_index], &share->key_file[curr_index],
&key_info[i], &key_info[i],
share->table_name, share->table_name,
2, // TODO: This is a hack. Need to learn what should really be here. Need to ask Yoni false,
txn txn
); );
if (error) { goto cleanup; } if (error) { goto cleanup; }
...@@ -6177,7 +6177,7 @@ To truncate the table, make sure no transactions touch the table.", share->table ...@@ -6177,7 +6177,7 @@ To truncate the table, make sure no transactions touch the table.", share->table
&share->key_file[i], &share->key_file[i],
&table_share->key_info[i], &table_share->key_info[i],
share->table_name, share->table_name,
2, // TODO: This is a hack. Need to learn what should really be here. Need to ask Yoni false, //
NULL NULL
); );
assert(!r); assert(!r);
...@@ -6185,7 +6185,7 @@ To truncate the table, make sure no transactions touch the table.", share->table ...@@ -6185,7 +6185,7 @@ To truncate the table, make sure no transactions touch the table.", share->table
else { else {
r = open_main_dictionary( r = open_main_dictionary(
share->table_name, share->table_name,
2, // TODO: This is a hack. Need to learn what should really be here. Need to ask Yoni false,
NULL NULL
); );
assert(!r); assert(!r);
......
...@@ -259,8 +259,8 @@ private: ...@@ -259,8 +259,8 @@ private:
int handle_cursor_error(int error, int err_to_return, uint keynr); int handle_cursor_error(int error, int err_to_return, uint keynr);
DBT *get_pos(DBT * to, uchar * pos); DBT *get_pos(DBT * to, uchar * pos);
int open_main_dictionary(const char* name, int mode, DB_TXN* txn); int open_main_dictionary(const char* name, bool is_read_only, DB_TXN* txn);
int open_secondary_dictionary(DB** ptr, KEY* key_info, const char* name, int mode, DB_TXN* txn); int open_secondary_dictionary(DB** ptr, KEY* key_info, const char* name, bool is_read_only, DB_TXN* txn);
int open_status_dictionary(DB** ptr, const char* name, DB_TXN* txn); int open_status_dictionary(DB** ptr, const char* name, DB_TXN* txn);
int acquire_table_lock (DB_TXN* trans, TABLE_LOCK_TYPE lt); int acquire_table_lock (DB_TXN* trans, TABLE_LOCK_TYPE lt);
int estimate_num_rows(DB* db, u_int64_t* num_rows); int estimate_num_rows(DB* db, u_int64_t* num_rows);
......
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