/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */
/* Return error-text for system error messages and nisam messages */
#define PERROR_VERSION "2.6"
#include <global.h>
#include <my_sys.h>
#include <m_string.h>
#include <errno.h>
#include <getopt.h>
static struct option long_options[] =
{
{"help", no_argument, 0, '?'},
{"info", no_argument, 0, 'I'},
{"all", no_argument, 0, 'a'},
{"silent", no_argument, 0, 's'},
{"verbose", no_argument, 0, 'v'},
{"version", no_argument, 0, 'V'},
{0, 0, 0, 0}
};
typedef struct ha_errors {
int errcode;
const char *msg;
} HA_ERRORS;
static int verbose=1,print_all_codes=0;
static HA_ERRORS ha_errlist[]=
{
{ 120,"Didn't find key on read or update" },
{ 121,"Duplicate key on write or update" },
{ 123,"Someone has changed the row since it was read; Update with is recoverable" },
{ 124,"Wrong index given to function" },
{ 126,"Index file is crashed / Wrong file format" },
{ 127,"Record-file is crashed" },
{ 131,"Command not supported by database" },
{ 132,"Old database file" },
{ 133,"No record read before update" },
{ 134,"Record was already deleted (or record file crashed)" },
{ 135,"No more room in record file" },
{ 136,"No more room in index file" },
{ 137,"No more records (read after end of file)" },
{ 138,"Unsupported extension used for table" },
{ 139,"Too big row (>= 16 M)"},
{ 140,"Wrong create options"},
{ 141,"Duplicate unique key or constraint on write or update"},
{ 142,"Unknown character set used"},
{ 143,"Conflicting table definition between MERGE and mapped table"},
{ 144,"Table is crashed and last repair failed"},
{ 145,"Table was marked as crashed and should be repaired"},
{ 0,NullS },
};
static void print_version(void)
{
printf("%s Ver %s, for %s (%s)\n",my_progname,PERROR_VERSION,
SYSTEM_TYPE,MACHINE_TYPE);
}
static void usage(void)
{
print_version();
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
printf("Print a description for a system error code or a error code from\na MyISAM/ISAM table handler\n");