~mordred/drizzle/fix-bell-bugs

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_update.cc

Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
  if (!(info->update & HA_STATE_AKTIV))
33
33
  {
34
 
    return(my_errno=HA_ERR_KEY_NOT_FOUND);
 
34
    return(errno=HA_ERR_KEY_NOT_FOUND);
35
35
  }
36
36
  if (share->options & HA_OPTION_READ_ONLY_DATA)
37
37
  {
38
 
    return(my_errno=EACCES);
 
38
    return(errno=EACCES);
39
39
  }
40
40
  if (info->state->key_file_length >= share->base.margin_key_file_length)
41
41
  {
42
 
    return(my_errno=HA_ERR_INDEX_FILE_FULL);
 
42
    return(errno=HA_ERR_INDEX_FILE_FULL);
43
43
  }
44
44
  pos=info->lastpos;
45
45
  if (_mi_readinfo(info,F_WRLCK,1))
46
 
    return(my_errno);
 
46
    return(errno);
47
47
 
48
48
  if (share->calc_checksum)
49
49
    old_checksum=info->checksum=(*share->calc_checksum)(info,oldrec);
50
50
  if ((*share->compare_record)(info,oldrec))
51
51
  {
52
 
    save_errno=my_errno;
 
52
    save_errno=errno;
53
53
    goto err_end;                       /* Record has changed */
54
54
  }
55
55
 
63
63
        mi_check_unique(info, def, newrec, mi_unique_hash(def, newrec),
64
64
                        info->lastpos))
65
65
    {
66
 
      save_errno=my_errno;
 
66
      save_errno=errno;
67
67
      goto err_end;
68
68
    }
69
69
  }
70
70
  if (_mi_mark_file_changed(info))
71
71
  {
72
 
    save_errno=my_errno;
 
72
    save_errno=errno;
73
73
    goto err_end;
74
74
  }
75
75
 
158
158
  return(0);
159
159
 
160
160
err:
161
 
  save_errno=my_errno;
 
161
  save_errno=errno;
162
162
  if (changed)
163
163
    key_changed|= HA_STATE_CHANGED;
164
 
  if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_OUT_OF_MEM ||
165
 
      my_errno == HA_ERR_RECORD_FILE_FULL)
 
164
  if (errno == HA_ERR_FOUND_DUPP_KEY || errno == HA_ERR_OUT_OF_MEM ||
 
165
      errno == HA_ERR_RECORD_FILE_FULL)
166
166
  {
167
167
    info->errkey= (int) i;
168
168
    flag=0;
195
195
    mi_print_error(info->s, HA_ERR_CRASHED);
196
196
    save_errno=HA_ERR_CRASHED;
197
197
  }
198
 
  return(my_errno=save_errno);
 
198
  return(errno=save_errno);
199
199
} /* mi_update */