~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_write.c

Merged in changes from Andrey.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
static HASH_INFO *hp_find_free_hash(HP_SHARE *info, HP_BLOCK *block,
29
29
                                     uint32_t records);
30
30
 
31
 
int heap_write(HP_INFO *info, const uchar *record)
 
31
int heap_write(HP_INFO *info, const unsigned char *record)
32
32
{
33
33
  HP_KEYDEF *keydef, *end;
34
 
  uchar *pos;
 
34
  unsigned char *pos;
35
35
  HP_SHARE *share=info->s;
36
 
  uint rec_length, chunk_count;
 
36
  uint32_t rec_length, chunk_count;
37
37
 
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))
94
94
  Write a key to rb_tree-index 
95
95
*/
96
96
 
97
 
int hp_rb_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, const uchar *record, 
98
 
                    uchar *recpos)
 
97
int hp_rb_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, const unsigned char *record, 
 
98
                    unsigned char *recpos)
99
99
{
100
100
  heap_rb_param custom_arg;
101
 
  uint old_allocated;
 
101
  uint32_t old_allocated;
102
102
 
103
103
  custom_arg.keyseg= keyinfo->seg;
104
104
  custom_arg.key_length= hp_rb_make_key(keyinfo, info->recbuf, record, recpos);
149
149
*/
150
150
 
151
151
int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo,
152
 
                 const uchar *record, uchar *recpos)
 
152
                 const unsigned char *record, unsigned char *recpos)
153
153
{
154
154
  HP_SHARE *share = info->s;
155
155
  int flag;
156
156
  uint32_t halfbuff,hashnr,first_index;
157
 
  uchar *ptr_to_rec= NULL,*ptr_to_rec2= NULL;
 
157
  unsigned char *ptr_to_rec= NULL,*ptr_to_rec2= NULL;
158
158
  HASH_INFO *empty, *gpos= NULL, *gpos2= NULL, *pos;
159
159
 
160
160
  flag=0;
343
343
static HASH_INFO *hp_find_free_hash(HP_SHARE *info,
344
344
                                     HP_BLOCK *block, uint32_t records)
345
345
{
346
 
  uint block_pos;
 
346
  uint32_t block_pos;
347
347
  size_t length;
348
348
 
349
349
  if (records < block->last_allocated)
355
355
    info->index_length+=length;
356
356
  }
357
357
  block->last_allocated=records+1;
358
 
  return((HASH_INFO*) ((uchar*) block->level_info[0].last_blocks+
 
358
  return((HASH_INFO*) ((unsigned char*) block->level_info[0].last_blocks+
359
359
                       block_pos*block->recbuffer));
360
360
}