~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/myisamchk.c

Merged in changes from Andrey.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#ifdef HAVE_SYS_MMAN_H
30
30
#include <sys/mman.h>
31
31
#endif
32
 
SET_STACK_SIZE(9000)                    /* Minimum stack size for program */
33
32
 
34
33
#define my_raid_create(A,B,C,D,E,F,G) my_create(A,B,C,G)
35
34
#define my_raid_delete(A,B,C) my_delete(A,B)
36
35
 
37
36
#include "myisamdef.h"
38
37
 
39
 
static uint decode_bits;
 
38
static uint32_t decode_bits;
40
39
static char **default_argv;
41
40
static const char *load_default_groups[]= { "myisamchk", 0 };
42
41
static const char *set_collation_name, *opt_tmpdir;
72
71
static int myisamchk(MI_CHECK *param, char *filename);
73
72
static void descript(MI_CHECK *param, register MI_INFO *info, char * name);
74
73
static int mi_sort_records(MI_CHECK *param, register MI_INFO *info,
75
 
                           char * name, uint sort_key,
 
74
                           char * name, uint32_t sort_key,
76
75
                           bool write_info, bool update_index);
77
76
static int sort_record_index(MI_SORT_PARAM *sort_param, MI_INFO *info,
78
77
                             MI_KEYDEF *keyinfo,
79
 
                             my_off_t page,uchar *buff,uint sortkey,
 
78
                             my_off_t page,unsigned char *buff,uint32_t sortkey,
80
79
                             File new_file, bool update_index);
81
80
 
82
81
MI_CHECK check_param;
100
99
    int new_error=myisamchk(&check_param, *(argv++));
101
100
    if ((check_param.testflag & T_REP_ANY) != T_REP)
102
101
      check_param.testflag&= ~T_REP;
103
 
    VOID(fflush(stdout));
104
 
    VOID(fflush(stderr));
 
102
    fflush(stdout);
 
103
    fflush(stderr);
105
104
    if ((check_param.error_printed | check_param.warning_printed) &&
106
105
        (check_param.testflag & T_FORCE_CREATE) &&
107
106
        (!(check_param.testflag & (T_REP | T_REP_BY_SORT | T_SORT_RECORDS |
108
107
                                   T_SORT_INDEX))))
109
108
    {
110
 
      uint old_testflag=check_param.testflag;
 
109
      uint32_t old_testflag=check_param.testflag;
111
110
      if (!(check_param.testflag & T_REP))
112
111
        check_param.testflag|= T_REP_BY_SORT;
113
112
      check_param.testflag&= ~T_EXTEND;                 /* Don't needed  */
114
113
      error|=myisamchk(&check_param, argv[-1]);
115
114
      check_param.testflag= old_testflag;
116
 
      VOID(fflush(stdout));
117
 
      VOID(fflush(stderr));
 
115
      fflush(stdout);
 
116
      fflush(stderr);
118
117
    }
119
118
    else
120
119
      error|=new_error;
121
120
    if (argc && (!(check_param.testflag & T_SILENT) || check_param.testflag & T_INFO))
122
121
    {
123
122
      puts("\n---------\n");
124
 
      VOID(fflush(stdout));
 
123
      fflush(stdout);
125
124
    }
126
125
  }
127
126
  if (check_param.total_files > 1)
440
439
}
441
440
 
442
441
const char *myisam_stats_method_names[] = {"nulls_unequal", "nulls_equal",
443
 
                                           "nulls_ignored", NullS};
 
442
                                           "nulls_ignored", NULL};
444
443
TYPELIB myisam_stats_method_typelib= {
445
444
  array_elements(myisam_stats_method_names) - 1, "",
446
445
  myisam_stats_method_names, NULL};
716
715
  if ((check_param.testflag & T_UNPACK) &&
717
716
      (check_param.testflag & (T_QUICK | T_SORT_RECORDS)))
