~eday/drizzle/eday-dev

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_delete.cc

  • Committer: Eric Day
  • Date: 2010-01-07 20:02:38 UTC
  • mfrom: (971.3.291 staging)
  • Revision ID: eday@oddments.org-20100107200238-uqw8v6kv9pl7nny5
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
/* Remove a row from a MyISAM table */
17
17
 
18
18
#include "myisam_priv.h"
19
 
#include <mystrings/m_string.h>
 
19
#include "drizzled/internal/m_string.h"
20
20
#include <drizzled/util/test.h>
21
21
 
22
22
static int d_search(MI_INFO *info,MI_KEYDEF *keyinfo,uint32_t comp_flag,
45
45
        /* Test if record is in datafile */
46
46
  if (!(info->update & HA_STATE_AKTIV))
47
47
  {
48
 
    return(my_errno=HA_ERR_KEY_NOT_FOUND);      /* No database read */
 
48
    return(errno=HA_ERR_KEY_NOT_FOUND); /* No database read */
49
49
  }
50
50
  if (share->options & HA_OPTION_READ_ONLY_DATA)
51
51
  {
52
 
    return(my_errno=EACCES);
 
52
    return(errno=EACCES);
53
53
  }
54
54
  if (_mi_readinfo(info,F_WRLCK,1))
55
 
    return(my_errno);
 
55
    return(errno);
56
56
  if (info->s->calc_checksum)
57
57
    info->checksum=(*info->s->calc_checksum)(info,record);
58
58
  if ((*share->compare_record)(info,record))
91
91
  return(0);
92
92
 
93
93
err:
94
 
  save_errno=my_errno;
 
94
  save_errno=errno;
95
95
  mi_sizestore(lastpos,info->lastpos);
96
96
  if (save_errno != HA_ERR_RECORD_CHANGED)
97
97
  {
100
100
  }
101
101
  _mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE);
102
102
  info->update|=HA_STATE_WRITTEN;       /* Buffer changed */
103
 
  my_errno=save_errno;
 
103
  errno=save_errno;
104
104
  if (save_errno == HA_ERR_KEY_NOT_FOUND)
105
105
  {
106
106
    mi_print_error(info->s, HA_ERR_CRASHED);
107
 
    my_errno=HA_ERR_CRASHED;
 
107
    errno=HA_ERR_CRASHED;
108
108
  }
109
109
 
110
 
  return(my_errno);
 
110
  return(errno);
111
111
} /* mi_delete */
112
112
 
113
113
 
132
132
  if ((old_root=*root) == HA_OFFSET_ERROR)
133
133
  {
134
134
    mi_print_error(info->s, HA_ERR_CRASHED);
135
 
    return(my_errno=HA_ERR_CRASHED);
 
135
    return(errno=HA_ERR_CRASHED);
136
136
  }
137
137
  if (!(root_buff= (unsigned char*) malloc(keyinfo->block_length+
138
138
                                      MI_MAX_KEY_BUFF*2)))
139
139
  {
140
 
    return(my_errno=ENOMEM);
 
140
    return(errno=ENOMEM);
141
141
  }
142
142
  if (!_mi_fetch_keypage(info,keyinfo,old_root,DFLT_INIT_HITS,root_buff,0))
143
143
  {
208
208
    if (!(leaf_buff= (unsigned char*) malloc(keyinfo->block_length+
209
209
                                        MI_MAX_KEY_BUFF*2)))
210
210
    {
211
 
      my_errno=ENOMEM;
 
211
      errno=ENOMEM;
212
212
      return(-1);
213
213
    }
214
214
    if (!_mi_fetch_keypage(info,keyinfo,leaf_page,DFLT_INIT_HITS,leaf_buff,0))
220
220
    if (!nod_flag)
221
221
    {
222
222
      mi_print_error(info->s, HA_ERR_CRASHED);
223
 
      my_errno=HA_ERR_CRASHED;          /* This should newer happend */
 
223
      errno=HA_ERR_CRASHED;             /* This should newer happend */
224
224
      goto err;
225
225
    }
226
226
    save_flag=0;