Commit 117d8b7f authored by monty@donna.mysql.com's avatar monty@donna.mysql.com
Browse files

Automatic repair of MyISAM tables + small bug fixes

parent 42297969
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -1807,6 +1807,13 @@ is as tested as the other table types.
This only affects the new code that checks if the table was closed properly
on open and executes an automatic check/repair of the table if it wasn't.
@item MERGE tables -- Alpha / Beta
The usage of keys on @code{MERGE} tables is still not that tested.  The
other part of the @code{MERGE} code is quite well tested.
@item FULLTEXT -- Alpha / Beta
Text search seams to work, but is still not widely used.
@end table
MySQL AB provides e-mail support for paying customers, but the @strong{MySQL}
@@ -21903,6 +21910,9 @@ properly locked if one another thread issues a table lock.
@item
Internal locking in @code{BDB} tables are done on page level.
@item
@code{SELECT COUNT(*) FROM table_name} is slow as @code{BDB} tables doesn't
maintain a count of the number of rows in the table.
@item
Scanning is slower than with @code{MyISAM} tables as one has data in BDB
tables is stored in B-trees and not in a separate data file.
@item
@@ -37017,7 +37027,7 @@ This listing.
Perl @code{Data-Dumper} module.  Useful with @code{DBI}/@code{DBD} support for
older perl installations.
@item @uref{http://www.mysql.com/Downloads/Contrib/DBI-1.13.tar.gz, DBI-1.13.tar.gz}
@item @uref{http://www.mysql.com/Downloads/Contrib/DBI-1.14.tar.gz, DBI-1.14.tar.gz}
Perl @code{DBI} module.
@item @uref{http://www.mysql.com/Downloads/Contrib/KAMXbase1.0.tar.gz,KAMXbase1.0.tar.gz}
@@ -37026,7 +37036,7 @@ module written by Pratap Pereira @email{pereira@@ee.eng.ohio-state.edu},
extened by Kevin A. McGrail @email{kmcgrail@@digital1.peregrinehw.com}.
This converter can handle MEMO fields.
@item @uref{http://www.mysql.com/Downloads/Contrib/Msql-Mysql-modules-1.2214.tar.gz, Msql-Mysql-modules-1.2214.tar.gz}
@item @uref{http://www.mysql.com/Downloads/Contrib/Msql-Mysql-modules-1.2215.tar.gz, Msql-Mysql-modules-1.2215.tar.gz}
Perl @code{DBD} module to access mSQL and @strong{MySQL} databases..
@item @uref{http://www.mysql.com/Downloads/Contrib/Data-ShowTable-3.3.tar.gz,  Data-ShowTable-3.3.tar.gz}
@@ -37983,6 +37993,12 @@ though, so 3.23 is not released as a stable version yet.
@appendixsubsec Changes in release 3.23.26
@itemize @bullet
@item
Fixed problem with @code{SUBSTRING_INDEX()} and @code{REPLACE()}.
(Patch by Alexander Igonitchev)
@item
@code{CREATE TEMPORARY TABLE IF NOT EXISTS} doesn't anymore give an error
if the table existed.
@item
If one don't create a @code{PRIMARY KEY} in a BDB table, a hidden
@code{PRIMARY KEY} will be created.
@item
+2 −4
Original line number Diff line number Diff line
@@ -30,16 +30,14 @@ noinst_HEADERS = global.h config-win.h \
			my_tree.h hash.h thr_alarm.h thr_lock.h \
			getopt.h t_ctype.h violite.h \
			mysql_version.h.in
EXTRA_DIST=		my_config.h

# mysql_version.h are generated
SUPERCLEANFILES =	mysql_version.h my_global.h
SUPERCLEANFILES =	mysql_version.h my_global.h my_config.h

# Some include files that may be moved and patched by configure
DISTCLEANFILES =	sched.h
CLEANFILES =		my_config.h

all-local:		my_global.h
all-local:		my_global.h my_config.h

# Since we include my_config.h it better exist from the beginning
link_sources:
+2 −2
Original line number Diff line number Diff line
@@ -57,8 +57,8 @@ struct timespec { /* For pthread_cond_timedwait() */

typedef int pthread_mutexattr_t;
#define win_pthread_self my_thread_var->pthread_self
#define pthread_handler_decl(A,B) unsigned __cdecl A(void *B)
typedef unsigned (__cdecl *pthread_handler)(void *);
#define pthread_handler_decl(A,B) void * __cdecl A(void *B)
typedef void * (__cdecl *pthread_handler)(void *);

void win_pthread_init(void);
int win_pthread_setspecific(void *A,void *B,uint length);
+5 −5
Original line number Diff line number Diff line
@@ -1174,7 +1174,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
      mi_check_print_info(param,"Duplicate key %2d for record at %10s against new record at %10s",
			  info->errkey+1,
			  llstr(sort_info->start_recpos,llbuff),
		 llstr(info->lastpos,llbuff2));
			  llstr(info->dupp_key_pos,llbuff2));
      if (param->testflag & T_VERBOSE)
      {
	VOID(_mi_make_key(info,(uint) info->errkey,info->lastkey,
+40 −38
Original line number Diff line number Diff line
@@ -101,6 +101,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
	  (kfile=my_open(name_buff,(open_mode=O_RDONLY) | O_SHARE,MYF(0))) < 0)
	goto err;
    }
    share->mode=open_mode;
    errpos=1;
    if (my_read(kfile,(char*) share->state.header.file_version,head_length,
		MYF(MY_NABP)))
@@ -343,28 +344,11 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
      lock_error=1;			/* Database unlocked */
    }

#ifdef USE_RAID
    if (share->base.raid_type)
    {
      if ((info.dfile=my_raid_open(fn_format(name_buff,name,"",MI_NAME_DEXT,
					     2+4),
				   mode | O_SHARE,
				   share->base.raid_type,
				   share->base.raid_chunks,
				   share->base.raid_chunksize,
				   MYF(MY_WME | MY_RAID))) < 0)
      goto err;
    }
    else
#endif
      if ((info.dfile=my_open(fn_format(name_buff,name,"",MI_NAME_DEXT,2+4),
			      mode | O_SHARE,
			      MYF(MY_WME))) < 0)
    if (mi_open_datafile(&info, share))
      goto err;
    errpos=5;

    share->kfile=kfile;
    share->mode=open_mode;
    share->this_process=(ulong) getpid();
    share->rnd= (int)	 share->this_process;	/* rnd-counter for splits */
#ifndef DBUG_OFF
@@ -433,27 +417,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
      my_errno=EACCES;				/* Can't open in write mode */
      goto err;
    }
#ifdef USE_RAID
    if (share->base.raid_type)
    {
      if ((info.dfile=my_raid_open(fn_format(name_buff,old_info->filename,"",
					     MI_NAME_DEXT, 2+4),
				   mode | O_SHARE,
				   share->base.raid_type,
				   share->base.raid_chunks,
				   share->base.raid_chunksize,
				   MYF(MY_WME | MY_RAID))) < 0)
      goto err;
    }
    else
#endif
      if ((info.dfile=my_open(fn_format(name_buff,old_info->filename,"",
					MI_NAME_DEXT,2+4),
			      mode | O_SHARE,MYF(MY_WME))) < 0)
	{
	  my_errno=errno;
    if (mi_open_datafile(&info, share))
      goto err;
	}
    errpos=5;
  }

@@ -1009,3 +974,40 @@ char *mi_recinfo_read(char *ptr, MI_COLUMNDEF *recinfo)
   recinfo->null_pos=mi_uint2korr(ptr); ptr +=2;
   return ptr;
}

/**************************************************************************
 ** Help functions for recover
 *************************************************************************/

int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share)
{
  char name_buff[FN_REFLEN];
  (void) fn_format(name_buff, share->filename,"",MI_NAME_DEXT, 2+4);

#ifdef USE_RAID
  if (share->base.raid_type)
  {
    if ((info->dfile=my_raid_open(name_buff,
				  share->mode | O_SHARE,
				  share->base.raid_type,
				  share->base.raid_chunks,
				  share->base.raid_chunksize,
				  MYF(MY_WME | MY_RAID))) < 0)
      return 1;
  }
  else
#endif
    if ((info->dfile=my_open(name_buff, share->mode | O_SHARE,
			     MYF(MY_WME))) < 0)
      return 1;
  return 0;
}


int mi_open_keyfile(MYISAM_SHARE *share)
{
  if ((share->kfile=my_open(share->filename, share->mode | O_SHARE,
			    MYF(MY_WME))) < 0)
    return 1;
  return 0;
}
Loading