Commit 6d229ca2 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

addresses #977

temporary change to test if just doing a memcpy will work for unpacking
a Field_new_decimal
real change is to modify Field_new_decimal, but by checking this in, we can
quickly get regression results

git-svn-id: file:///svn/mysql/tokudb-engine/src@4904 c7de825b-a66e-492c-adef-691d508d4ae1
parent 2929a3c4
...@@ -1483,10 +1483,16 @@ void ha_tokudb::unpack_key(uchar * record, DBT * key, uint index) { ...@@ -1483,10 +1483,16 @@ void ha_tokudb::unpack_key(uchar * record, DBT * key, uint index) {
/* tokutek change to make pack_key and unpack_key work for /* tokutek change to make pack_key and unpack_key work for
decimals */ decimals */
uint unpack_length = key_part->length; uint unpack_length = key_part->length;
//
// TEMPORARY HACK
// True change is to modify the Field_new_decimal class to properly
// implement unpack_key, pack_key, and pack_cmp, part of ticket 977
//
if (key_part->field->type() == MYSQL_TYPE_NEWDECIMAL) { if (key_part->field->type() == MYSQL_TYPE_NEWDECIMAL) {
Field_new_decimal *field_nd = (Field_new_decimal *) key_part->field; memcpy(record + field_offset(key_part->field), pos, key_part->length);
unpack_length += field_nd->precision << 8; pos += key_part->length;
} }
else {
pos = (uchar *) key_part->field->unpack_key(record + field_offset(key_part->field), pos, pos = (uchar *) key_part->field->unpack_key(record + field_offset(key_part->field), pos,
#if MYSQL_VERSION_ID < 50123 #if MYSQL_VERSION_ID < 50123
unpack_length); unpack_length);
...@@ -1494,6 +1500,7 @@ void ha_tokudb::unpack_key(uchar * record, DBT * key, uint index) { ...@@ -1494,6 +1500,7 @@ void ha_tokudb::unpack_key(uchar * record, DBT * key, uint index) {
unpack_length, table->s->db_low_byte_first); unpack_length, table->s->db_low_byte_first);
#endif #endif
} }
}
} }
......
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