summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authormonty@donna.mysql.com <>2000-11-21 03:43:34 +0200
committermonty@donna.mysql.com <>2000-11-21 03:43:34 +0200
commitb65dbb61143e7add58481dc4bc184c530a9a5582 (patch)
tree18fdf025bea7d918e304f45384902d822f68f2f6 /sql/sql_base.cc
parentb7d81c037904a6d5d9e4a8602b1c9d5406a23a20 (diff)
downloadmariadb-git-b65dbb61143e7add58481dc4bc184c530a9a5582.tar.gz
Fixed problem with auto-repair of MyISAM tables
Fixed bug in ISAM and MyISAM when updating from multiple-processes
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 4a5f5e582f3..3560fc42d49 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1162,25 +1162,26 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
HA_TRY_READ_ONLY),
READ_KEYINFO | COMPUTE_TYPES | EXTRA_RECORD,
ha_open_options | HA_OPEN_FOR_REPAIR,
- entry) ||
+ entry) || ! entry->file ||
(entry->file->is_crashed() && entry->file->check_and_repair(thd)))
{
/* Give right error message */
thd->net.last_error[0]=0;
thd->net.last_errno=0;
- entry->file->print_error(HA_ERR_CRASHED,MYF(0));
+ my_error(ER_NOT_KEYFILE, MYF(0), name, my_errno);
sql_print_error("Error: Couldn't repair table: %s.%s",db,name);
- closefrm(entry);
+ if (entry->file)
+ closefrm(entry);
error=1;
}
else
{
- thd->net.last_error[0]=0; // Clear error message
+ thd->net.last_error[0]=0; // Clear error message
thd->net.last_errno=0;
}
- unlock_table_name(thd,&table_list);
if (locked)
pthread_mutex_lock(&LOCK_open); // Get back original lock
+ unlock_table_name(thd,&table_list);
if (error)
goto err;
}