~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysys/hash.c

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
           void (*free_element)(void*),uint flags CALLER_INFO_PROTO)
53
53
{
54
54
  DBUG_ENTER("hash_init");
55
 
  DBUG_PRINT("enter",("hash: 0x%lx  size: %u", (long) hash, (uint) size));
 
55
  DBUG_PRINT("enter",("hash: %p  size: %u", hash, (uint) size));
56
56
 
57
57
  hash->records=0;
58
58
  if (my_init_dynamic_array_ci(&hash->array, sizeof(HASH_LINK), size,
109
109
void hash_free(HASH *hash)
110
110
{
111
111
  DBUG_ENTER("hash_free");
112
 
  DBUG_PRINT("enter",("hash: 0x%lx", (long) hash));
 
112
  DBUG_PRINT("enter",("hash: %p", hash));
113
113
 
114
114
  hash_free_elements(hash);
115
115
  hash->free= 0;
129
129
void my_hash_reset(HASH *hash)
130
130
{
131
131
  DBUG_ENTER("my_hash_reset");
132
 
  DBUG_PRINT("enter",("hash: 0x%lxd", (long) hash));
 
132
  DBUG_PRINT("enter",("hash: %pd", hash));
133
133
 
134
134
  hash_free_elements(hash);
135
135
  reset_dynamic(&hash->array);
319
319
  LINT_INIT(ptr_to_rec);
320
320
  LINT_INIT(ptr_to_rec2);
321
321
 
322
 
  if (HASH_UNIQUE & info->flags)
 
322
  if (info->flags & HASH_UNIQUE)
323
323
  {
324
324
    uchar *key= (uchar*) hash_key(info, record, &idx, 1);
325
325
    if (hash_search(info, key, idx))
525
525
  pos->next=empty_index;
526
526
 
527
527
exit:
528
 
  VOID(pop_dynamic(&hash->array));
 
528
  (void) pop_dynamic(&hash->array);
529
529
  if (hash->free)
530
530
    (*hash->free)((uchar*) record);
531
531
  DBUG_RETURN(0);
690
690
        if ((rec_link=hash_rec_mask(hash,hash_info,blength,records)) != i)
691
691
        {
692
692
          DBUG_PRINT("error",
693
 
                     ("Record in wrong link at %d: Start %d  Record: 0x%lx  Record-link %d",
694
 
                      idx, i, (long) hash_info->data, rec_link));
 
693
                     ("Record in wrong link at %d: Start %d  Record: %p  Record-link %d",
 
694
                      idx, i, hash_info->data, rec_link));
695
695
          error=1;
696
696
        }
697
697
        else