Commit 25bacb83 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

addresses #1619

create pack_key_field for ::index_read calls

git-svn-id: file:///svn/mysql/tokudb-engine/src@10745 c7de825b-a66e-492c-adef-691d508d4ae1
parent 7c7623d4
......@@ -1491,12 +1491,15 @@ DBT *ha_tokudb::pack_key(DBT * key, uint keynr, uchar * buff, const uchar * key_
*buff++ = NONNULL_COL_VAL;
offset = 1; // Data is at key_ptr+1
}
buff = key_part->field->pack_key_from_key_image(
buff,
assert(table->s->db_low_byte_first);
buff = pack_key_field(
buff,
(uchar *) key_ptr + offset,
key_part->length,
table->s->db_low_byte_first
key_part->field,
key_part->length
);
key_ptr += key_part->store_length;
key_length -= key_part->store_length;
}
......
......@@ -100,6 +100,34 @@ exit:
return new_pos;
}
uchar* pack_key_field(
uchar* to_tokudb,
uchar* from_mysql,
Field* field,
u_int32_t key_part_length //I really hope this is temporary as I phase out the pack_cmp stuff
)
{
uchar* new_pos = NULL;
TOKU_TYPE toku_type = mysql_to_toku_type(field->type());
switch(toku_type) {
case (toku_type_int):
pack_field(to_tokudb, from_mysql, field, key_part_length);
goto exit;
default:
new_pos= field->pack_key_from_key_image(
to_tokudb,
from_mysql,
key_part_length,
true
);
goto exit;
}
assert(false);
exit:
return new_pos;
}
uchar* unpack_field(
uchar* to_mysql,
uchar* from_tokudb,
......
......@@ -22,7 +22,9 @@ typedef enum {
inline TOKU_TYPE mysql_to_toku_type (enum_field_types mysql_type);
int compare_field(uchar* a_buf, Field* a_field, uchar* b_buf, Field* b_field);
uchar* pack_field(
uchar* to_tokudb,
uchar* from_mysql,
......@@ -30,6 +32,13 @@ uchar* pack_field(
u_int32_t key_part_length //I really hope this is temporary as I phase out the pack_cmp stuff
);
uchar* pack_key_field(
uchar* to_tokudb,
uchar* from_mysql,
Field* field,
u_int32_t key_part_length //I really hope this is temporary as I phase out the pack_cmp stuff
);
uchar* unpack_field(
uchar* to_mysql,
uchar* from_tokudb,
......
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