summaryrefslogtreecommitdiff
path: root/myisam/myisamchk.c
diff options
context:
space:
mode:
authorunknown <monty@tik.mysql.com>2000-10-11 00:06:37 +0300
committerunknown <monty@tik.mysql.com>2000-10-11 00:06:37 +0300
commitda5366886f2c852cb05f8b9b31848d13a4816cad (patch)
treecf18eb0d045153270d68aec8884a4732e953e883 /myisam/myisamchk.c
parentdbde9337c201b7a53357d3904c7f0ac5b046ed85 (diff)
downloadmariadb-git-da5366886f2c852cb05f8b9b31848d13a4816cad.tar.gz
Automatic repair of MyISAM tables + portability fixes
Docs/manual.texi: Changes for 3.23 and change Ansi mode -> ANSI mode include/my_base.h: Automatic repair of MyISAM tables include/myisam.h: Automatic repair of MyISAM tables myisam/ft_update.c: Portability fix myisam/mi_check.c: Automatic repair of MyISAM tables myisam/mi_open.c: Automatic repair of MyISAM tables myisam/myisamchk.c: Allow one to combine check with --old-repair myisam/sort.c: Fix for usage of IO_CACHE mysys/charset.c: Portability fixes mysys/default.c: Added --defaults-extra-dir mysys/mf_tempfile.c: Portability fixes mysys/my_init.c: Remove compiler warning mysys/my_pread.c: Remove compiler warning sql-bench/server-cfg.sh: New benchmark tests sql-bench/test-insert.sh: New benchmark tests sql/ha_myisam.cc: Automatic repair of MyISAM tables sql/ha_myisam.h: Automatic repair of MyISAM tables sql/handler.h: Automatic repair of MyISAM tables sql/lock.cc: Add missing free sql/log_event.cc: Portability fixes sql/sql_base.cc: Automatic repair of MyISAM tables sql/sql_select.h: Remove compiler warning sql/sql_table.cc: Clean up intendent sql/sql_yacc.yy: New syntax for CHECK sql/table.cc: Automatic repair of MyISAM tables sql/table.h: Automatic repair of MyISAM tables BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'myisam/myisamchk.c')
-rw-r--r--myisam/myisamchk.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c
index c1d3e8873f1..7fad3349d37 100644
--- a/myisam/myisamchk.c
+++ b/myisam/myisamchk.c
@@ -92,7 +92,7 @@ int main(int argc, char **argv)
error=0;
while (--argc >= 0)
{
- error|= myisamchk(&check_param, *(argv++));
+ int new_error=myisamchk(&check_param, *(argv++));
VOID(fflush(stdout));
VOID(fflush(stderr));
if ((check_param.error_printed | check_param.warning_printed) &&
@@ -101,13 +101,16 @@ int main(int argc, char **argv)
T_SORT_INDEX))))
{
uint old_testflag=check_param.testflag;
- check_param.testflag|=T_REP;
+ if (!(check_param.testflag & T_REP))
+ check_param.testflag|= T_REP_BY_SORT;
check_param.testflag&= ~T_EXTEND; /* Don't needed */
error|=myisamchk(&check_param, argv[-1]);
check_param.testflag= old_testflag;
VOID(fflush(stdout));
VOID(fflush(stderr));
}
+ else
+ error|=new_error;
if (argc && (!(check_param.testflag & T_SILENT) || check_param.testflag & T_INFO))
{
puts("\n---------\n");
@@ -193,7 +196,7 @@ static struct option long_options[] =
static void print_version(void)
{
- printf("%s Ver 1.32 for %s at %s\n",my_progname,SYSTEM_TYPE,
+ printf("%s Ver 1.34 for %s at %s\n",my_progname,SYSTEM_TYPE,
MACHINE_TYPE);
}
@@ -229,7 +232,7 @@ static void usage(void)
-f, --force Restart with -r if there are any errors in the table\n\
-i, --information Print statistics information about table that is checked\n\
-m, --medium-check Faster than extended-check, but only finds 99.99% of\n\
- all errors. Should however be good enough for most cases\n\
+ all errors. Should be good enough for most cases\n\
-U --update-state Mark tables as crashed if you find any errors\n\
-T, --read-only Don't mark table as checked\n");
@@ -488,10 +491,11 @@ static int myisamchk(MI_CHECK *param, my_string filename)
if (!(info=mi_open(filename,
(param->testflag & (T_DESCRIPT | T_READONLY)) ?
O_RDONLY : O_RDWR,
- (param->testflag & T_WAIT_FOREVER) ?
- HA_OPEN_WAIT_IF_LOCKED :
- (param->testflag & T_DESCRIPT) ?
- HA_OPEN_IGNORE_IF_LOCKED : HA_OPEN_ABORT_IF_LOCKED)))
+ HA_OPEN_FOR_REPAIR |
+ ((param->testflag & T_WAIT_FOREVER) ?
+ HA_OPEN_WAIT_IF_LOCKED :
+ (param->testflag & T_DESCRIPT) ?
+ HA_OPEN_IGNORE_IF_LOCKED : HA_OPEN_ABORT_IF_LOCKED))))
{
/* Avoid twice printing of isam file name */
param->error_printed=1;
@@ -748,8 +752,8 @@ static int myisamchk(MI_CHECK *param, my_string filename)
error =chk_size(param,info);
if (!error || !(param->testflag & (T_FAST | T_FORCE_CREATE)))
error|=chk_del(param, info,param->testflag);
- if ((!error || !(param->testflag & (T_FAST | T_FORCE_CREATE)) &&
- !param->start_check_pos))
+ if ((!error || (!(param->testflag & (T_FAST | T_FORCE_CREATE)) &&
+ !param->start_check_pos)))
{
error|=chk_key(param, info);
if (!error && (param->testflag & (T_STATISTICS | T_AUTO_INC)))