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
This commit is contained in:
unknown 2000-10-11 00:06:37 +03:00
commit da5366886f
27 changed files with 356 additions and 167 deletions

View file

@ -67,7 +67,7 @@ static char *name_from_csnum(CS_ID **cs, uint number)
for (c = cs; *c; ++c)
if ((*c)->number == number)
return (*c)->name;
return "?"; /* this mimics find_type() */
return (char*) "?"; /* this mimics find_type() */
}
static my_bool get_word(struct simpleconfig_buf_st *fb, char *buf)
@ -487,7 +487,7 @@ char * list_charsets(myf want_flags)
{
CS_ID **c;
char buf[FN_REFLEN];
MY_STAT stat;
MY_STAT status;
if((c=available_charsets))
for (; *c; ++c)
@ -495,7 +495,7 @@ char * list_charsets(myf want_flags)
if (charset_in_string((*c)->name, &s))
continue;
get_charset_conf_name((*c)->number, buf);
if (!my_stat(buf, &stat, MYF(0)))
if (!my_stat(buf, &status, MYF(0)))
continue; /* conf file doesn't exist */
dynstr_append(&s, (*c)->name);
dynstr_append(&s, " ");

View file

@ -148,7 +148,7 @@ void load_defaults(const char *conf_file, const char **groups,
#endif
for (dirs=default_directories ; *dirs; dirs++)
{
int error;
int error=0;
if (**dirs)
error=search_default_file(&args, &alloc, *dirs, conf_file,
default_ext, &group);
@ -359,7 +359,12 @@ void print_defaults(const char *conf_file, const char **groups)
#endif
for (dirs=default_directories ; *dirs; dirs++)
{
strmov(name,*dirs);
if (**dirs)
strmov(name,*dirs);
else if (defaults_extra_file)
strmov(name,defaults_extra_file);
else
continue;
convert_dirname(name);
if (name[0] == FN_HOMELIB) /* Add . to filenames in home */
strcat(name,".");
@ -377,6 +382,7 @@ void print_defaults(const char *conf_file, const char **groups)
puts("\nThe following options may be given as the first argument:\n\
--print-defaults Print the program argument list and exit\n\
--no-defaults Don't read default options from any options file\n\
--defaults-file=# Only read default options from the given file #");
--defaults-file=# Only read default options from the given file #\n\
--defaults-extra-file=# Read this file after the global files are read");
}

View file

@ -36,7 +36,8 @@ extern char **environ;
*/
File create_temp_file(char *to, const char *dir, const char *prefix,
int mode, myf MyFlags)
int mode __attribute__((unused)),
myf MyFlags __attribute__((unused)))
{
File file= -1;
DBUG_ENTER("open_temp_file");
@ -85,12 +86,12 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
}
#elif defined(HAVE_MKSTEMP)
{
char prefix[30];
char prefix_buff[30];
uint pfx_len;
pfx_len=(strmov(strnmov(prefix,
pfx_len=(strmov(strnmov(prefix_buff,
prefix ? prefix : "tmp.",
sizeof(prefix)-7),"XXXXXX") - prefix);
sizeof(prefix_buff)-7),"XXXXXX") - prefix_buff);
if (!dir && ! (dir =getenv("TMPDIR")))
dir=P_tmpdir;
if (strlen(dir)+ pfx_len > FN_REFLEN-2)

View file

@ -48,7 +48,7 @@ static my_bool win32_init_tcp_ip();
static my_bool my_init_done=0;
ulong atoi_octal(const char *str)
static ulong atoi_octal(const char *str)
{
long int tmp;
while (*str && isspace(*str))

View file

@ -80,7 +80,6 @@ uint my_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset,
uint my_pwrite(int Filedes, const byte *Buffer, uint Count, my_off_t offset,
myf MyFlags)
{
int error;
uint writenbytes,errors;
ulong written;
DBUG_ENTER("my_pwrite");
@ -91,6 +90,7 @@ uint my_pwrite(int Filedes, const byte *Buffer, uint Count, my_off_t offset,
for (;;)
{
#ifndef HAVE_PREAD
int error;
writenbytes= (uint) -1;
pthread_mutex_lock(&my_file_info[Filedes].mutex);
error=(lseek(Filedes, offset, MY_SEEK_SET) != -1L &&