Commit 7a075305 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:2383], change kc_info->field_lengths to 2 bytes perelement

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@17884 c7de825b-a66e-492c-adef-691d508d4ae1
parent 7bf625bb
...@@ -114,7 +114,7 @@ static int allocate_key_and_col_info ( TABLE_SHARE* table_share, KEY_AND_COL_INF ...@@ -114,7 +114,7 @@ static int allocate_key_and_col_info ( TABLE_SHARE* table_share, KEY_AND_COL_INF
// //
// create the field lengths // create the field lengths
// //
kc_info->field_lengths = (uchar *)my_malloc(table_share->fields, MYF(MY_WME | MY_ZEROFILL)); kc_info->field_lengths = (u_int16_t *)my_malloc(table_share->fields*sizeof(u_int16_t), MYF(MY_WME | MY_ZEROFILL));
kc_info->length_bytes= (uchar *)my_malloc(table_share->fields, MYF(MY_WME | MY_ZEROFILL)); kc_info->length_bytes= (uchar *)my_malloc(table_share->fields, MYF(MY_WME | MY_ZEROFILL));
kc_info->blob_fields= (u_int32_t *)my_malloc(table_share->fields*sizeof(u_int32_t), MYF(MY_WME | MY_ZEROFILL)); kc_info->blob_fields= (u_int32_t *)my_malloc(table_share->fields*sizeof(u_int32_t), MYF(MY_WME | MY_ZEROFILL));
...@@ -1350,8 +1350,8 @@ int initialize_key_and_col_info(TABLE_SHARE* table_share, TABLE* table, KEY_AND_ ...@@ -1350,8 +1350,8 @@ int initialize_key_and_col_info(TABLE_SHARE* table_share, TABLE* table, KEY_AND_
case toku_type_fixbinary: case toku_type_fixbinary:
case toku_type_fixstring: case toku_type_fixstring:
pack_length = field->pack_length(); pack_length = field->pack_length();
assert(pack_length < 256); assert(pack_length < 1<<16);
kc_info->field_lengths[i] = (uchar)pack_length; kc_info->field_lengths[i] = (u_int16_t)pack_length;
kc_info->length_bytes[i] = 0; kc_info->length_bytes[i] = 0;
break; break;
case toku_type_blob: case toku_type_blob:
......
...@@ -1624,6 +1624,7 @@ u_int32_t pack_desc_pk_info(uchar* buf, KEY_AND_COL_INFO* kc_info, TABLE_SHARE* ...@@ -1624,6 +1624,7 @@ u_int32_t pack_desc_pk_info(uchar* buf, KEY_AND_COL_INFO* kc_info, TABLE_SHARE*
case (toku_type_float): case (toku_type_float):
pos[0] = COL_FIX_FIELD; pos[0] = COL_FIX_FIELD;
pos++; pos++;
assert(kc_info->field_lengths[field_index] < 256);
pos[0] = kc_info->field_lengths[field_index]; pos[0] = kc_info->field_lengths[field_index];
pos++; pos++;
break; break;
...@@ -1637,13 +1638,6 @@ u_int32_t pack_desc_pk_info(uchar* buf, KEY_AND_COL_INFO* kc_info, TABLE_SHARE* ...@@ -1637,13 +1638,6 @@ u_int32_t pack_desc_pk_info(uchar* buf, KEY_AND_COL_INFO* kc_info, TABLE_SHARE*
pos++; pos++;
break; break;
case (toku_type_fixstring): case (toku_type_fixstring):
pos[0] = COL_VAR_FIELD;
pos++;
// always one length byte for fix fields
assert(key_part_length <= 255);
pos[0] = 1;
pos++;
break;
case (toku_type_varbinary): case (toku_type_varbinary):
case (toku_type_varstring): case (toku_type_varstring):
case (toku_type_blob): case (toku_type_blob):
......
...@@ -22,7 +22,7 @@ typedef struct st_multi_col_pack_info { ...@@ -22,7 +22,7 @@ typedef struct st_multi_col_pack_info {
typedef struct st_key_and_col_info { typedef struct st_key_and_col_info {
MY_BITMAP key_filters[MAX_KEY+1]; MY_BITMAP key_filters[MAX_KEY+1];
uchar* field_lengths; //stores the field lengths of fixed size fields (255 max) u_int16_t* field_lengths; //stores the field lengths of fixed size fields (1<<16 - 1 max)
uchar* length_bytes; // stores the length of lengths of varchars and varbinaries uchar* length_bytes; // stores the length of lengths of varchars and varbinaries
u_int32_t* blob_fields; // list of indexes of blob fields u_int32_t* blob_fields; // list of indexes of blob fields
u_int32_t num_blobs; u_int32_t num_blobs;
......
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