mariadb/extra/perror.c
unknown 7fe58c4f5b RIGHT JOIN, part of automatic repair of MyISAM tables, backup on repair,
reading from FIFO, fixes for FULLTEXT, @@IDENTITY


Docs/manual.texi:
  Update of RIGHT JOIN
client/mysql.cc:
  Faster HTML generation
extra/perror.c:
  Added MyISAM error messages
include/my_base.h:
  Update for automatic repair of MyISAM tables
include/my_sys.h:
  Backup files and FIFO
include/myisam.h:
  Automatic repair and backup files
include/mysqld_error.h:
  New error message
myisam/mi_check.c:
  Update for automatic repair of MyISAM tables
myisam/mi_locking.c:
  Fixed comment
myisam/mi_open.c:
  Update for automatic repair of MyISAM tables
myisam/myisamchk.c:
  Update for automatic repair of MyISAM tables
myisam/myisamdef.h:
  Update for automatic repair of MyISAM tables
mysys/mf_getdate.c:
  Added new parameter option for backup files
mysys/my_open.c:
  Added debug information
mysys/my_redel.c:
  Backup file handling
sql/ha_berkeley.cc:
  Updated interface
sql/ha_berkeley.h:
  Updated interface
sql/ha_heap.cc:
  Updated interface
sql/ha_heap.h:
  Updated interface
sql/ha_isam.cc:
  Updated interface
sql/ha_isam.h:
  Updated interface
sql/ha_isammrg.cc:
  Updated interface
sql/ha_isammrg.h:
  Updated interface
sql/ha_myisam.cc:
  Update for automatic repair of MyISAM tables
sql/ha_myisam.h:
  Updated interface
sql/ha_myisammrg.cc:
  Updated interface
sql/ha_myisammrg.h:
  Updated interface
sql/handler.h:
  Updated interface
sql/item.h:
  Added @@identity
sql/item_func.cc:
  Added @@identity
sql/lex.h:
  Added RIGHT JOIN
sql/mf_iocache.cc:
  Update for reading from FIFO
sql/mysqld.cc:
  Update for automatic repair of MyISAM tables
sql/share/czech/errmsg.sys:
  Added @@identity
sql/share/czech/errmsg.txt:
  Added @@identity
sql/share/danish/errmsg.sys:
  Added @@identity
sql/share/danish/errmsg.txt:
  Added @@identity
sql/share/dutch/errmsg.sys:
  Added @@identity
sql/share/dutch/errmsg.txt:
  Added @@identity
sql/share/english/errmsg.sys:
  Added @@identity
sql/share/english/errmsg.txt:
  Added @@identity
sql/share/estonian/errmsg.sys:
  Added @@identity
sql/share/estonian/errmsg.txt:
  Added @@identity
sql/share/french/errmsg.sys:
  Added @@identity
sql/share/french/errmsg.txt:
  Added @@identity
sql/share/german/errmsg.sys:
  Added @@identity
sql/share/german/errmsg.txt:
  Added @@identity
sql/share/greek/errmsg.sys:
  Added @@identity
sql/share/greek/errmsg.txt:
  Added @@identity
sql/share/hungarian/errmsg.sys:
  Added @@identity
sql/share/hungarian/errmsg.txt:
  Added @@identity
sql/share/italian/errmsg.sys:
  Added @@identity
sql/share/italian/errmsg.txt:
  Added @@identity
sql/share/japanese/errmsg.sys:
  Added @@identity
sql/share/japanese/errmsg.txt:
  Added @@identity
sql/share/korean/errmsg.sys:
  Added @@identity
sql/share/korean/errmsg.txt:
  Added @@identity
sql/share/norwegian-ny/errmsg.txt:
  Added @@identity
sql/share/norwegian/errmsg.txt:
  Added @@identity
sql/share/polish/errmsg.sys:
  Added @@identity
sql/share/polish/errmsg.txt:
  Added @@identity
sql/share/portuguese/errmsg.sys:
  Added @@identity
sql/share/portuguese/errmsg.txt:
  Added @@identity
sql/share/romanian/errmsg.txt:
  Added @@identity
