~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to storage/myisam/mi_page.c

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
                      my_off_t page, int level, uchar *buff)
66
66
{
67
67
  reg3 uint length;
 
68
  MYISAM_SHARE *share= info->s;
68
69
  DBUG_ENTER("_mi_write_keypage");
69
70
 
70
71
#ifndef FAST                                    /* Safety check */
71
 
  if (page < info->s->base.keystart ||
 
72
  if (page < share->base.keystart ||
72
73
      page+keyinfo->block_length > info->state->key_file_length ||
73
74
      (page & (MI_MIN_KEY_BLOCK_LENGTH-1)))
74
75
  {
75
76
    DBUG_PRINT("error",("Trying to write inside key status region: key_start: %lu  length: %lu  page: %lu",
76
 
                        (long) info->s->base.keystart,
 
77
                        (long) share->base.keystart,
77
78
                        (long) info->state->key_file_length,
78
79
                        (long) page));
79
80
    my_errno=EINVAL;
93
94
    length=keyinfo->block_length;
94
95
  }
95
96
#endif
96
 
  DBUG_RETURN((key_cache_write(info->s->key_cache,
97
 
                         info->s->kfile,page, level, (uchar*) buff,length,
98
 
                         (uint) keyinfo->block_length,
99
 
                         (int) ((info->lock_type != F_UNLCK) ||
100
 
                                info->s->delay_key_write))));
 
97
  DBUG_RETURN(key_cache_write(share->key_cache,
 
98
                              share->kfile, page, level, (uchar*)buff, length,
 
99
                              (uint) keyinfo->block_length,
 
100
                              (int) ((info->lock_type != F_UNLCK) ||
 
101
                                     share->delay_key_write), share));
101
102
} /* mi_write_keypage */
102
103
 
103
104
 
108
109
{
109
110
  my_off_t old_link;
110
111
  uchar buff[8];
 
112
  MYISAM_SHARE *share= info->s;
111
113
  DBUG_ENTER("_mi_dispose");
112
114
  DBUG_PRINT("enter",("pos: %ld", (long) pos));
113
115
 
114
 
  old_link= info->s->state.key_del[keyinfo->block_size_index];
115
 
  info->s->state.key_del[keyinfo->block_size_index]= pos;
 
116
  old_link= share->state.key_del[keyinfo->block_size_index];
 
117
  share->state.key_del[keyinfo->block_size_index]= pos;
116
118
  mi_sizestore(buff,old_link);
117
 
  info->s->state.changed|= STATE_NOT_SORTED_PAGES;
118
 
  DBUG_RETURN(key_cache_write(info->s->key_cache,
119
 
                              info->s->kfile, pos , level, buff,
120
 
                              sizeof(buff),
121
 
                              (uint) keyinfo->block_length,
122
 
                              (int) (info->lock_type != F_UNLCK)));
 
119
  share->state.changed|= STATE_NOT_SORTED_PAGES;
 
120
  DBUG_RETURN(key_cache_write(share->key_cache,
 
121
                              share->kfile, pos, level, buff,
 
122
                              sizeof(buff),
 
123
                              (uint) keyinfo->block_length,
 
124
                              (int) (info->lock_type != F_UNLCK), share));
123
125
} /* _mi_dispose */
124
126
 
125
127