~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_update.c

  • Committer: Monty Taylor
  • Date: 2008-07-16 19:10:24 UTC
  • mfrom: (51.1.127 remove-dbug)
  • mto: This revision was merged to the branch mainline in revision 176.
  • Revision ID: monty@inaugust.com-20080716191024-prjgoh7fbri7rx26
MergedĀ fromĀ remove-dbug.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
  uint64_t changed;
28
28
  MYISAM_SHARE *share= info->s;
29
29
  ha_checksum old_checksum= 0;
30
 
  DBUG_ENTER("mi_update");
31
30
 
32
 
  DBUG_EXECUTE_IF("myisam_pretend_crashed_table_on_usage",
33
 
                  mi_print_error(info->s, HA_ERR_CRASHED);
34
 
                  DBUG_RETURN(my_errno= HA_ERR_CRASHED););
35
31
  if (!(info->update & HA_STATE_AKTIV))
36
32
  {
37
 
    DBUG_RETURN(my_errno=HA_ERR_KEY_NOT_FOUND);
 
33
    return(my_errno=HA_ERR_KEY_NOT_FOUND);
38
34
  }
39
35
  if (share->options & HA_OPTION_READ_ONLY_DATA)
40
36
  {
41
 
    DBUG_RETURN(my_errno=EACCES);
 
37
    return(my_errno=EACCES);
42
38
  }
43
39
  if (info->state->key_file_length >= share->base.margin_key_file_length)
44
40
  {
45
 
    DBUG_RETURN(my_errno=HA_ERR_INDEX_FILE_FULL);
 
41
    return(my_errno=HA_ERR_INDEX_FILE_FULL);
46
42
  }
47
43
  pos=info->lastpos;
48
44
  if (_mi_readinfo(info,F_WRLCK,1))
49
 
    DBUG_RETURN(my_errno);
 
45
    return(my_errno);
50
46
 
51
47
  if (share->calc_checksum)
52
48
    old_checksum=info->checksum=(*share->calc_checksum)(info,oldrec);
161
157
  VOID(_mi_writeinfo(info, WRITEINFO_UPDATE_KEYFILE));
162
158
  if (info->invalidator != 0)
163
159
  {
164
 
    DBUG_PRINT("info", ("invalidator... '%s' (update)", info->filename));
165
160
    (*info->invalidator)(info->filename);
166
161
    info->invalidator=0;
167
162
  }
168
 
  DBUG_RETURN(0);
 
163
  return(0);
169
164
 
170
165
err:
171
 
  DBUG_PRINT("error",("key: %d  errno: %d",i,my_errno));
172
166
  save_errno=my_errno;
173
167
  if (changed)
174
168
    key_changed|= HA_STATE_CHANGED;
207
201
    mi_print_error(info->s, HA_ERR_CRASHED);
208
202
    save_errno=HA_ERR_CRASHED;
209
203
  }
210
 
  DBUG_RETURN(my_errno=save_errno);
 
204
  return(my_errno=save_errno);
211
205
} /* mi_update */