718
717
  {
719
 
    VOID(fprintf(stderr,
720
 
                 "%s: --unpack can't be used with --quick or --sort-records\n",
721
 
                 my_progname_short));
 
718
    fprintf(stderr,
 
719
            "%s: --unpack can't be used with --quick or --sort-records\n",
 
720
            my_progname_short);
722
721
    exit(1);
723
722
  }
724
723
  if ((check_param.testflag & T_READONLY) &&
726
725
       (T_REP_ANY | T_STATISTICS | T_AUTO_INC |
727
726
        T_SORT_RECORDS | T_SORT_INDEX | T_FORCE_CREATE)))
728
727
  {
729
 
    VOID(fprintf(stderr,
730
 
                 "%s: Can't use --readonly when repairing or sorting\n",
731
 
                 my_progname_short));
 
728
    fprintf(stderr,
 
729
            "%s: Can't use --readonly when repairing or sorting\n",
 
730
            my_progname_short);
732
731
    exit(1);
733
732
  }
734
733
 
754
753
{
755
754
  int error,lock_type,recreate;
756
755
  int rep_quick= param->testflag & (T_QUICK | T_FORCE_UNIQUENESS);
757
 
  uint raid_chunks;
 
756
  uint32_t raid_chunks;
758
757
  MI_INFO *info;
759
758
  File datafile;
760
759
  char llbuff[22],llbuff2[22];
881
880
      param->language= set_collation->number;
882
881
    if (recreate_table(param, &info,filename))
883
882
    {
884
 
      VOID(fprintf(stderr,
885
 
                   "MyISAM-table '%s' is not fixed because of errors\n",
886
 
              filename));
 
883
      fprintf(stderr,
 
884
              "MyISAM-table '%s' is not fixed because of errors\n",
 
885
              filename);
887
886
      return(-1);
888
887
    }
889
888
    recreate=1;
974
973
      }
975
974
      if (!error && param->testflag & T_SORT_RECORDS)
