~mysql/mysql-server/mysql-6.0

« back to all changes in this revision

Viewing changes to mysys/mf_keycache.c

merge with 3.23

Show diffs side-by-side

added added

removed removed

Lines of Context:
595
595
          count++;
596
596
      }
597
597
      /* Only allocate a new buffer if its bigger than the one we have */
598
 
      if (count <= FLUSH_CACHE ||
599
 
          !(cache=(SEC_LINK**) my_malloc(sizeof(SEC_LINK*)*count,MYF(0))))
 
598
      if (count > FLUSH_CACHE)
600
599
      {
601
 
        cache=cache_buff;               /* Fall back to safe buffer */
602
 
        count=FLUSH_CACHE;
 
600
        if (!(cache=(SEC_LINK**) my_malloc(sizeof(SEC_LINK*)*count,MYF(0))))
 
601
        {
 
602
          cache=cache_buff;             /* Fall back to safe buffer */
 
603
          count=FLUSH_CACHE;
 
604
        }
603
605
      }
604
 
      end=cache+count;
605
606
    }
606
607
 
607
608
    /* Go through the keys and write them to buffer to be flushed */