Commit 4cb22624 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:2219], cosmetic change

git-svn-id: file:///svn/mysql/tokudb-engine/src@16157 c7de825b-a66e-492c-adef-691d508d4ae1
parent 80035693
This diff is collapsed.
...@@ -49,7 +49,6 @@ typedef struct st_tokudb_share { ...@@ -49,7 +49,6 @@ typedef struct st_tokudb_share {
// key is hidden // key is hidden
// //
DB *key_file[MAX_KEY +1]; DB *key_file[MAX_KEY +1];
u_int32_t key_type[MAX_KEY +1];
uint status, version, capabilities; uint status, version, capabilities;
uint ref_length; uint ref_length;
// //
...@@ -249,8 +248,9 @@ class ha_tokudb : public handler { ...@@ -249,8 +248,9 @@ class ha_tokudb : public handler {
u_int32_t place_key_into_mysql_buff(KEY* key_info, uchar * record, uchar* data); u_int32_t place_key_into_mysql_buff(KEY* key_info, uchar * record, uchar* data);
void unpack_key(uchar * record, DBT const *key, uint index); void unpack_key(uchar * record, DBT const *key, uint index);
u_int32_t place_key_into_dbt_buff(KEY* key_info, uchar * buff, const uchar * record, bool* has_null, int key_length); u_int32_t place_key_into_dbt_buff(KEY* key_info, uchar * buff, const uchar * record, bool* has_null, int key_length);
DBT* create_dbt_key_from_key(DBT * key, KEY* key_info, uchar * buff, const uchar * record, bool* has_null, int key_length = MAX_KEY_LENGTH); DBT* create_dbt_key_from_key(DBT * key, KEY* key_info, uchar * buff, const uchar * record, bool* has_null, bool pack_pk, int key_length = MAX_KEY_LENGTH);
DBT *create_dbt_key_from_table(DBT * key, uint keynr, uchar * buff, const uchar * record, bool* has_null, int key_length = MAX_KEY_LENGTH); DBT *create_dbt_key_from_table(DBT * key, uint keynr, uchar * buff, const uchar * record, bool* has_null, int key_length = MAX_KEY_LENGTH);
DBT* create_dbt_key_for_lookup(DBT * key, KEY* key_info, uchar * buff, const uchar * record, bool* has_null, int key_length = MAX_KEY_LENGTH);
DBT *pack_key(DBT * key, uint keynr, uchar * buff, const uchar * key_ptr, uint key_length, int8_t inf_byte); DBT *pack_key(DBT * key, uint keynr, uchar * buff, const uchar * key_ptr, uint key_length, int8_t inf_byte);
int remove_key(DB_TXN * trans, uint keynr, const uchar * record, DBT * prim_key); int remove_key(DB_TXN * trans, uint keynr, const uchar * record, DBT * prim_key);
int remove_keys(DB_TXN * trans, const uchar * record, DBT * prim_key); int remove_keys(DB_TXN * trans, const uchar * record, DBT * prim_key);
...@@ -260,7 +260,7 @@ class ha_tokudb : public handler { ...@@ -260,7 +260,7 @@ class ha_tokudb : public handler {
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, int mode, DB_TXN* txn);
int open_secondary_dictionary(DB** ptr, KEY* key_info, const char* name, int mode, u_int32_t* key_type, DB_TXN* txn); int open_secondary_dictionary(DB** ptr, KEY* key_info, const char* name, int mode, 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);
...@@ -288,6 +288,7 @@ class ha_tokudb : public handler { ...@@ -288,6 +288,7 @@ class ha_tokudb : public handler {
int create_secondary_dictionary(const char* name, TABLE* form, KEY* key_info, DB_TXN* txn); int create_secondary_dictionary(const char* name, TABLE* form, KEY* key_info, DB_TXN* txn);
int create_main_dictionary(const char* name, TABLE* form, DB_TXN* txn); int create_main_dictionary(const char* name, TABLE* form, DB_TXN* txn);
void trace_create_table_info(const char *name, TABLE * form); void trace_create_table_info(const char *name, TABLE * form);
int is_val_unique(bool* is_unique, uchar* record, KEY* key_info, uint dict_index, DB_TXN* txn);
public: public:
...@@ -427,8 +428,8 @@ class ha_tokudb : public handler { ...@@ -427,8 +428,8 @@ class ha_tokudb : public handler {
// effect: all dictionaries, including the main and indexes, should be empty // effect: all dictionaries, including the main and indexes, should be empty
int discard_or_import_tablespace(my_bool discard); int discard_or_import_tablespace(my_bool discard);
int delete_all_rows(); int delete_all_rows();
void extract_hidden_primary_key(uint keynr, DBT const *row, DBT const *found_key); void extract_hidden_primary_key(uint keynr, DBT const *found_key);
void read_key_only(uchar * buf, uint keynr, DBT const *row, DBT const *found_key); void read_key_only(uchar * buf, uint keynr, DBT const *found_key);
int read_row_callback (uchar * buf, uint keynr, DBT const *row, DBT const *found_key); int read_row_callback (uchar * buf, uint keynr, DBT const *row, DBT const *found_key);
int read_primary_key(uchar * buf, uint keynr, DBT const *row, DBT const *found_key); int read_primary_key(uchar * buf, uint keynr, DBT const *row, DBT const *found_key);
int unpack_blobs( int unpack_blobs(
......
...@@ -854,7 +854,6 @@ int create_toku_key_descriptor_for_key(KEY* key, uchar* buf) { ...@@ -854,7 +854,6 @@ int create_toku_key_descriptor_for_key(KEY* key, uchar* buf) {
int create_toku_key_descriptor( int create_toku_key_descriptor(
uchar* buf, uchar* buf,
bool is_first_hpk, bool is_first_hpk,
bool is_clustering_key,
KEY* first_key, KEY* first_key,
bool is_second_hpk, bool is_second_hpk,
KEY* second_key KEY* second_key
...@@ -868,16 +867,6 @@ int create_toku_key_descriptor( ...@@ -868,16 +867,6 @@ int create_toku_key_descriptor(
u_int32_t num_bytes = 0; u_int32_t num_bytes = 0;
u_int32_t offset = 0; u_int32_t offset = 0;
//
// sanity check:
// assert that if the first key is a hpk, then it is not a clustering key
//
assert(!(is_first_hpk && is_clustering_key));
//
// sanity check:
// assert that if it is a clustering key, then a second key exists
//
assert(!(is_clustering_key && !is_second_hpk && second_key == NULL));
if (is_first_hpk) { if (is_first_hpk) {
pos[0] = 0; //say there is NO infinity byte pos[0] = 0; //say there is NO infinity byte
...@@ -895,19 +884,6 @@ int create_toku_key_descriptor( ...@@ -895,19 +884,6 @@ int create_toku_key_descriptor(
pos += num_bytes; pos += num_bytes;
} }
//
// at this point, write the amount of data that has been written for the first
// key, iff it is NOT a clustering key. If it is a clustering key, we will need to write it
// after we have written the second key.
//
if (!is_clustering_key) {
offset = pos - buf;
buf[0] = (uchar)(offset & 255);
buf[1] = (uchar)((offset >> 8) & 255);
buf[2] = (uchar)((offset >> 16) & 255);
buf[3] = (uchar)((offset >> 24) & 255);
}
// //
// if we do not have a second key, we can jump to exit right now // if we do not have a second key, we can jump to exit right now
// we do not have a second key if it is not a hidden primary key // we do not have a second key if it is not a hidden primary key
...@@ -917,11 +893,6 @@ int create_toku_key_descriptor( ...@@ -917,11 +893,6 @@ int create_toku_key_descriptor(
goto exit; goto exit;
} }
if (!is_clustering_key) {
pos[0] = (is_second_hpk) ? 0 : 1; //we place an infinity byte iff it is NOT a clustering key and NOT a hpk
pos++;
}
// //
// if we have a second key, and it is an hpk, we need to pack it, and // if we have a second key, and it is an hpk, we need to pack it, and
// write in the offset to this position in the first four bytes // write in the offset to this position in the first four bytes
...@@ -939,15 +910,14 @@ int create_toku_key_descriptor( ...@@ -939,15 +910,14 @@ int create_toku_key_descriptor(
pos += num_bytes; pos += num_bytes;
} }
if (is_clustering_key) {
offset = pos - buf;
buf[0] = (uchar)(offset & 255);
buf[1] = (uchar)((offset >> 8) & 255);
buf[2] = (uchar)((offset >> 16) & 255);
buf[3] = (uchar)((offset >> 24) & 255);
}
exit: exit:
offset = pos - buf;
buf[0] = (uchar)(offset & 255);
buf[1] = (uchar)((offset >> 8) & 255);
buf[2] = (uchar)((offset >> 16) & 255);
buf[3] = (uchar)((offset >> 24) & 255);
return pos - buf; return pos - buf;
} }
......
...@@ -105,7 +105,6 @@ int tokudb_prefix_cmp_dbt_key(DB *file, const DBT *keya, const DBT *keyb); ...@@ -105,7 +105,6 @@ int tokudb_prefix_cmp_dbt_key(DB *file, const DBT *keya, const DBT *keyb);
int create_toku_key_descriptor( int create_toku_key_descriptor(
uchar* buf, uchar* buf,
bool is_first_hpk, bool is_first_hpk,
bool is_clustering_key,
KEY* first_key, KEY* first_key,
bool is_second_hpk, bool is_second_hpk,
KEY* second_key KEY* second_key
......
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