976
975
      {
977
 
        uint key;
 
976
        uint32_t key;
978
977
        /*
979
978
          We can't update the index in mi_sort_records if we have a
980
979
          prefix compressed or fulltext index
1032
1031
          !(param->testflag & (T_FAST | T_FORCE_CREATE)))
1033
1032
      {
1034
1033
        if (param->testflag & (T_EXTEND | T_MEDIUM))
1035
 
          VOID(init_key_cache(dflt_key_cache,opt_key_cache_block_size,
1036
 
                              param->use_buffers, 0, 0));
1037
 
        VOID(init_io_cache(&param->read_cache,datafile,
1038
 
                           (uint) param->read_buffer_length,
1039
 
                           READ_CACHE,
1040
 
                           (param->start_check_pos ?
1041
 
                            param->start_check_pos :
1042
 
                            share->pack.header_length),
1043
 
                           1,
1044
 
                           MYF(MY_WME)));
 
1034
          init_key_cache(dflt_key_cache,opt_key_cache_block_size,
 
1035
                         param->use_buffers, 0, 0);
 
1036
        init_io_cache(&param->read_cache,datafile,
 
1037
                      (uint) param->read_buffer_length,
 
1038
                      READ_CACHE,
 
1039
                      (param->start_check_pos ?
 
1040
                       param->start_check_pos :
 
1041
                       share->pack.header_length),
 
1042
                      1,
 
1043
                      MYF(MY_WME));
1045
1044
        lock_memory(param);
1046
1045
        if ((info->s->options & (HA_OPTION_PACK_RECORD |
1047
1046
                                 HA_OPTION_COMPRESS_RECORD)) ||
1048
1047
            (param->testflag & (T_EXTEND | T_MEDIUM)))
1049
1048
          error|=chk_data_link(param, info, param->testflag & T_EXTEND);
1050
1049
        error|=flush_blocks(param, share->key_cache, share->kfile);
1051
 
        VOID(end_io_cache(&param->read_cache));
 
1050
        end_io_cache(&param->read_cache);
1052
1051
      }
1053
1052
      if (!error)
1054
1053
      {
1101
1100
      error|=change_to_newfile(filename,MI_NAME_IEXT,INDEX_TMP_EXT,0,
1102
1101
                               MYF(0));
1103
1102
  }
1104
 
  VOID(fflush(stdout)); VOID(fflush(stderr));
 
1103
  fflush(stdout); fflush(stderr);
1105
1104
  if (param->error_printed)
1106
1105
  {
1107
1106
    if (param->testflag & (T_REP_ANY | T_SORT_RECORDS | T_SORT_INDEX))
1108
1107
    {
1109
 
      VOID(fprintf(stderr,
1110
 
                   "MyISAM-table '%s' is not fixed because of errors\n",
1111
 
                   filename));
 
1108
      fprintf(stderr,
 
1109
              "MyISAM-table '%s' is not fixed because of errors\n",
 
1110
              filename);
1112
1111
      if (param->testflag & T_REP_ANY)
1113
 
        VOID(fprintf(stderr,
1114
 
                     "Try fixing it by using the --safe-recover (-o), the --force (-f) option or by not using the --quick (-q) flag\n"));
 
1112
        fprintf(stderr,
 
1113
                "Try fixing it by using the --safe-recover (-o), the --force (-f) option or by not using the --quick (-q) flag\n");
1115
1114
    }
1116
1115
    else if (!(param->error_printed & 2) &&
1117
1116
             !(param->testflag & T_FORCE_CREATE))
1118
 
      VOID(fprintf(stderr,
1119
 
      "MyISAM-table '%s' is corrupted\nFix it using switch \"-r\" or \"-o\"\n",
1120
 
              filename));
 
1117
      fprintf(stderr,
 
1118
              "MyISAM-table '%s' is corrupted\nFix it using switch \"-r\" or \"-o\"\n",
 
1119
              filename);
1121
1120
  }
1122
1121
  else if (param->warning_printed &&
1123
1122
           ! (param->testflag & (T_REP_ANY | T_SORT_RECORDS | T_SORT_INDEX |
1124
1123
                          T_FORCE_CREATE)))
1125
 
    VOID(fprintf(stderr, "MyISAM-table '%s' is usable but should be fixed\n",
1126
 
                 filename));
1127
 
  VOID(fflush(stderr));
 
1124
    fprintf(stderr, "MyISAM-table '%s' is usable but should be fixed\n",
 
1125
            filename);
 
1126
  fflush(stderr);
1128
1127
  return(error);
1129
1128
} /* myisamchk */
1130
1129
 
1133
1132
 
1134
1133
static void descript(MI_CHECK *param, register MI_INFO *info, char * name)
1135
1134
{
1136
 
  uint key,keyseg_nr,field,start;
 
1135
  uint32_t key,keyseg_nr,field,start;
1137
1136
  register MI_KEYDEF *keyinfo;
1138
1137
  register HA_KEYSEG *keyseg;
1139
1138
  register const char *text;
1170
1169
    }
1171
1170
    pos=buff;
1172
1171
    if (share->state.changed & STATE_CRASHED)
1173
 
      stpcpy(buff,"crashed");
 
1172
      my_stpcpy(buff,"crashed");
1174
1173
    else
1175
1174
    {
1176
1175
      if (share->state.open_count)
1177
 
        pos=stpcpy(pos,"open,");
 
1176
        pos=my_stpcpy(pos,"open,");
1178
1177
      if (share->state.changed & STATE_CHANGED)
1179
 
        pos=stpcpy(pos,"changed,");
 
1178
        pos=my_stpcpy(pos,"changed,");
1180
1179
      else
1181
 
        pos=stpcpy(pos,"checked,");
 
1180
        pos=my_stpcpy(pos,"checked,");
1182
1181
      if (!(share->state.changed & STATE_NOT_ANALYZED))
1183
 
        pos=stpcpy(pos,"analyzed,");
 
1182
        pos=my_stpcpy(pos,"analyzed,");
1184
1183
      if (!(share->state.changed & STATE_NOT_OPTIMIZED_KEYS))
1185
 
        pos=stpcpy(pos,"optimized keys,");
 
1184
        pos=my_stpcpy(pos,"optimized keys,");
1186
1185
      if (!(share->state.changed & STATE_NOT_SORTED_PAGES))
1187
 
        pos=stpcpy(pos,"sorted index pages,");
 
1186
        pos=my_stpcpy(pos,"sorted index pages,");
1188
1187
      pos[-1]=0;                                /* Remove extra ',' */
1189
1188
    }      
1190
1189
    printf("Status:              %s\n",buff);
1250
1249
  printf("Key Start Len Index   Type");
1251
1250
  if (param->testflag & T_VERBOSE)
1252
1251
    printf("                     Rec/key         Root  Blocksize");
1253
 
  VOID(putchar('\n'));
 
1252
  putchar('\n');
1254
1253
 
1255
1254
  for (key=keyseg_nr=0, keyinfo= &share->keyinfo[0] ;
1256
1255
       key < share->base.keys;
1263
1262
    pos=buff;
1264
1263
    if (keyseg->flag & HA_REVERSE_SORT)
1265
1264
      *pos++ = '-';
1266
 
    pos=stpcpy(pos,type_names[keyseg->type]);
 
1265
    pos=my_stpcpy(pos,type_names[keyseg->type]);
1267
1266
    *pos++ = ' ';
1268
1267
    *pos=0;
1269
1268
    if (keyinfo->flag & HA_PACK_KEY)
1270
 
      pos=stpcpy(pos,prefix_packed_txt);
 
1269
      pos=my_stpcpy(pos,prefix_packed_txt);
1271
1270
    if (keyinfo->flag & HA_BINARY_PACK_KEY)
1272
 
      pos=stpcpy(pos,bin_packed_txt);
 
1271
      pos=my_stpcpy(pos,bin_packed_txt);
1273
1272
    if (keyseg->flag & HA_SPACE_PACK)
1274
 
      pos=stpcpy(pos,diff_txt);
 
1273
      pos=my_stpcpy(pos,diff_txt);
1275
1274
    if (keyseg->flag & HA_BLOB_PART)
1276
 
      pos=stpcpy(pos,blob_txt);
 
1275
      pos=my_stpcpy(pos,blob_txt);
1277
1276
    if (keyseg->flag & HA_NULL_PART)
1278
 
      pos=stpcpy(pos,null_txt);
 
1277
      pos=my_stpcpy(pos,null_txt);
1279
1278
    *pos=0;
1280
1279
 
1281
1280
    printf("%-4d%-6ld%-3d %-8s%-21s",
1288
1287
      printf("%11lu %12s %10d",
1289
1288
             share->state.rec_per_key_part[keyseg_nr++],
1290
1289
             buff,keyinfo->block_length);
1291
 
    VOID(putchar('\n'));
 
1290
    putchar('\n');
1292
1291
    while ((++keyseg)->type != HA_KEYTYPE_END)
1293
1292
    {
1294
1293
      pos=buff;
1295
1294
      if (keyseg->flag & HA_REVERSE_SORT)
1296
1295
        *pos++ = '-';
1297
 
      pos=stpcpy(pos,type_names[keyseg->type]);
 
1296
      pos=my_stpcpy(pos,type_names[keyseg->type]);
1298
1297
      *pos++= ' ';
1299
1298
      if (keyseg->flag & HA_SPACE_PACK)
1300
 
        pos=stpcpy(pos,diff_txt);
 
1299
        pos=my_stpcpy(pos,diff_txt);
1301
1300
      if (keyseg->flag & HA_BLOB_PART)
1302
 
        pos=stpcpy(pos,blob_txt);
 
1301
        pos=my_stpcpy(pos,blob_txt);
1303
1302
      if (keyseg->flag & HA_NULL_PART)
1304
 
        pos=stpcpy(pos,null_txt);
 
1303
        pos=my_stpcpy(pos,null_txt);
1305
1304
      *pos=0;
1306
1305
      printf("    %-6ld%-3d         %-21s",
1307
1306
             (long) keyseg->start+1,keyseg->length,buff);
1308
1307
      if (param->testflag & T_VERBOSE)
1309
1308
        printf("%11lu", share->state.rec_per_key_part[keyseg_nr++]);
1310
 
      VOID(putchar('\n'));
 
1309
      putchar('\n');
1311
1310
    }
1312
1311
    keyseg++;
1313
1312
  }
1345
1344
    printf("\nField Start Length Nullpos Nullbit Type");
1346
1345
    if (share->options & HA_OPTION_COMPRESS_RECORD)
1347
1346
      printf("                         Huff tree  Bits");
1348
 
    VOID(putchar('\n'));
 
1347
    putchar('\n');
1349
1348
    start=1;
1350
1349
    for (field=0 ; field < share->base.fields ; field++)
1351
1350
    {
1353
1352
        type=share->rec[field].base_type;
1354
1353
      else
1355
1354
        type=(enum en_fieldtype) share->rec[field].type;
1356
 
      end=stpcpy(buff,field_pack[type]);
 
1355
      end=my_stpcpy(buff,field_pack[type]);
1357
1356
      if (share->options & HA_OPTION_COMPRESS_RECORD)
1358
1357
      {
1359
1358
        if (share->rec[field].pack_type & PACK_TYPE_SELECTED)
1360
 
          end=stpcpy(end,", not_always");
 
1359
          end=my_stpcpy(end,", not_always");
1361
1360
        if (share->rec[field].pack_type & PACK_TYPE_SPACE_FIELDS)
1362
 
          end=stpcpy(end,", no empty");
 
1361
          end=my_stpcpy(end,", no empty");
1363
1362
        if (share->rec[field].pack_type & PACK_TYPE_ZERO_FILL)
1364
1363
        {
1365
1364
          sprintf(end,", zerofill(%d)",share->rec[field].space_length_bits);
1367
1366
        }
1368
1367
      }
1369
1368
      if (buff[0] == ',')
1370
 
        stpcpy(buff,buff+2);
 
1369
        my_stpcpy(buff,buff+2);
1371
1370
      int10_to_str((long) share->rec[field].length,length,10);
1372
1371
      null_bit[0]=null_pos[0]=0;
1373
1372
      if (share->rec[field].null_bit)
1384
1383
                 (uint) (share->rec[field].huff_tree-share->decode_trees)+1,
1385
1384
                 share->rec[field].huff_tree->quick_table_bits);
1386
1385
      }
1387
 
      VOID(putchar('\n'));
 
1386
      putchar('\n');
1388
1387
      start+=share->rec[field].length;
1389
1388
    }
