~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to storage/myisam/sort.c

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
/*
17
17
  Creates a index for a database by reading keys, sorting them and outputing
18
 
  them in sorted order through SORT_INFO functions.
 
18
  them in sorted order through MI_SORT_INFO functions.
19
19
*/
20
20
 
21
21
#include "fulltext.h"
487
487
 
488
488
int thr_write_keys(MI_SORT_PARAM *sort_param)
489
489
{
490
 
  SORT_INFO *sort_info=sort_param->sort_info;
491
 
  MI_CHECK *param=sort_info->param;
 
490
  MI_SORT_INFO *sort_info=sort_param->sort_info;
 
491
  HA_CHECK *param=sort_info->param;
492
492
  ulong length, keys;
493
493
  ulong *rec_per_key_part=param->rec_per_key_part;
494
494
  int got_error=sort_info->got_error;
920
920
  for (buffpek= Fb ; buffpek <= Tb ; buffpek++)
921
921
  {
922
922
    count+= buffpek->count;
923
 
    buffpek->base= strpos;
 
923
    buffpek->base= (uchar*) strpos;
924
924
    buffpek->max_keys=maxcount;
925
925
    strpos+= (uint) (error=(int) info->read_to_buffer(from_file,buffpek,
926
926
                                                      sort_length));
958
958
      {
959
959
        if (!(error=(int) info->read_to_buffer(from_file,buffpek,sort_length)))
960
960
        {
961
 
          uchar *base=buffpek->base;
 
961
          uchar *base= buffpek->base;
962
962
          uint max_keys=buffpek->max_keys;
963
963
 
964
 
          VOID(queue_remove(&queue,0));
 
964
          (void) queue_remove(&queue,0);
965
965
 
966
966
          /* Put room used by buffer to use in other buffer */
967
967
          for (refpek= (BUFFPEK**) &queue_top(&queue);
990
990
    }
991
991
  }
992
992
  buffpek=(BUFFPEK*) queue_top(&queue);
993
 
  buffpek->base=(uchar *) sort_keys;
 
993
  buffpek->base= (uchar*) sort_keys;
994
994
  buffpek->max_keys=keys;
995
995
  do
996
996
  {
1005
1005
    else
1006
1006
    {
1007
1007
      register uchar *end;
1008
 
      strpos= buffpek->key;
 
1008
      strpos= (uchar*) buffpek->key;
1009
1009
      for (end=strpos+buffpek->mem_count*sort_length;
1010
1010
           strpos != end ;
1011
1011
           strpos+=sort_length)