~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/ha_myisam.cc

  • Committer: Monty Taylor
  • Date: 2008-10-13 09:29:43 UTC
  • mfrom: (509 drizzle)
  • mto: (509.1.4 codestyle)
  • mto: This revision was merged to the branch mainline in revision 511.
  • Revision ID: monty@inaugust.com-20081013092943-rwvx4a6d85b5l2dh
MergedĀ inĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
 
17
 
#ifdef USE_PRAGMA_IMPLEMENTATION
18
 
#pragma implementation                          // gcc: Class implementation
19
 
#endif
20
17
 
21
18
#define DRIZZLE_SERVER 1
22
19
 
26
23
#include "ha_myisam.h"
27
24
#include "myisamdef.h"
28
25
#include <drizzled/drizzled_error_messages.h>
 
26
#include <drizzled/util/test.h>
29
27
 
30
28
ulong myisam_recover_options= HA_RECOVER_NONE;
31
29
 
625
623
  MYISAM_SHARE* share = file->s;
626
624
  const char *old_proc_info= thd->get_proc_info();
627
625
 
628
 
  thd_proc_info(thd, "Checking table");
 
626
  thd->set_proc_info("Checking table");
629
627
  myisamchk_init(&param);
630
628
  param.thd = thd;
631
629
  param.op_name =   "check";
699
697
    file->update |= HA_STATE_CHANGED | HA_STATE_ROW_CHANGED;
700
698
  }
701
699
 
702
 
  thd_proc_info(thd, old_proc_info);
 
700
  thd->set_proc_info(old_proc_info);
703
701
  return error ? HA_ADMIN_CORRUPT : HA_ADMIN_OK;
704
702
}
705
703
 
878
876
        char buf[40];
879
877
        /* TODO: respect myisam_repair_threads variable */
880
878
        snprintf(buf, 40, "Repair with %d threads", my_count_bits(key_map));
881
 
        thd_proc_info(thd, buf);
 
879
        thd->set_proc_info(buf);
882
880
        error = mi_repair_parallel(&param, file, fixed_name,
883
881
            param.testflag & T_QUICK);
884
 
        thd_proc_info(thd, "Repair done"); // to reset proc_info, as
 
882
        thd->set_proc_info("Repair done"); // to reset proc_info, as
885
883
                                      // it was pointing to local buffer
886
884
      }
887
885
      else
888
886
      {
889
 
        thd_proc_info(thd, "Repair by sorting");
 
887
        thd->set_proc_info("Repair by sorting");
890
888
        error = mi_repair_by_sort(&param, file, fixed_name,
891
889
            param.testflag & T_QUICK);
892
890
      }
893
891
    }
894
892
    else
895
893
    {
896
 
      thd_proc_info(thd, "Repair with keycache");
 
894
      thd->set_proc_info("Repair with keycache");
897
895
      param.testflag &= ~T_REP_BY_SORT;
898
896
      error=  mi_repair(&param, file, fixed_name,
899
897
                        param.testflag & T_QUICK);
907
905
        (share->state.changed & STATE_NOT_SORTED_PAGES))
908
906
    {
909
907
      optimize_done=1;
910
 
      thd_proc_info(thd, "Sorting index");
 
908
      thd->set_proc_info("Sorting index");
911
909
      error=mi_sort_index(&param,file,fixed_name);
912
910
    }
913
911
    if (!statistics_done && (local_testflag & T_STATISTICS))
915
913
      if (share->state.changed & STATE_NOT_ANALYZED)
916
914
      {
917
915
        optimize_done=1;
918
 
        thd_proc_info(thd, "Analyzing");
 
916
        thd->set_proc_info("Analyzing");
919
917
        error = chk_key(&param, file);
920
918
      }
921
919
      else
922
920
        local_testflag&= ~T_STATISTICS;         // Don't update statistics
923
921
    }
924
922
  }
925
 
  thd_proc_info(thd, "Saving state");
 
923
  thd->set_proc_info("Saving state");
926
924
  if (!error)
927
925
  {
928
926
    if ((share->state.changed & STATE_CHANGED) || mi_is_crashed(file))
960
958
    file->update |= HA_STATE_CHANGED | HA_STATE_ROW_CHANGED;
961
959
    update_state_info(&param, file, 0);
962
960
  }
963
 
  thd_proc_info(thd, old_proc_info);
 
961
  thd->set_proc_info(old_proc_info);
964
962
  if (!thd->locked_tables)
965
963
    mi_lock_database(file,F_UNLCK);
966
964
  return(error ? HA_ADMIN_FAILED :
1110
1108
    THD *thd=current_thd;
1111
1109
    MI_CHECK param;
1112
1110
    const char *save_proc_info= thd->get_proc_info();
1113
 
    thd_proc_info(thd, "Creating index");
 
1111
    thd->set_proc_info("Creating index");
1114
1112
    myisamchk_init(&param);
1115
1113
    param.op_name= "recreating_index";
1116
1114
    param.testflag= (T_SILENT | T_REP_BY_SORT | T_QUICK |
1135
1133
        thd->clear_error();
1136
1134
    }
1137
1135
    info(HA_STATUS_CONST);
1138
 
    thd_proc_info(thd, save_proc_info);
 
1136
    thd->set_proc_info(save_proc_info);
1139
1137
  }
1140
1138
  else
1141
1139
  {