1390
1389
  }
1396
1395
 
1397
1396
static int mi_sort_records(MI_CHECK *param,
1398
1397
                           register MI_INFO *info, char * name,
1399
 
                           uint sort_key,
 
1398
                           uint32_t sort_key,
1400
1399
                           bool write_info,
1401
1400
                           bool update_index)
1402
1401
{
1403
1402
  int got_error;
1404
 
  uint key;
 
1403
  uint32_t key;
1405
1404
  MI_KEYDEF *keyinfo;
1406
1405
  File new_file;
1407
 
  uchar *temp_buff;
 
1406
  unsigned char *temp_buff;
1408
1407
  ha_rows old_record_count;
1409
1408
  MYISAM_SHARE *share=info->s;
1410
1409
  char llbuff[22],llbuff2[22];
1453
1452
    goto err;
1454
1453
  info->opt_flag|=WRITE_CACHE_USED;
1455
1454
 
1456
 
  if (!(temp_buff=(uchar*) my_alloca((uint) keyinfo->block_length)))
 
1455
  if (!(temp_buff=(unsigned char*) my_alloca((uint) keyinfo->block_length)))
1457
1456
  {
1458
1457
    mi_check_print_error(param,"Not enough memory for key block");
1459
1458
    goto err;
1489
1488
  for (key=0 ; key < share->base.keys ; key++)
1490
1489
    share->keyinfo[key].flag|= HA_SORT_ALLOWS_SAME;
1491
1490
 
1492
 
  if (my_pread(share->kfile,(uchar*) temp_buff,
 
1491
  if (my_pread(share->kfile,(unsigned char*) temp_buff,
1493
1492
               (uint) keyinfo->block_length,
1494
1493
               share->state.key_root[sort_key],
1495
1494
               MYF(MY_NABP+MY_WME)))
1524
1523
    goto err;
1525
1524
  }
1526
1525
 
1527
 
  VOID(my_close(info->dfile,MYF(MY_WME)));
 
1526
  my_close(info->dfile,MYF(MY_WME));
1528
1527
  param->out_flag|=O_NEW_DATA;                  /* Data in new file */
1529
1528
  info->dfile=new_file;                         /* Use new datafile */
1530
1529
  info->state->del=0;
1538
1537
 
1539
1538
  if (param->testflag & T_WRITE_LOOP)
1540
1539
  {
1541
 
    VOID(fputs("          \r",stdout)); VOID(fflush(stdout));
 
1540
    fputs("          \r",stdout); fflush(stdout);
1542
1541
  }
1543
1542
  got_error=0;
1544
1543
 
1545
1544
err:
1546
1545
  if (got_error && new_file >= 0)
1547
1546
  {
1548
 
    VOID(end_io_cache(&info->rec_cache));
 
1547
    end_io_cache(&info->rec_cache);
1549
1548
    (void) my_close(new_file,MYF(MY_WME));
1550
1549
    (void) my_raid_delete(param->temp_filename, share->base.raid_chunks,
1551
1550
                          MYF(MY_WME));
1552
1551
  }
1553
1552
  if (temp_buff)
1554
1553
  {
1555
 
    my_afree((uchar*) temp_buff);
 
1554
    my_afree((unsigned char*) temp_buff);
1556
1555
  }
1557
 
  my_free(mi_get_rec_buff_ptr(info, sort_param.record),
1558
 
          MYF(MY_ALLOW_ZERO_PTR));
 
1556
  void * rec_buff_ptr= mi_get_rec_buff_ptr(info, sort_param.record);
 
1557
  if (rec_buff_ptr != NULL)
 
1558
    free(rec_buff_ptr);
 
1559
 
1559
1560
  info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
1560
 
  VOID(end_io_cache(&info->rec_cache));
1561
 
  my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
 
1561
  end_io_cache(&info->rec_cache);
 
1562
  free(sort_info.buff);
1562
1563
  sort_info.buff=0;
1563
1564
  share->state.sortkey=sort_key;
1564
1565
  return(flush_blocks(param, share->key_cache, share->kfile) |
1570
1571
 
1571
1572
static int sort_record_index(MI_SORT_PARAM *sort_param,MI_INFO *info,
1572
1573
                             MI_KEYDEF *keyinfo,
1573
 
                             my_off_t page, uchar *buff, uint sort_key,
 
1574
                             my_off_t page, unsigned char *buff, uint32_t sort_key,
1574
1575
                             File new_file,bool update_index)
1575
1576
{
1576
1577
  uint  nod_flag,used_length,key_length;
1577
 
  uchar *temp_buff,*keypos,*endpos;
 
1578
  unsigned char *temp_buff,*keypos,*endpos;
1578
1579
  my_off_t next_page,rec_pos;
1579
 
  uchar lastkey[MI_MAX_KEY_BUFF];
 
1580
  unsigned char lastkey[MI_MAX_KEY_BUFF];
1580
1581
  char llbuff[22];
1581
1582
  SORT_INFO *sort_info= sort_param->sort_info;
1582
1583
  MI_CHECK *param=sort_info->param;
1586
1587
 
1587
1588
  if (nod_flag)
1588
1589
  {
1589
 
    if (!(temp_buff=(uchar*) my_alloca((uint) keyinfo->block_length)))
 
1590
    if (!(temp_buff=(unsigned char*) my_alloca((uint) keyinfo->block_length)))
1590
1591
    {
1591
1592
      mi_check_print_error(param,"Not Enough memory");
1592
1593
      return(-1);
1600
1601
    if (nod_flag)
1601
1602
    {
1602
1603
      next_page=_mi_kpos(nod_flag,keypos);
1603
 
      if (my_pread(info->s->kfile,(uchar*) temp_buff,
 
1604
      if (my_pread(info->s->kfile,(unsigned char*) temp_buff,
1604
1605
                  (uint) keyinfo->block_length, next_page,
1605
1606
                   MYF(MY_NABP+MY_WME)))
1606
1607
      {
1639
1640
  }
1640
1641
  /* Clear end of block to get better compression if the table is backuped */
1641
1642
  memset(buff+used_length, 0, keyinfo->block_length-used_length);
1642
 
  if (my_pwrite(info->s->kfile,(uchar*) buff,(uint) keyinfo->block_length,
 
1643
  if (my_pwrite(info->s->kfile,(unsigned char*) buff,(uint) keyinfo->block_length,
1643
1644
                page,param->myf_rw))
1644
1645
  {
1645
1646
    mi_check_print_error(param,"%d when updating keyblock",my_errno);
1646
1647
    goto err;
1647
1648
  }
1648
1649
  if (temp_buff)
1649
 
    my_afree((uchar*) temp_buff);
 
1650
    my_afree((unsigned char*) temp_buff);
1650
1651
  return(0);
1651
1652
err:
1652
1653
  if (temp_buff)
1653
 
    my_afree((uchar*) temp_buff);
 
1654
    my_afree((unsigned char*) temp_buff);
1654
1655
  return(1);
1655
1656
} /* sort_record_index */
1656
1657
 
1678
1679
  va_list args;
1679
1680
 
1680
1681
  va_start(args,fmt);
1681
 
  VOID(vfprintf(stdout, fmt, args));
1682
 
  VOID(fputc('\n',stdout));
 
1682
  vfprintf(stdout, fmt, args);
 
1683
  fputc('\n',stdout);
1683
1684
  va_end(args);
1684
1685
}
1685
1686
 
1700
1701
  param->warning_printed=1;
1701
1702
  va_start(args,fmt);
1702
1703
  fprintf(stderr,"%s: warning: ",my_progname_short);
1703
 
  VOID(vfprintf(stderr, fmt, args));
1704
 
  VOID(fputc('\n',stderr));
 
1704
  vfprintf(stderr, fmt, args);
 
1705
  fputc('\n',stderr);
1705
1706
  fflush(stderr);
1706
1707
  va_end(args);
1707
1708
  return;
1723
1724
  param->error_printed|=1;
1724
1725
  va_start(args,fmt);
1725
1726
  fprintf(stderr,"%s: error: ",my_progname_short);
1726
 
  VOID(vfprintf(stderr, fmt, args));
1727
 
  VOID(fputc('\n',stderr));
 
1727
  vfprintf(stderr, fmt, args);
 
1728
  fputc('\n',stderr);
1728
1729
  fflush(stderr);
1729
1730
  va_end(args);
1730
1731
  return;