Commit 25101100 authored by unknown's avatar unknown
Browse files

Merge istruewing@bk-internal.mysql.com:/home/bk/mysql-5.0-engines

into  blade08.mysql.com:/data0/istruewing/autopush/mysql-5.0-bug25289


sql/ha_myisam.cc:
  Auto merged
parents 6f47415f c7ce63fb
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -976,6 +976,22 @@ int ha_myisam::repair(THD *thd, MI_CHECK &param, bool do_optimize)
  ha_rows rows= file->state->records;
  DBUG_ENTER("ha_myisam::repair");

  /*
    Normally this method is entered with a properly opened table. If the
    repair fails, it can be repeated with more elaborate options. Under
    special circumstances it can happen that a repair fails so that it
    closed the data file and cannot re-open it. In this case file->dfile
    is set to -1. We must not try another repair without an open data
    file. (Bug #25289)
  */
  if (file->dfile == -1)
  {
    sql_print_information("Retrying repair of: '%s' failed. "
                          "Please try REPAIR EXTENDED or myisamchk",
                          table->s->path);
    DBUG_RETURN(HA_ADMIN_FAILED);
  }

  param.db_name=    table->s->db;
  param.table_name= table->alias;
  param.tmpfile_createflag = O_RDWR | O_TRUNC;