sql/share/russian/errmsg.sys:
  Added @@identity
sql/share/russian/errmsg.txt:
  Added @@identity
sql/share/slovak/errmsg.sys:
  Added @@identity
sql/share/slovak/errmsg.txt:
  Added @@identity
sql/share/spanish/errmsg.sys:
  Added @@identity
sql/share/spanish/errmsg.txt:
  Added @@identity
sql/share/swedish/errmsg.OLD:
  Added @@identity
sql/share/swedish/errmsg.sys:
  Added @@identity
sql/share/swedish/errmsg.txt:
  Added @@identity
sql/sql_base.cc:
  Fix for RIGHT JOIN
sql/sql_db.cc:
  Update for automatic repair of MyISAM tables
sql/sql_load.cc:
  Added reading from FIFO
sql/sql_parse.cc:
  Fix for RIGHT JOIN
sql/sql_select.cc:
  Fix for RIGHT JOIN
sql/sql_table.cc:
  cleanup
sql/sql_yacc.yy:
  Added RIGHT JOIN
sql/table.cc:
  Fix handling of FULLTEXT index
sql/table.h:
  Added RIGHT JOIN
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
2000-09-26 00:33:25 +03:00

210 lines
5 KiB
C

/* 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.4"
#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'},
{"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=0,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 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"},
{ 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("Usage: %s [OPTIONS] [ERRORCODES]\n",my_progname);
printf("\n\
-?, --help Displays this help and exits.\n\
-I, --info Synonym for the above.");
#ifdef HAVE_SYS_ERRLIST
printf("\n\
-a, --all Print all the error messages and the number.");
#endif
printf("\n\
-v, --verbose Print info about various stages.\n\
-V, --version Displays version information and exits.\n");
}
static int get_options(int *argc,char ***argv)
{
int c,option_index;
while ((c=getopt_long(*argc,*argv,"avVI?",long_options,
&option_index)) != EOF)
{
switch (c) {
#ifdef HAVE_SYS_ERRLIST
case 'a':
print_all_codes=1;
break;
#endif
case 'v':
verbose=1;
break;
case 'V':
print_version();
exit(0);
break;
case 'I':
case '?':
usage();
exit(0);
break;
default:
fprintf(stderr,"%s: Illegal option character '%c'\n",
my_progname,opterr);
return(1);
break;
}
}
(*argc)-=optind;
(*argv)+=optind;
if (!*argc && !print_all_codes)
{
usage();
return 1;
}
return 0;
} /* get_options */
static const char *get_ha_error_msg(int code)
{
HA_ERRORS *ha_err_ptr;
for (ha_err_ptr=ha_errlist ; ha_err_ptr->errcode ;ha_err_ptr++)
if (ha_err_ptr->errcode == code)
return ha_err_ptr->msg;
return NullS;
}
int main(int argc,char *argv[])
{
int error,code,found;
const char *msg;
MY_INIT(argv[0]);
if (get_options(&argc,&argv))
exit(1);
error=0;
#ifdef HAVE_SYS_ERRLIST
if (print_all_codes)
{
HA_ERRORS *ha_err_ptr;
for (code=1 ; code < sys_nerr ; code++)
{
if (sys_errlist[code][0])
{ /* Skipp if no error-text */
printf("%3d = %s\n",code,sys_errlist[code]);
}
}
for (ha_err_ptr=ha_errlist ; ha_err_ptr->errcode ;ha_err_ptr++)
printf("%3d = %s\n",ha_err_ptr->errcode,ha_err_ptr->msg);
}
else
#endif
{
for ( ; argc-- > 0 ; argv++)
{
found=0;
code=atoi(*argv);
msg = strerror(code);
if (msg)
{
found=1;
if (verbose)
printf("%3d = %s\n",code,msg);
else
puts(msg);
}
if (!(msg=get_ha_error_msg(code)))
{
if (!found)
{
fprintf(stderr,"Illegal error code: %d\n",code);
error=1;
}
}
else
{
if (verbose)
printf("%3d = %s\n",code,msg);
else
puts(msg);
}
}
}
exit(error);
return error;
}