mirror of
https://github.com/MariaDB/server.git
synced 2026-05-05 22:55:32 +02:00
Complaint from a user who was getting sick of repairing their tables do to their lousy setup (their words). All crashed archive tables will now be repaired on open.
sql/ha_archive.cc: Fix for repair table.
This commit is contained in:
parent
8f395ebbfa
commit
6b2718d16f
1 changed files with 8 additions and 11 deletions
|
|
@ -477,7 +477,7 @@ const char **ha_archive::bas_ext() const
|
||||||
Init out lock.
|
Init out lock.
|
||||||
We open the file we will read from.
|
We open the file we will read from.
|
||||||
*/
|
*/
|
||||||
int ha_archive::open(const char *name, int mode, uint test_if_locked)
|
int ha_archive::open(const char *name, int mode, uint open_options)
|
||||||
{
|
{
|
||||||
DBUG_ENTER("ha_archive::open");
|
DBUG_ENTER("ha_archive::open");
|
||||||
|
|
||||||
|
|
@ -492,7 +492,10 @@ int ha_archive::open(const char *name, int mode, uint test_if_locked)
|
||||||
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
|
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
DBUG_RETURN(0);
|
if (open_options & HA_OPEN_FOR_REPAIR)
|
||||||
|
DBUG_RETURN(0);
|
||||||
|
|
||||||
|
DBUG_RETURN(share->crashed ? HA_ERR_CRASHED_ON_USAGE : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1067,7 +1070,8 @@ int ha_archive::delete_all_rows()
|
||||||
*/
|
*/
|
||||||
bool ha_archive::is_crashed() const
|
bool ha_archive::is_crashed() const
|
||||||
{
|
{
|
||||||
return share->crashed;
|
DBUG_ENTER("ha_archive::is_crashed");
|
||||||
|
DBUG_RETURN(share->crashed);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -1129,13 +1133,6 @@ bool ha_archive::check_and_repair(THD *thd)
|
||||||
|
|
||||||
check_opt.init();
|
check_opt.init();
|
||||||
|
|
||||||
if (check(thd, &check_opt) == HA_ADMIN_CORRUPT)
|
DBUG_RETURN(repair(thd, &check_opt));
|
||||||
{
|
|
||||||
DBUG_RETURN(repair(thd, &check_opt));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DBUG_RETURN(HA_ADMIN_OK);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif /* HAVE_ARCHIVE_DB */
|
#endif /* HAVE_ARCHIVE_DB */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue