~mordred/drizzle/fix-bell-bugs

« back to all changes in this revision

Viewing changes to plugin/heap/hp_write.cc

Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
  if ((share->records >= share->max_records && share->max_records) ||
39
39
    (share->recordspace.total_data_length + share->index_length >= share->max_table_size))
40
40
  {
41
 
    return(my_errno=HA_ERR_RECORD_FILE_FULL);
 
41
    return(errno=HA_ERR_RECORD_FILE_FULL);
42
42
  }
43
43
 
44
44
  rec_length = hp_get_encoded_data_length(share, record, &chunk_count);
45
45
 
46
46
  if (!(pos=hp_allocate_chunkset(&share->recordspace, chunk_count)))
47
 
    return(my_errno);
 
47
    return(errno);
48
48
  share->changed=1;
49
49
 
50
50
  for (keydef = share->keydef, end = keydef + share->keys; keydef < end;
74
74
    either.  Otherwise for HASH index on HA_ERR_FOUND_DUPP_KEY the key
75
75
    was inserted and we have to delete it.
76
76
  */
77
 
  if (keydef->algorithm == HA_KEY_ALG_BTREE || my_errno == ENOMEM)
 
77
  if (keydef->algorithm == HA_KEY_ALG_BTREE || errno == ENOMEM)
78
78
  {
79
79
    keydef--;
80
80
  }
87
87
 
88
88
  hp_free_chunks(&share->recordspace, pos);
89
89
 
90
 
  return(my_errno);
 
90
  return(errno);
91
91
} /* heap_write */
92
92
 
93
93
/*
116
116
  if (!tree_insert(&keyinfo->rb_tree, (void*)info->recbuf,
117
117
                   custom_arg.key_length, &custom_arg))
118
118
  {
119
 
    my_errno= HA_ERR_FOUND_DUPP_KEY;
 
119
    errno= HA_ERR_FOUND_DUPP_KEY;
120
120
    return 1;
121
121
  }
122
122
  info->s->index_length+= (keyinfo->rb_tree.allocated-old_allocated);
330
330
      {
331
331
        if (! hp_rec_key_cmp(keyinfo, record, pos->ptr_to_rec, 1))
332
332
        {
333
 
          return(my_errno=HA_ERR_FOUND_DUPP_KEY);
 
333
          return(errno=HA_ERR_FOUND_DUPP_KEY);
334
334
        }
335
335
      } while ((pos=pos->next_key));
336
336
    }