mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
[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
This commit is contained in:
parent
7bf625bbaa
commit
7a07530515
3 changed files with 5 additions and 11 deletions
|
@ -114,7 +114,7 @@ static int allocate_key_and_col_info ( TABLE_SHARE* table_share, KEY_AND_COL_INF
|
|||
//
|
||||
// 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->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_
|
|||
case toku_type_fixbinary:
|
||||
case toku_type_fixstring:
|
||||
pack_length = field->pack_length();
|
||||
assert(pack_length < 256);
|
||||
kc_info->field_lengths[i] = (uchar)pack_length;
|
||||
assert(pack_length < 1<<16);
|
||||
kc_info->field_lengths[i] = (u_int16_t)pack_length;
|
||||
kc_info->length_bytes[i] = 0;
|
||||
break;
|
||||
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*
|
|||
case (toku_type_float):
|
||||
pos[0] = COL_FIX_FIELD;
|
||||
pos++;
|
||||
assert(kc_info->field_lengths[field_index] < 256);
|
||||
pos[0] = kc_info->field_lengths[field_index];
|
||||
pos++;
|
||||
break;
|
||||
|
@ -1637,13 +1638,6 @@ u_int32_t pack_desc_pk_info(uchar* buf, KEY_AND_COL_INFO* kc_info, TABLE_SHARE*
|
|||
pos++;
|
||||
break;
|
||||
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_varstring):
|
||||
case (toku_type_blob):
|
||||
|
|
|
@ -22,7 +22,7 @@ typedef struct st_multi_col_pack_info {
|
|||
|
||||
typedef struct st_key_and_col_info {
|
||||
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
|
||||
u_int32_t* blob_fields; // list of indexes of blob fields
|
||||
u_int32_t num_blobs;
|
||||
|
|
Loading…
Reference in a new issue