~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table.cc

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
RemoveĀ uint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
static int open_binary_frm(THD *thd, TABLE_SHARE *share,
33
33
                           unsigned char *head, File file);
34
34
static void fix_type_pointers(const char ***array, TYPELIB *point_to_type,
35
 
                              uint types, char **names);
36
 
static uint find_field(Field **fields, unsigned char *record, uint start, uint length);
 
35
                              uint32_t types, char **names);
 
36
static uint32_t find_field(Field **fields, unsigned char *record, uint32_t start, uint32_t length);
37
37
 
38
38
/*************************************************************************/
39
39
 
108
108
*/
109
109
 
110
110
TABLE_SHARE *alloc_table_share(TableList *table_list, char *key,
111
 
                               uint key_length)
 
111
                               uint32_t key_length)
112
112
{
113
113
  MEM_ROOT mem_root;
114
114
  TABLE_SHARE *share;
115
115
  char *key_buff, *path_buff;
116
116
  char path[FN_REFLEN];
117
 
  uint path_length;
 
117
  uint32_t path_length;
118
118
 
119
119
  path_length= build_table_filename(path, sizeof(path) - 1,
120
120
                                    table_list->db,
187
187
*/
188
188
 
189
189
void init_tmp_table_share(THD *thd, TABLE_SHARE *share, const char *key,
190
 
                          uint key_length, const char *table_name,
 
190
                          uint32_t key_length, const char *table_name,
191
191
                          const char *path)
192
192
{
193
193
 
291
291
   6    Unknown .frm version
292
292
*/
293
293
 
294
 
int open_table_def(THD *thd, TABLE_SHARE *share, uint db_flags  __attribute__((unused)))
 
294
int open_table_def(THD *thd, TABLE_SHARE *share, uint32_t db_flags  __attribute__((unused)))
295
295
{
296
296
  int error, table_type;
297
297
  bool error_given;
326
326
      goto err_not_open;
327
327
 
328
328
    /* Try unencoded 5.0 name */
329
 
    uint length;
 
329
    uint32_t length;
330
330
    strxnmov(path, sizeof(path)-1,
331
331
             mysql_data_home, "/", share->db.str, "/",
332
332
             share->table_name.str, reg_ext, NULL);
411
411
                           File file)
412
412
{
413
413
  int error, errarg= 0;
414
 
  uint new_frm_ver, field_pack_length, new_field_pack_flag;
415
 
  uint interval_count, interval_parts, read_length, int_length;
416
 
  uint db_create_options, keys, key_parts, n_length;
417
 
  uint key_info_length, com_length, null_bit_pos=0;
418
 
  uint extra_rec_buf_length;
419
 
  uint i,j;
 
414
  uint32_t new_frm_ver, field_pack_length, new_field_pack_flag;
 
415
  uint32_t interval_count, interval_parts, read_length, int_length;
 
416
  uint32_t db_create_options, keys, key_parts, n_length;
 
417
  uint32_t key_info_length, com_length, null_bit_pos=0;
 
418
  uint32_t extra_rec_buf_length;
 
419
  uint32_t i,j;
420
420
  bool use_hash;
421
421
  unsigned char forminfo[288];
422
422
  char *keynames, *names, *comment_pos;
619
619
    buff_end= buff + n_length;
620
620
    if (next_chunk + 2 < buff_end)
621
621
    {
622
 
      uint str_db_type_length= uint2korr(next_chunk);
 
622
      uint32_t str_db_type_length= uint2korr(next_chunk);
623
623
      LEX_STRING name;
624
624
      name.str= (char*) next_chunk + 2;
625
625
      name.length= str_db_type_length;
696
696
      }
697
697
      else
698
698
      {
699
 
        const uint format_section_header_size= 8;
700
 
        uint format_section_len= uint2korr(next_chunk+0);
 
699
        const uint32_t format_section_header_size= 8;
 
700
        uint32_t format_section_len= uint2korr(next_chunk+0);
701
701
 
702
702
        field_extra_info= next_chunk + format_section_header_size + 1;
703
703
        next_chunk+= format_section_len;
779
779
         interval < share->intervals + interval_count;
780
780
         interval++)
781
781
    {
782
 
      uint count= (uint) (interval->count + 1) * sizeof(uint);
783
 
      if (!(interval->type_lengths= (uint *) alloc_root(&share->mem_root,
 
782
      uint32_t count= (uint) (interval->count + 1) * sizeof(uint);
 
783
      if (!(interval->type_lengths= (uint32_t *) alloc_root(&share->mem_root,
784
784
                                                        count)))
785
785
        goto err;
786
786
      for (count= 0; count < interval->count; count++)
822
822
 
823
823
  for (i=0 ; i < share->fields; i++, strpos+=field_pack_length, field_ptr++)
824
824
  {
825
 
    uint pack_flag, interval_nr, unireg_type, recpos, field_length;
 
825
    uint32_t pack_flag, interval_nr, unireg_type, recpos, field_length;
826
826
    enum_field_types field_type;
827
827
    enum column_format_type column_format= COLUMN_FORMAT_TYPE_DEFAULT;
828
828
    const CHARSET_INFO *charset= NULL;
842
842
      pack_flag=    uint2korr(strpos+8);
843
843
      unireg_type=  (uint) strpos[10];
844
844
      interval_nr=  (uint) strpos[12];
845
 
      uint comment_length=uint2korr(strpos+15);
 
845
      uint32_t comment_length=uint2korr(strpos+15);
846
846
      field_type=(enum_field_types) (uint) strpos[13];
847
847
 
848
848
      {
951
951
  /* Fix key->name and key_part->field */
952
952
  if (key_parts)
953
953
  {
954
 
    uint primary_key=(uint) (find_type((char*) primary_key_name,
 
954
    uint32_t primary_key=(uint) (find_type((char*) primary_key_name,
955
955
                                       &share->keynames, 3) - 1);
956
956
    int64_t ha_option= handler_file->ha_table_flags();
957
957
    keyinfo= share->key_info;
958
958
    key_part= keyinfo->key_part;
959
959
 
960
 
    for (uint key=0 ; key < share->keys ; key++,keyinfo++)
 
960
    for (uint32_t key=0 ; key < share->keys ; key++,keyinfo++)
961
961
    {
962
 
      uint usable_parts= 0;
 
962
      uint32_t usable_parts= 0;
963
963
      keyinfo->name=(char*) share->keynames.type_names[key];
964
964
 
965
965
      if (primary_key >= MAX_KEY && (keyinfo->flags & HA_NOSAME))
971
971
        primary_key=key;
972
972
        for (i=0 ; i < keyinfo->key_parts ;i++)
973
973
        {
974
 
          uint fieldnr= key_part[i].fieldnr;
 
974
          uint32_t fieldnr= key_part[i].fieldnr;
975
975
          if (!fieldnr ||
976
976
              share->field[fieldnr-1]->null_ptr ||
977
977
              share->field[fieldnr-1]->key_length() !=
1103
1103
  if (new_field_pack_flag <= 1)
1104
1104
  {
1105
1105
    /* Old file format with default as not null */
1106
 
    uint null_length= (share->null_fields+7)/8;
 
1106
    uint32_t null_length= (share->null_fields+7)/8;
1107
1107
    memset(share->default_values + (null_flags - (unsigned char*) record), 
1108
1108
          null_length, 255);
1109
1109
  }
1128
1128
  if (share->blob_fields)
1129
1129
  {
1130
1130
    Field **ptr;
1131
 
    uint k, *save;
 
1131
    uint32_t k, *save;
1132
1132
 
1133
1133
    /* Store offsets to blob fields to find them fast */
1134
1134
    if (!(share->blob_field= save=
1209
1209
*/
1210
1210
 
1211
1211
int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
1212
 
                          uint db_stat, uint prgflag, uint ha_open_flags,
 
1212
                          uint32_t db_stat, uint32_t prgflag, uint32_t ha_open_flags,
1213
1213
                          Table *outparam, open_table_mode open_mode)
1214
1214
{
1215
1215
  int error;
1216
 
  uint records, i, bitmap_size;
 
1216
  uint32_t records, i, bitmap_size;
1217
1217
  bool error_reported= false;
1218
1218
  unsigned char *record, *bitmaps;
1219
1219
  Field **field_ptr;
1325
1325
  {
1326
1326
    KEY *key_info, *key_info_end;
1327
1327
    KEY_PART_INFO *key_part;
1328
 
    uint n_length;
 
1328
    uint32_t n_length;
1329
1329
    n_length= share->keys*sizeof(KEY) + share->key_parts*sizeof(KEY_PART_INFO);
1330
1330
    if (!(key_info= (KEY*) alloc_root(&outparam->mem_root, n_length)))
1331
1331
      goto err;
1489
1489
 
1490
1490
void free_blobs(register Table *table)
1491
1491
{
1492
 
  uint *ptr, *end;
 
1492
  uint32_t *ptr, *end;
1493
1493
  for (ptr= table->getBlobField(), end=ptr + table->sizeBlobFields();
1494
1494
       ptr != end ;
1495
1495
       ptr++)
1502
1502
 
1503
1503
ulong get_form_pos(File file, unsigned char *head, TYPELIB *save_names)
1504
1504
{
1505
 
  uint a_length,names,length;
 
1505
  uint32_t a_length,names,length;
1506
1506
  unsigned char *pos,*buf;
1507
1507
  ulong ret_value=0;
1508
1508
 
1577
1577
ulong make_new_entry(File file, unsigned char *fileinfo, TYPELIB *formnames,
1578
1578
                     const char *newname)
1579
1579
{
1580
 
  uint i,bufflength,maxlength,n_length,length,names;
 
1580
  uint32_t i,bufflength,maxlength,n_length,length,names;
1581
1581
  ulong endpos,newpos;
1582
1582
  unsigned char buff[IO_SIZE];
1583
1583
  unsigned char *pos;
1722
1722
        */
1723
1723
 
1724
1724
static void
1725
 
fix_type_pointers(const char ***array, TYPELIB *point_to_type, uint types,
 
1725
fix_type_pointers(const char ***array, TYPELIB *point_to_type, uint32_t types,
1726
1726
                  char **names)
1727
1727
{
1728
1728
  char *type_name, *ptr;
1762
1762
    return 0;
1763
1763
  result->count=strings.elements;
1764
1764
  result->name="";
1765
 
  uint nbytes= (sizeof(char*) + sizeof(uint)) * (result->count + 1);
 
1765
  uint32_t nbytes= (sizeof(char*) + sizeof(uint)) * (result->count + 1);
1766
1766
  if (!(result->type_names= (const char**) alloc_root(mem_root, nbytes)))
1767
1767
    return 0;
1768
1768
  result->type_lengths= (uint*) (result->type_names + result->count + 1);
1769
1769
  List_iterator<String> it(strings);
1770
1770
  String *tmp;
1771
 
  for (uint i=0; (tmp=it++) ; i++)
 
1771
  for (uint32_t i=0; (tmp=it++) ; i++)
1772
1772
  {
1773
1773
    result->type_names[i]= tmp->ptr();
1774
1774
    result->type_lengths[i]= tmp->length();
1792
1792
   #  field number +1
1793
1793
*/
1794
1794
 
1795
 
static uint find_field(Field **fields, unsigned char *record, uint start, uint length)
 
1795
static uint32_t find_field(Field **fields, unsigned char *record, uint32_t start, uint32_t length)
1796
1796
{
1797
1797
  Field **field;
1798
 
  uint i, pos;
 
1798
  uint32_t i, pos;
1799
1799
 
1800
1800
  pos= 0;
1801
1801
  for (field= fields, i=1 ; *field ; i++,field++)
1849
1849
    May fail with some multibyte charsets though.
1850
1850
*/
1851
1851
 
1852
 
void append_unescaped(String *res, const char *pos, uint length)
 
1852
void append_unescaped(String *res, const char *pos, uint32_t length)
1853
1853
{
1854
1854
  const char *end= pos+length;
1855
1855
  res->append('\'');
1857
1857
  for (; pos != end ; pos++)
1858
1858
  {
1859
1859
#if defined(USE_MB)
1860
 
    uint mblen;
 
1860
    uint32_t mblen;
1861
1861
    if (use_mb(default_charset_info) &&
1862
1862
        (mblen= my_ismbchar(default_charset_info, pos, end)))
1863
1863
    {
1900
1900
        /* Create a .frm file */
1901
1901
 
1902
1902
File create_frm(THD *thd, const char *name, const char *db,
1903
 
                const char *table, uint reclength, unsigned char *fileinfo,
1904
 
                HA_CREATE_INFO *create_info, uint keys, KEY *key_info)
 
1903
                const char *table, uint32_t reclength, unsigned char *fileinfo,
 
1904
                HA_CREATE_INFO *create_info, uint32_t keys, KEY *key_info)
1905
1905
{
1906
1906
  register File file;
1907
1907
  ulong length;
1908
1908
  unsigned char fill[IO_SIZE];
1909
1909
  int create_flags= O_RDWR | O_TRUNC;
1910
1910
  ulong key_comment_total_bytes= 0;
1911
 
  uint i;
 
1911
  uint32_t i;
1912
1912
 
1913
1913
  if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
1914
1914
    create_flags|= O_EXCL | O_NOFOLLOW;
1921
1921
 
1922
1922
  if ((file= my_create(name, CREATE_MODE, create_flags, MYF(0))) >= 0)
1923
1923
  {
1924
 
    uint key_length, tmp_key_length;
1925
 
    uint tmp;
 
1924
    uint32_t key_length, tmp_key_length;
 
1925
    uint32_t tmp;
1926
1926
    memset(fileinfo, 0, 64);
1927
1927
    /* header */
1928
1928
    fileinfo[0]=(unsigned char) 254;
2023
2023
 
2024
2024
void Table::setup_tmp_table_column_bitmaps(unsigned char *bitmaps)
2025
2025
{
2026
 
  uint field_count= s->fields;
 
2026
  uint32_t field_count= s->fields;
2027
2027
 
2028
2028
  bitmap_init(&this->def_read_set, (my_bitmap_map*) bitmaps, field_count, false);
2029
2029
  bitmap_init(&this->tmp_set, (my_bitmap_map*) (bitmaps+ bitmap_buffer_size(field_count)), field_count, false);
2080
2080
{
2081
2081
  char buff[MAX_FIELD_WIDTH], *to;
2082
2082
  String str(buff,sizeof(buff),&my_charset_bin);
2083
 
  uint length;
 
2083
  uint32_t length;
2084
2084
 
2085
2085
  field->val_str(&str);
2086
2086
  if (!(length= str.length()))
2112
2112
{
2113
2113
  char buff[MAX_FIELD_WIDTH], *to;
2114
2114
  String str(buff,sizeof(buff),&my_charset_bin);
2115
 
  uint length;
 
2115
  uint32_t length;
2116
2116
 
2117
2117
  field->val_str(&str);
2118
2118
  length= str.length();
2128
2128
    given a buffer with a key value, and a map of keyparts
2129
2129
    that are present in this value, returns the length of the value
2130
2130
*/
2131
 
uint calculate_key_len(Table *table, uint key,
 
2131
uint32_t calculate_key_len(Table *table, uint32_t key,
2132
2132
                       const unsigned char *buf __attribute__((unused)),
2133
2133
                       key_part_map keypart_map)
2134
2134
{
2138
2138
  KEY *key_info= table->s->key_info+key;
2139
2139
  KEY_PART_INFO *key_part= key_info->key_part;
2140
2140
  KEY_PART_INFO *end_key_part= key_part + key_info->key_parts;
2141
 
  uint length= 0;
 
2141
  uint32_t length= 0;
2142
2142
 
2143
2143
  while (key_part < end_key_part && keypart_map)
2144
2144
  {
2167
2167
bool check_db_name(LEX_STRING *org_name)
2168
2168
{
2169
2169
  char *name= org_name->str;
2170
 
  uint name_length= org_name->length;
 
2170
  uint32_t name_length= org_name->length;
2171
2171
 
2172
2172
  if (!name_length || name_length > NAME_LEN || name[name_length - 1] == ' ')
2173
2173
    return 1;
2186
2186
*/
2187
2187
 
2188
2188
 
2189
 
bool check_table_name(const char *name, uint length)
 
2189
bool check_table_name(const char *name, uint32_t length)
2190
2190
{
2191
2191
  if (!length || length > NAME_LEN || name[length - 1] == ' ')
2192
2192
    return 1;
2204
2204
*/
2205
2205
bool check_column_name(const char *name)
2206
2206
{
2207
 
  uint name_length= 0;  // name length in symbols
 
2207
  uint32_t name_length= 0;  // name length in symbols
2208
2208
  bool last_char_is_space= true;
2209
2209
  
2210
2210
  while (*name)
2260
2260
*/
2261
2261
 
2262
2262
bool
2263
 
Table::table_check_intact(const uint table_f_count,
 
2263
Table::table_check_intact(const uint32_t table_f_count,
2264
2264
                          const TABLE_FIELD_W_TYPE *table_def)
2265
2265
{
2266
 
  uint i;
 
2266
  uint32_t i;
2267
2267
  bool error= false;
2268
2268
  bool fields_diff_count;
2269
2269
 
2697
2697
    or Table::restore_column_maps_after_mark_index()
2698
2698
*/
2699
2699
 
2700
 
void Table::mark_columns_used_by_index(uint index)
 
2700
void Table::mark_columns_used_by_index(uint32_t index)
2701
2701
{
2702
2702
  MY_BITMAP *bitmap= &tmp_set;
2703
2703
 
2735
2735
  mark columns used by key, but don't reset other fields
2736
2736
*/
2737
2737
 
2738
 
void Table::mark_columns_used_by_index_no_reset(uint index,
 
2738
void Table::mark_columns_used_by_index_no_reset(uint32_t index,
2739
2739
                                                   MY_BITMAP *bitmap)
2740
2740
{
2741
2741
  KEY_PART_INFO *key_part= key_info[index].key_part;
3013
3013
    /* iterate over the hints list */
3014
3014
    while ((hint= iter++))
3015
3015
    {
3016
 
      uint pos;
 
3016
      uint32_t pos;
3017
3017
 
3018
3018
      /* process empty USE INDEX () */
3019
3019
      if (hint->type == INDEX_HINT_USE && !hint->key_name.str)
3106
3106
size_t Table::max_row_length(const unsigned char *data)
3107
3107
{
3108
3108
  size_t length= getRecordLength() + 2 * sizeFields();
3109
 
  uint *const beg= getBlobField();
3110
 
  uint *const end= beg + sizeBlobFields();
 
3109
  uint32_t *const beg= getBlobField();
 
3110
  uint32_t *const end= beg + sizeBlobFields();
3111
3111
 
3112
 
  for (uint *ptr= beg ; ptr != end ; ++ptr)
 
3112
  for (uint32_t *ptr= beg ; ptr != end ; ++ptr)
3113
3113
  {
3114
3114
    Field_blob* const blob= (Field_blob*) field[*ptr];
3115
3115
    length+= blob->get_length((const unsigned char*)
3194
3194
 
3195
3195
Field *create_tmp_field_from_field(THD *thd, Field *org_field,
3196
3196
                                   const char *name, Table *table,
3197
 
                                   Item_field *item, uint convert_blob_length)
 
3197
                                   Item_field *item, uint32_t convert_blob_length)
3198
3198
{
3199
3199
  Field *new_field;
3200
3200
 
3257
3257
static Field *create_tmp_field_from_item(THD *thd __attribute__((unused)),
3258
3258
                                         Item *item, Table *table,
3259
3259
                                         Item ***copy_func, bool modify_item,
3260
 
                                         uint convert_blob_length)
 
3260
                                         uint32_t convert_blob_length)
3261
3261
{
3262
3262
  bool maybe_null= item->maybe_null;
3263
3263
  Field *new_field;
3434
3434
                        bool group, bool modify_item,
3435
3435
                        bool table_cant_handle_bit_fields __attribute__((unused)),
3436
3436
                        bool make_copy_field,
3437
 
                        uint convert_blob_length)
 
3437
                        uint32_t convert_blob_length)
3438
3438
{
3439
3439
  Field *result;
3440
3440
  Item::Type orig_type= type;
3564
3564
  Table *table;
3565
3565
  TABLE_SHARE *share;
3566
3566
  uint  i,field_count,null_count,null_pack_length;
3567
 
  uint  copy_func_count= param->func_count;
3568
 
  uint  hidden_null_count, hidden_null_pack_length, hidden_field_count;
3569
 
  uint  blob_count,group_null_items, string_count;
3570
 
  uint  temp_pool_slot=MY_BIT_NONE;
3571
 
  uint fieldnr= 0;
 
3567
  uint32_t  copy_func_count= param->func_count;
 
3568
  uint32_t  hidden_null_count, hidden_null_pack_length, hidden_field_count;
 
3569
  uint32_t  blob_count,group_null_items, string_count;
 
3570
  uint32_t  temp_pool_slot=MY_BIT_NONE;
 
3571
  uint32_t fieldnr= 0;
3572
3572
  ulong reclength, string_total_length;
3573
3573
  bool  using_unique_constraint= 0;
3574
3574
  bool  use_packed_rows= 0;
3577
3577
  unsigned char *pos, *group_buff, *bitmaps;
3578
3578
  unsigned char *null_flags;
3579
3579
  Field **reg_field, **from_field, **default_field;
3580
 
  uint *blob_field;
 
3580
  uint32_t *blob_field;
3581
3581
  Copy_field *copy=0;
3582
3582
  KEY *keyinfo;
3583
3583
  KEY_PART_INFO *key_part_info;
3584
3584
  Item **copy_func;
3585
3585
  MI_COLUMNDEF *recinfo;
3586
 
  uint total_uneven_bit_length= 0;
 
3586
  uint32_t total_uneven_bit_length= 0;
3587
3587
  bool force_copy_fields= param->force_copy_fields;
3588
3588
 
3589
3589
  status_var_increment(thd->status_var.created_tmp_tables);
3915
3915
 
3916
3916
  share->reclength= reclength;
3917
3917
  {
3918
 
    uint alloc_length=ALIGN_SIZE(reclength+MI_UNIQUE_HASH_LENGTH+1);
 
3918
    uint32_t alloc_length=ALIGN_SIZE(reclength+MI_UNIQUE_HASH_LENGTH+1);
3919
3919
    share->rec_buff_length= alloc_length;
3920
3920
    if (!(table->record[0]= (unsigned char*)
3921
3921
                            alloc_root(&table->mem_root, alloc_length*3)))
3948
3948
  for (i=0,reg_field=table->field; i < field_count; i++,reg_field++,recinfo++)
3949
3949
  {
3950
3950
    Field *field= *reg_field;
3951
 
    uint length;
 
3951
    uint32_t length;
3952
3952
    memset(recinfo, 0, sizeof(*recinfo));
3953
3953
 
3954
3954
    if (!(field->flags & NOT_NULL_FLAG))
4251
4251
 
4252
4252
Table *create_virtual_tmp_table(THD *thd, List<Create_field> &field_list)
4253
4253
{
4254
 
  uint field_count= field_list.elements;
4255
 
  uint blob_count= 0;
 
4254
  uint32_t field_count= field_list.elements;
 
4255
  uint32_t blob_count= 0;
4256
4256
  Field **field;
4257
4257
  Create_field *cdef;                           /* column definition */
4258
 
  uint record_length= 0;
4259
 
  uint null_count= 0;                 /* number of columns which may be null */
4260
 
  uint null_pack_length;              /* NULL representation array length */
4261
 
  uint *blob_field;
 
4258
  uint32_t record_length= 0;
 
4259
  uint32_t null_count= 0;                 /* number of columns which may be null */
 
4260
  uint32_t null_pack_length;              /* NULL representation array length */
 
4261
  uint32_t *blob_field;
4262
4262
  unsigned char *bitmaps;
4263
4263
  Table *table;
4264
4264
  TABLE_SHARE *share;
4326
4326
    /* Set up field pointers */
4327
4327
    unsigned char *null_pos= table->record[0];
4328
4328
    unsigned char *field_pos= null_pos + share->null_bytes;
4329
 
    uint null_bit= 1;
 
4329
    uint32_t null_bit= 1;
4330
4330
 
4331
4331
    for (field= table->field; *field; ++field)
4332
4332
    {
4447
4447
      keydef.keysegs=  keyinfo->key_parts;
4448
4448
      keydef.seg= seg;
4449
4449
    }
4450
 
    for (uint i=0; i < keyinfo->key_parts ; i++,seg++)
 
4450
    for (uint32_t i=0; i < keyinfo->key_parts ; i++,seg++)
4451
4451
    {
4452
4452
      Field *field=keyinfo->key_part[i].field;
4453
4453
      seg->flag=     0;
4666
4666
  read_set->bitmap= old;
4667
4667
}
4668
4668
 
4669
 
uint Table::find_shortest_key(const key_map *usable_keys)
 
4669
uint32_t Table::find_shortest_key(const key_map *usable_keys)
4670
4670
{
4671
4671
  uint32_t min_length= UINT32_MAX;
4672
4672
  uint32_t best= MAX_KEY;
4673
4673
  if (!usable_keys->is_clear_all())
4674
4674
  {
4675
 
    for (uint nr=0; nr < s->keys ; nr++)
 
4675
    for (uint32_t nr=0; nr < s->keys ; nr++)
4676
4676
    {
4677
4677
      if (usable_keys->is_set(nr))
4678
4678
      {