~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/ha_myisam.cc

  • Committer: Monty Taylor
  • Date: 2009-01-05 22:31:09 UTC
  • mfrom: (755.2.2 drizzle-work)
  • mto: This revision was merged to the branch mainline in revision 759.
  • Revision ID: mordred@inaugust.com-20090105223109-fhqvb830ftho6r6i
MergedĀ fromĀ Mark.

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
 
76
76
  if (!session->vio_ok())
77
77
  {
78
 
    sql_print_error("%s",msgbuf);
 
78
    errmsg_printf(ERRMSG_LVL_ERROR, "%s",msgbuf);
79
79
    return;
80
80
  }
81
81
 
101
101
  protocol->store(msg_type, system_charset_info);
102
102
  protocol->store(msgbuf, msg_length, system_charset_info);
103
103
  if (protocol->write())
104
 
    sql_print_error("Failed on my_net_write, writing to stderr instead: %s\n",
 
104
    errmsg_printf(ERRMSG_LVL_ERROR, "Failed on my_net_write, writing to stderr instead: %s\n",
105
105
                    msgbuf);
106
106
  return;
107
107
}
452
452
  LIST *element;
453
453
  pthread_mutex_lock(&file->s->intern_lock);
454
454
  if ((cur_session= (Session*) file->in_use.data))
455
 
    sql_print_error(_("Got an error from thread_id=%"PRIu64", %s:%d"),
 
455
    errmsg_printf(ERRMSG_LVL_ERROR, _("Got an error from thread_id=%"PRIu64", %s:%d"),
456
456
                    cur_session->thread_id,
457
457
                    sfile, sline);
458
458
  else
459
 
    sql_print_error(_("Got an error from unknown thread, %s:%d"), sfile, sline);
 
459
    errmsg_printf(ERRMSG_LVL_ERROR, _("Got an error from unknown thread, %s:%d"), sfile, sline);
460
460
  if (message)
461
 
    sql_print_error("%s", message);
 
461
    errmsg_printf(ERRMSG_LVL_ERROR, "%s", message);
462
462
  for (element= file->s->in_use; element; element= list_rest(element))
463
463
  {
464
 
    sql_print_error("%s", _("Unknown thread accessing table"));
 
464
    errmsg_printf(ERRMSG_LVL_ERROR, "%s", _("Unknown thread accessing table"));
465
465
  }
466
466
  pthread_mutex_unlock(&file->s->intern_lock);
467
467
}
773
773
                      (uint) (T_RETRY_WITHOUT_QUICK | T_QUICK)))
774
774
    {
775
775
      param.testflag&= ~T_RETRY_WITHOUT_QUICK;
776
 
      sql_print_information("Retrying repair of: '%s' without quick",
 
776
      errmsg_printf(ERRMSG_LVL_INFO, "Retrying repair of: '%s' without quick",
777
777
                            table->s->path.str);
778
778
      continue;
779
779
    }
781
781
    if ((param.testflag & T_REP_BY_SORT))
782
782
    {
783
783
      param.testflag= (param.testflag & ~T_REP_BY_SORT) | T_REP;
784
 
      sql_print_information("Retrying repair of: '%s' with keycache",
 
784
      errmsg_printf(ERRMSG_LVL_INFO, "Retrying repair of: '%s' with keycache",
785
785
                            table->s->path.str);
786
786
      continue;
787
787
    }
791
791
      !(check_opt->flags & T_VERY_SILENT))
792
792
  {
793
793
    char llbuff[22],llbuff2[22];
794
 
    sql_print_information("Found %s of %s rows when repairing '%s'",
 
794
    errmsg_printf(ERRMSG_LVL_INFO, "Found %s of %s rows when repairing '%s'",
795
795
                          llstr(file->state->records, llbuff),
796
796
                          llstr(start_records, llbuff2),
797
797
                          table->s->path.str);
813
813
  param.sort_buffer_length=  check_opt->sort_buffer_size;
814
814
  if ((error= repair(session,param,1)) && param.retry_repair)
815
815
  {
816
 
    sql_print_warning("Warning: Optimize table got errno %d on %s.%s, retrying",
 
816
    errmsg_printf(ERRMSG_LVL_WARN, "Warning: Optimize table got errno %d on %s.%s, retrying",
817
817
                      my_errno, param.db_name, param.table_name);
818
818
    param.testflag&= ~T_REP_BY_SORT;
819
819
    error= repair(session,param,1);
842
842
  */
843
843
  if (file->dfile == -1)
844
844
  {
845
 
    sql_print_information("Retrying repair of: '%s' failed. "
 
845
    errmsg_printf(ERRMSG_LVL_INFO, "Retrying repair of: '%s' failed. "
846
846
                          "Please try REPAIR EXTENDED or myisamchk",
847
847
                          table->s->path.str);
848
848
    return(HA_ADMIN_FAILED);
1126
1126
    param.stats_method= (enum_mi_stats_method)session->variables.myisam_stats_method;
1127
1127
    if ((error= (repair(session,param,0) != HA_ADMIN_OK)) && param.retry_repair)
1128
1128
    {
1129
 
      sql_print_warning("Warning: Enabling keys got errno %d on %s.%s, retrying",
 
1129
      errmsg_printf(ERRMSG_LVL_WARN, "Warning: Enabling keys got errno %d on %s.%s, retrying",
1130
1130
                        my_errno, param.db_name, param.table_name);
1131
1131
      /* Repairing by sort failed. Now try standard repair method. */
1132
1132
      param.testflag&= ~(T_REP_BY_SORT | T_QUICK);
1254
1254
  // Don't use quick if deleted rows
1255
1255
  if (!file->state->del && (myisam_recover_options & HA_RECOVER_QUICK))
1256
1256
    check_opt.flags|=T_QUICK;
1257
 
  sql_print_warning("Checking table:   '%s'",table->s->path.str);
 
1257
  errmsg_printf(ERRMSG_LVL_WARN, "Checking table:   '%s'",table->s->path.str);
1258
1258
 
1259
1259
  old_query= session->query;
1260
1260
  old_query_length= session->query_length;
1265
1265
 
1266
1266
  if ((marked_crashed= mi_is_crashed(file)) || check(session, &check_opt))
1267
1267
  {
1268
 
    sql_print_warning("Recovering table: '%s'",table->s->path.str);
 
1268
    errmsg_printf(ERRMSG_LVL_WARN, "Recovering table: '%s'",table->s->path.str);
1269
1269
    check_opt.flags=
1270
1270
      ((myisam_recover_options & HA_RECOVER_BACKUP ? T_BACKUP_DATA : 0) |
1271
1271
       (marked_crashed                             ? 0 : T_QUICK) |