Commit 459aa71b authored by Rich Prohaska's avatar Rich Prohaska

#171 clean up tokudb comparison APIs a bit

parent 59f63383
This diff is collapsed.
...@@ -156,7 +156,6 @@ typedef struct st_multi_col_pack_info { ...@@ -156,7 +156,6 @@ typedef struct st_multi_col_pack_info {
uint32_t len_of_offsets; //length of the offset bytes in a packed row uint32_t len_of_offsets; //length of the offset bytes in a packed row
} MULTI_COL_PACK_INFO; } MULTI_COL_PACK_INFO;
typedef struct st_key_and_col_info { typedef struct st_key_and_col_info {
// //
// bitmaps for each key. key_filters[i] is associated with the i'th dictionary // bitmaps for each key. key_filters[i] is associated with the i'th dictionary
...@@ -198,9 +197,9 @@ typedef struct st_key_and_col_info { ...@@ -198,9 +197,9 @@ typedef struct st_key_and_col_info {
uint32_t num_offset_bytes; //number of bytes needed to encode the offset uint32_t num_offset_bytes; //number of bytes needed to encode the offset
} KEY_AND_COL_INFO; } KEY_AND_COL_INFO;
bool field_valid_for_tokudb_table(Field* field); static bool field_valid_for_tokudb_table(Field* field);
void get_var_field_info( static void get_var_field_info(
uint32_t* field_len, uint32_t* field_len,
uint32_t* start_offset, uint32_t* start_offset,
uint32_t var_field_index, uint32_t var_field_index,
...@@ -208,7 +207,7 @@ void get_var_field_info( ...@@ -208,7 +207,7 @@ void get_var_field_info(
uint32_t num_offset_bytes uint32_t num_offset_bytes
); );
void get_blob_field_info( static void get_blob_field_info(
uint32_t* start_offset, uint32_t* start_offset,
uint32_t len_of_offsets, uint32_t len_of_offsets,
const uchar* var_field_data_ptr, const uchar* var_field_data_ptr,
...@@ -285,16 +284,16 @@ typedef enum { ...@@ -285,16 +284,16 @@ typedef enum {
} TOKU_TYPE; } TOKU_TYPE;
TOKU_TYPE mysql_to_toku_type (Field* field); static TOKU_TYPE mysql_to_toku_type (Field* field);
uchar* pack_toku_varbinary_from_desc( static uchar* pack_toku_varbinary_from_desc(
uchar* to_tokudb, uchar* to_tokudb,
const uchar* from_desc, const uchar* from_desc,
uint32_t key_part_length, //number of bytes to use to encode the length in to_tokudb uint32_t key_part_length, //number of bytes to use to encode the length in to_tokudb
uint32_t field_length //length of field uint32_t field_length //length of field
); );
uchar* pack_toku_varstring_from_desc( static uchar* pack_toku_varstring_from_desc(
uchar* to_tokudb, uchar* to_tokudb,
const uchar* from_desc, const uchar* from_desc,
uint32_t key_part_length, //number of bytes to use to encode the length in to_tokudb uint32_t key_part_length, //number of bytes to use to encode the length in to_tokudb
...@@ -303,21 +302,21 @@ uchar* pack_toku_varstring_from_desc( ...@@ -303,21 +302,21 @@ uchar* pack_toku_varstring_from_desc(
); );
uchar* pack_toku_key_field( static uchar* pack_toku_key_field(
uchar* to_tokudb, uchar* to_tokudb,
uchar* from_mysql, uchar* from_mysql,
Field* field, Field* field,
uint32_t key_part_length //I really hope this is temporary as I phase out the pack_cmp stuff uint32_t key_part_length //I really hope this is temporary as I phase out the pack_cmp stuff
); );
uchar* pack_key_toku_key_field( static uchar* pack_key_toku_key_field(
uchar* to_tokudb, uchar* to_tokudb,
uchar* from_mysql, uchar* from_mysql,
Field* field, Field* field,
uint32_t key_part_length //I really hope this is temporary as I phase out the pack_cmp stuff uint32_t key_part_length //I really hope this is temporary as I phase out the pack_cmp stuff
); );
uchar* unpack_toku_key_field( static uchar* unpack_toku_key_field(
uchar* to_mysql, uchar* to_mysql,
uchar* from_tokudb, uchar* from_tokudb,
Field* field, Field* field,
...@@ -338,6 +337,10 @@ uchar* unpack_toku_key_field( ...@@ -338,6 +337,10 @@ uchar* unpack_toku_key_field(
#define COL_ZERO 0 #define COL_ZERO 0
#define COL_POS_INF 1 #define COL_POS_INF 1
#define COL_FIX_FIELD 0x11
#define COL_VAR_FIELD 0x22
#define COL_BLOB_FIELD 0x33
// //
// information for hidden primary keys // information for hidden primary keys
// //
...@@ -357,7 +360,7 @@ static inline ulonglong hpk_char_to_num(uchar* val) { ...@@ -357,7 +360,7 @@ static inline ulonglong hpk_char_to_num(uchar* val) {
return uint8korr(val); return uint8korr(val);
} }
int tokudb_compare_two_keys( static int tokudb_compare_two_keys(
const void* new_key_data, const void* new_key_data,
const uint32_t new_key_size, const uint32_t new_key_size,
const void* saved_key_data, const void* saved_key_data,
...@@ -368,10 +371,10 @@ int tokudb_compare_two_keys( ...@@ -368,10 +371,10 @@ int tokudb_compare_two_keys(
bool* read_string bool* read_string
); );
int tokudb_cmp_dbt_key(DB* db, const DBT *keya, const DBT *keyb); static int tokudb_cmp_dbt_key(DB* db, const DBT *keya, const DBT *keyb);
//TODO: QQQ Only do one direction for prefix. //TODO: QQQ Only do one direction for prefix.
int tokudb_prefix_cmp_dbt_key(DB *file, const DBT *keya, const DBT *keyb); static int tokudb_prefix_cmp_dbt_key(DB *file, const DBT *keya, const DBT *keyb);
static int tokudb_compare_two_key_parts( static int tokudb_compare_two_key_parts(
const void* new_key_data, const void* new_key_data,
...@@ -385,7 +388,7 @@ static int tokudb_compare_two_key_parts( ...@@ -385,7 +388,7 @@ static int tokudb_compare_two_key_parts(
static int tokudb_cmp_dbt_key_parts(DB *file, const DBT *keya, const DBT *keyb, uint max_parts); static int tokudb_cmp_dbt_key_parts(DB *file, const DBT *keya, const DBT *keyb, uint max_parts);
int create_toku_key_descriptor( static int create_toku_key_descriptor(
uchar* buf, uchar* buf,
bool is_first_hpk, bool is_first_hpk,
KEY* first_key, KEY* first_key,
...@@ -394,15 +397,15 @@ int create_toku_key_descriptor( ...@@ -394,15 +397,15 @@ int create_toku_key_descriptor(
); );
uint32_t create_toku_main_key_pack_descriptor ( static uint32_t create_toku_main_key_pack_descriptor (
uchar* buf uchar* buf
); );
uint32_t get_max_clustering_val_pack_desc_size( static uint32_t get_max_clustering_val_pack_desc_size(
TABLE_SHARE* table_share TABLE_SHARE* table_share
); );
uint32_t create_toku_clustering_val_pack_descriptor ( static uint32_t create_toku_clustering_val_pack_descriptor (
uchar* buf, uchar* buf,
uint pk_index, uint pk_index,
TABLE_SHARE* table_share, TABLE_SHARE* table_share,
...@@ -419,18 +422,18 @@ static inline bool is_key_clustering( ...@@ -419,18 +422,18 @@ static inline bool is_key_clustering(
return (row_desc_size > 0); return (row_desc_size > 0);
} }
uint32_t pack_clustering_val_from_desc( static uint32_t pack_clustering_val_from_desc(
uchar* buf, uchar* buf,
void* row_desc, void* row_desc,
uint32_t row_desc_size, uint32_t row_desc_size,
const DBT* pk_val const DBT* pk_val
); );
uint32_t get_max_secondary_key_pack_desc_size( static uint32_t get_max_secondary_key_pack_desc_size(
KEY_AND_COL_INFO* kc_info KEY_AND_COL_INFO* kc_info
); );
uint32_t create_toku_secondary_key_pack_descriptor ( static uint32_t create_toku_secondary_key_pack_descriptor (
uchar* buf, uchar* buf,
bool has_hpk, bool has_hpk,
uint pk_index, uint pk_index,
...@@ -450,13 +453,13 @@ static inline bool is_key_pk( ...@@ -450,13 +453,13 @@ static inline bool is_key_pk(
return buf[0]; return buf[0];
} }
uint32_t max_key_size_from_desc( static uint32_t max_key_size_from_desc(
void* row_desc, void* row_desc,
uint32_t row_desc_size uint32_t row_desc_size
); );
uint32_t pack_key_from_desc( static uint32_t pack_key_from_desc(
uchar* buf, uchar* buf,
void* row_desc, void* row_desc,
uint32_t row_desc_size, uint32_t row_desc_size,
...@@ -464,17 +467,17 @@ uint32_t pack_key_from_desc( ...@@ -464,17 +467,17 @@ uint32_t pack_key_from_desc(
const DBT* pk_val const DBT* pk_val
); );
bool fields_have_same_name( static bool fields_have_same_name(
Field* a, Field* a,
Field* b Field* b
); );
bool fields_are_same_type( static bool fields_are_same_type(
Field* a, Field* a,
Field* b Field* b
); );
bool are_two_fields_same( static bool are_two_fields_same(
Field* a, Field* a,
Field* b Field* b
); );
......
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