Commit 85bbcfee authored by Davi Arnaut's avatar Davi Arnaut

WL#5498: Remove dead and unused source code

Remove the ancient and dead raid code. By now, even the server side
has been removed.
parent e83f1d37
......@@ -627,10 +627,6 @@ static COMMANDS commands[] = {
{ "QUARTER", 0, 0, 0, ""},
{ "QUERY", 0, 0, 0, ""},
{ "QUICK", 0, 0, 0, ""},
{ "RAID0", 0, 0, 0, ""},
{ "RAID_CHUNKS", 0, 0, 0, ""},
{ "RAID_CHUNKSIZE", 0, 0, 0, ""},
{ "RAID_TYPE", 0, 0, 0, ""},
{ "READ", 0, 0, 0, ""},
{ "READS", 0, 0, 0, ""},
{ "REAL", 0, 0, 0, ""},
......
......@@ -39,7 +39,6 @@
fill_buffer_retaining() is taken from gnu-grep and modified.
*/
#define DONT_USE_RAID
#include <my_global.h>
#include <m_ctype.h>
#include <my_sys.h>
......
......@@ -17,7 +17,6 @@
versions into symbolic names. By Sasha Pachev <sasha@mysql.com>
*/
#define DONT_USE_RAID
#include <my_global.h>
#include <m_ctype.h>
#include <my_sys.h>
......
......@@ -1125,22 +1125,6 @@ typedef long long intptr;
#define MY_ERRPTR ((void*)(intptr)1)
#ifdef USE_RAID
/*
The following is done with a if to not get problems with pre-processors
with late define evaluation
*/
#if SIZEOF_OFF_T == 4
#define SYSTEM_SIZEOF_OFF_T 4
#else
#define SYSTEM_SIZEOF_OFF_T 8
#endif
#undef SIZEOF_OFF_T
#define SIZEOF_OFF_T 8
#else
#define SYSTEM_SIZEOF_OFF_T SIZEOF_OFF_T
#endif /* USE_RAID */
#if defined(_WIN32)
typedef unsigned long long my_off_t;
typedef unsigned long long os_off_t;
......@@ -1699,8 +1683,6 @@ static inline double rint(double x)
#undef HAVE_SMEM /* No shared memory */
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
#define DONT_USE_RAID
#endif /* EMBEDDED_LIBRARY */
#endif /* my_global_h */
......@@ -30,7 +30,7 @@ extern "C" {
#include <malloc.h>
#endif
#undef my_read /* Can be predefined in raid.h */
#undef my_read
#undef my_write
#undef my_seek
#define my_read(a,b,c,d) my_quick_read(a,b,c,d)
......
......@@ -78,7 +78,7 @@ extern int my_errno; /* Last error in mysys */
#define MY_WAIT_IF_FULL 32 /* Wait and try again if disk full error */
#define MY_IGNORE_BADFD 32 /* my_sync: ignore 'bad descriptor' errors */
#define MY_SYNC_DIR 8192 /* my_create/delete/rename: sync directory */
#define MY_RAID 64 /* Support for RAID */
#define MY_UNUSED 64 /* Unused (was support for RAID) */
#define MY_FULL_IO 512 /* For my_read - loop intil I/O is complete */
#define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */
#define MY_LINK_WARNING 32 /* my_redel() gives warning if links */
......
......@@ -481,8 +481,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
const char * name, int rep_quick);
int change_to_newfile(const char * filename, const char * old_ext,
const char * new_ext, uint raid_chunks,
myf myflags);
const char * new_ext, myf myflags);
int lock_file(MI_CHECK *param, File file, my_off_t start, int lock_type,
const char *filetype, const char *filename);
void lock_memory(MI_CHECK *param);
......
......@@ -28,7 +28,5 @@
#undef HAVE_SMEM /* No shared memory */
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
#define DONT_USE_RAID
#endif /* EMBEDDED_LIBRARY */
#endif /* MYSQL_EMBED_INCLUDED */
......@@ -21,8 +21,8 @@
# This file is public domain and comes with NO WARRANTY of any kind
target = libmysqlclient.la
target_defs = -DMYSQL_CLIENT_NO_THREADS -DDONT_USE_RAID \
-DDISABLE_MYSQL_THREAD_H @LIB_EXTRA_CCFLAGS@
target_defs = -DMYSQL_CLIENT_NO_THREADS -DDISABLE_MYSQL_THREAD_H \
@LIB_EXTRA_CCFLAGS@
LIBS = @CLIENT_LIBS@
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
......
......@@ -21,8 +21,7 @@
# This file is public domain and comes with NO WARRANTY of any kind
target = libmysqlclient_r.la
target_defs = -DDISABLE_MYSQL_PRLOCK_H -DDONT_USE_RAID \
-DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@
target_defs = -DDISABLE_MYSQL_PRLOCK_H -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@
LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@
......
This diff is collapsed.
......@@ -173,7 +173,7 @@ type_long_blob longblob,
index(type_short)
) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" ENGINE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed CHARSET=latin1;
# Not tested above: RAID_# UNION INSERT_METHOD DATA DIRECTORY INDEX DIRECTORY
# Not tested above: UNION INSERT_METHOD DATA DIRECTORY INDEX DIRECTORY
show create table t1;
insert into t1 (type_timestamp) values ("2003-02-07 10:00:01");
select * from t1;
......
......@@ -47,7 +47,6 @@
write buffer to the read buffer before we start to reuse it.
*/
#define MAP_TO_USE_RAID
#include "mysys_priv.h"
#include <m_string.h>
#ifdef HAVE_AIOWAIT
......
......@@ -17,7 +17,6 @@
More functions to be used with IO_CACHE files
*/
#define MAP_TO_USE_RAID
#include "mysys_priv.h"
#include <m_string.h>
#include <stdarg.h>
......
......@@ -52,11 +52,6 @@
#endif
#include "rt_index.h"
#ifndef USE_RAID
#define my_raid_create(K, A, B, C, D, E, F, G) mysql_file_create(K, A, B, C, G)
#define my_raid_delete(K, A, B, C) mysql_file_delete(K, A, B)
#endif
/* Functions defined in this file */
static int check_k_link(MI_CHECK *param, MI_INFO *info,uint nr);
......@@ -1577,15 +1572,12 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
if (!rep_quick)
{
/* Get real path for data file */
if ((new_file= my_raid_create(mi_key_file_datatmp,
fn_format(param->temp_filename,
share->data_file_name, "",
DATA_TMP_EXT, 2+4),
0, param->tmpfile_createflag,
share->base.raid_type,
share->base.raid_chunks,
share->base.raid_chunksize,
MYF(0))) < 0)
if ((new_file= mysql_file_create(mi_key_file_datatmp,
fn_format(param->temp_filename,
share->data_file_name, "",
DATA_TMP_EXT, 2+4),
0, param->tmpfile_createflag,
MYF(0))) < 0)
{
mi_check_print_error(param,"Can't create new tempfile: '%s'",
param->temp_filename);
......@@ -1751,8 +1743,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
(size_t) info->s->mmaped_length);
info->s->file_map= NULL;
}
if (change_to_newfile(share->data_file_name,MI_NAME_DEXT,
DATA_TMP_EXT, share->base.raid_chunks,
if (change_to_newfile(share->data_file_name, MI_NAME_DEXT, DATA_TMP_EXT,
(param->testflag & T_BACKUP_DATA ?
MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
mi_open_datafile(info,share,name,-1))
......@@ -1767,9 +1758,8 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
if (new_file >= 0)
{
(void) mysql_file_close(new_file, MYF(0));
(void) my_raid_delete(mi_key_file_datatmp,
param->temp_filename, info->s->base.raid_chunks,
MYF(MY_WME));
(void) mysql_file_delete(mi_key_file_datatmp,
param->temp_filename, MYF(MY_WME));
info->rec_cache.file=-1; /* don't flush data to new_file, it's closed */
}
mi_mark_crashed_on_repair(info);
......@@ -2011,7 +2001,7 @@ int mi_sort_index(MI_CHECK *param, register MI_INFO *info, char * name)
(void) mysql_file_close(share->kfile, MYF(MY_WME));
share->kfile = -1;
(void) mysql_file_close(new_file, MYF(MY_WME));
if (change_to_newfile(share->index_file_name,MI_NAME_IEXT,INDEX_TMP_EXT,0,
if (change_to_newfile(share->index_file_name, MI_NAME_IEXT, INDEX_TMP_EXT,
MYF(0)) ||
mi_open_keyfile(share))
goto err2;
......@@ -2141,18 +2131,9 @@ static int sort_one_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
*/
int change_to_newfile(const char * filename, const char * old_ext,
const char * new_ext,
uint raid_chunks __attribute__((unused)),
myf MyFlags)
const char * new_ext, myf MyFlags)
{
char old_filename[FN_REFLEN],new_filename[FN_REFLEN];
#ifdef USE_RAID
if (raid_chunks)
return my_raid_redel(fn_format(old_filename,filename,"",old_ext,2+4),
fn_format(new_filename,filename,"",new_ext,2+4),
raid_chunks,
MYF(MY_WME | MY_LINK_WARNING | MyFlags));
#endif
/* Get real path to filename */
(void) fn_format(old_filename,filename,"",old_ext,2+4+32);
return my_redel(old_filename,
......@@ -2293,15 +2274,12 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
if (!rep_quick)
{
/* Get real path for data file */
if ((new_file= my_raid_create(mi_key_file_datatmp,
fn_format(param->temp_filename,
share->data_file_name, "",
DATA_TMP_EXT, 2+4),
0, param->tmpfile_createflag,
share->base.raid_type,
share->base.raid_chunks,
share->base.raid_chunksize,
MYF(0))) < 0)
if ((new_file= mysql_file_create(mi_key_file_datatmp,
fn_format(param->temp_filename,
share->data_file_name, "",
DATA_TMP_EXT, 2+4),
0, param->tmpfile_createflag,
MYF(0))) < 0)
{
mi_check_print_error(param,"Can't create new tempfile: '%s'",
param->temp_filename);
......@@ -2527,7 +2505,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
skr < share->base.reloc*share->base.min_pack_length)
skr=share->base.reloc*share->base.min_pack_length;
#endif
if (skr != sort_info.filelength && !info->s->base.raid_type)
if (skr != sort_info.filelength)
if (mysql_file_chsize(info->dfile, skr, 0, MYF(0)))
mi_check_print_warning(param,
"Can't change size of datafile, error: %d",
......@@ -2565,8 +2543,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
{
mysql_file_close(new_file, MYF(0));
info->dfile=new_file= -1;
if (change_to_newfile(share->data_file_name,MI_NAME_DEXT,
DATA_TMP_EXT, share->base.raid_chunks,
if (change_to_newfile(share->data_file_name,MI_NAME_DEXT, DATA_TMP_EXT,
(param->testflag & T_BACKUP_DATA ?
MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
mi_open_datafile(info,share,name,-1))
......@@ -2580,9 +2557,8 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
if (new_file >= 0)
{
(void) mysql_file_close(new_file, MYF(0));
(void) my_raid_delete(mi_key_file_datatmp,
param->temp_filename, share->base.raid_chunks,
MYF(MY_WME));
(void) mysql_file_delete(mi_key_file_datatmp,
param->temp_filename, MYF(MY_WME));
if (info->dfile == new_file) /* Retry with key cache */
if (unlikely(mi_open_datafile(info, share, name, -1)))
param->retry_repair= 0; /* Safety */
......@@ -2751,16 +2727,12 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
if (!rep_quick)
{
/* Get real path for data file */
if ((new_file= my_raid_create(mi_key_file_datatmp,
fn_format(param->temp_filename,
share->data_file_name, "",
DATA_TMP_EXT,
2+4),
0, param->tmpfile_createflag,
share->base.raid_type,
share->base.raid_chunks,
share->base.raid_chunksize,
MYF(0))) < 0)
if ((new_file= mysql_file_create(mi_key_file_datatmp,
fn_format(param->temp_filename,
share->data_file_name, "",
DATA_TMP_EXT, 2+4),
0, param->tmpfile_createflag,
MYF(0))) < 0)
{
mi_check_print_error(param,"Can't create new tempfile: '%s'",
param->temp_filename);
......@@ -3055,7 +3027,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
skr < share->base.reloc*share->base.min_pack_length)
skr=share->base.reloc*share->base.min_pack_length;
#endif
if (skr != sort_info.filelength && !info->s->base.raid_type)
if (skr != sort_info.filelength)
if (mysql_file_chsize(info->dfile, skr, 0, MYF(0)))
mi_check_print_warning(param,
"Can't change size of datafile, error: %d",
......@@ -3105,8 +3077,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
{
mysql_file_close(new_file, MYF(0));
info->dfile=new_file= -1;
if (change_to_newfile(share->data_file_name,MI_NAME_DEXT,
DATA_TMP_EXT, share->base.raid_chunks,
if (change_to_newfile(share->data_file_name, MI_NAME_DEXT, DATA_TMP_EXT,
(param->testflag & T_BACKUP_DATA ?
MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
mi_open_datafile(info,share,name,-1))
......@@ -3120,9 +3091,8 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
if (new_file >= 0)
{
(void) mysql_file_close(new_file, MYF(0));
(void) my_raid_delete(mi_key_file_datatmp,
param->temp_filename, share->base.raid_chunks,
MYF(MY_WME));
(void) mysql_file_delete(mi_key_file_datatmp,
param->temp_filename, MYF(MY_WME));
if (info->dfile == new_file) /* Retry with key cache */
if (unlikely(mi_open_datafile(info, share, name, -1)))
param->retry_repair= 0; /* Safety */
......
......@@ -549,11 +549,6 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
share.base.pack_bits=packed;
share.base.fields=fields;
share.base.pack_fields=packed;
#ifdef USE_RAID
share.base.raid_type=ci->raid_type;
share.base.raid_chunks=ci->raid_chunks;
share.base.raid_chunksize=ci->raid_chunksize;
#endif
/* max_data_file_length and max_key_file_length are recalculated on open */
if (options & HA_OPTION_TMP_TABLE)
......@@ -642,20 +637,6 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
if (!(flags & HA_DONT_TOUCH_DATA))
{
#ifdef USE_RAID
if (share.base.raid_type)
{
(void) fn_format(filename, name, "", MI_NAME_DEXT,
MY_UNPACK_FILENAME | MY_APPEND_EXT);
if ((dfile=my_raid_create(filename, 0, create_mode,
share.base.raid_type,
share.base.raid_chunks,
share.base.raid_chunksize,
MYF(MY_WME | MY_RAID))) < 0)
goto err;
}
else
#endif
{
if (ci->data_file_name)
{
......@@ -841,7 +822,6 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
(void) mysql_file_close(dfile, MYF(0));
/* fall through */
case 2:
/* QQ: Tnu should add a call to my_raid_delete() here */
if (! (flags & HA_DONT_TOUCH_DATA))
mysql_file_delete_with_symlink(mi_key_file_dfile,
fn_format(filename, name, "", MI_NAME_DEXT,
......
......@@ -22,40 +22,11 @@
int mi_delete_table(const char *name)
{
char from[FN_REFLEN];
#ifdef USE_RAID
uint raid_type=0,raid_chunks=0;
#endif
DBUG_ENTER("mi_delete_table");
#ifdef EXTRA_DEBUG
check_table_is_closed(name,"delete");
#endif
#ifdef USE_RAID
{
MI_INFO *info;
/*
When built with RAID support, we need to determine if this table
makes use of the raid feature. If yes, we need to remove all raid
chunks. This is done with my_raid_delete(). Unfortunately it is
necessary to open the table just to check this. We use
'open_for_repair' to be able to open even a crashed table. If even
this open fails, we assume no raid configuration for this table
and try to remove the normal data file only. This may however
leave the raid chunks behind.
*/
if (!(info= mi_open(name, O_RDONLY, HA_OPEN_FOR_REPAIR)))
raid_type= 0;
else
{
raid_type= info->s->base.raid_type;
raid_chunks= info->s->base.raid_chunks;
mi_close(info);
}
}
#ifdef EXTRA_DEBUG
check_table_is_closed(name,"delete");
#endif
#endif /* USE_RAID */
fn_format(from,name,"",MI_NAME_IEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT);
if (my_is_symlink(from) && (*myisam_test_invalid_symlink)(from))
......@@ -73,10 +44,6 @@ int mi_delete_table(const char *name)
DBUG_RETURN(my_errno);
}
fn_format(from,name,"",MI_NAME_DEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT);
#ifdef USE_RAID
if (raid_type)
DBUG_RETURN(my_raid_delete(from, raid_chunks, MYF(MY_WME)) ? my_errno : 0);
#endif
if (my_is_symlink(from) && (*myisam_test_invalid_symlink)(from))
{
/*
......
......@@ -259,25 +259,6 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
#if SIZEOF_OFF_T == 4
set_if_smaller(max_data_file_length, INT_MAX32);
set_if_smaller(max_key_file_length, INT_MAX32);
#endif
#if USE_RAID && SYSTEM_SIZEOF_OFF_T == 4
set_if_smaller(max_key_file_length, INT_MAX32);
if (!share->base.raid_type)
{
set_if_smaller(max_data_file_length, INT_MAX32);
}
else
{
set_if_smaller(max_data_file_length,
(ulonglong) share->base.raid_chunks << 31);
}
#elif !defined(USE_RAID)
if (share->base.raid_type)
{
DBUG_PRINT("error",("Table uses RAID but we don't have RAID support"));
my_errno=HA_ERR_UNSUPPORTED;
goto err;
}
#endif
share->base.max_data_file_length=(my_off_t) max_data_file_length;
share->base.max_key_file_length=(my_off_t) max_key_file_length;
......@@ -1036,10 +1017,7 @@ uint mi_base_info_write(File file, MI_BASE_INFO *base)
mi_int2store(ptr,base->max_key_length); ptr +=2;
mi_int2store(ptr,base->extra_alloc_bytes); ptr +=2;
*ptr++= base->extra_alloc_procent;
*ptr++= base->raid_type;
mi_int2store(ptr,base->raid_chunks); ptr +=2;
mi_int4store(ptr,base->raid_chunksize); ptr +=4;
bzero(ptr,6); ptr +=6; /* extra */
bzero(ptr,13); ptr +=13; /* extra */
return mysql_file_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0;
}
......@@ -1070,17 +1048,8 @@ uchar *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base)
base->max_key_length = mi_uint2korr(ptr); ptr +=2;
base->extra_alloc_bytes = mi_uint2korr(ptr); ptr +=2;
base->extra_alloc_procent = *ptr++;
base->raid_type= *ptr++;
base->raid_chunks= mi_uint2korr(ptr); ptr +=2;
base->raid_chunksize= mi_uint4korr(ptr); ptr +=4;
/* TO BE REMOVED: Fix for old RAID files */
if (base->raid_type == 0)
{
base->raid_chunks=0;
base->raid_chunksize=0;
}
ptr+=6;
ptr+=13;
return ptr;
}
......@@ -1223,7 +1192,7 @@ uchar *mi_recinfo_read(uchar *ptr, MI_COLUMNDEF *recinfo)
}
/**************************************************************************
Open data file with or without RAID
Open data file.
We can't use dup() here as the data file descriptors need to have different
active seek-positions.
......@@ -1251,20 +1220,8 @@ int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, const char *org_name,
data_name= real_data_name;
}
}
#ifdef USE_RAID
if (share->base.raid_type)
{
info->dfile=my_raid_open(data_name,
share->mode | O_SHARE,
share->base.raid_type,
share->base.raid_chunks,
share->base.raid_chunksize,
MYF(MY_WME | MY_RAID));
}
else
#endif
info->dfile= mysql_file_open(mi_key_file_dfile,
data_name, share->mode | O_SHARE, MYF(MY_WME));
info->dfile= mysql_file_open(mi_key_file_dfile,
data_name, share->mode | O_SHARE, MYF(MY_WME));
return info->dfile >= 0 ? 0 : 1;
}
......
......@@ -22,28 +22,12 @@
int mi_rename(const char *old_name, const char *new_name)
{
char from[FN_REFLEN],to[FN_REFLEN];
#ifdef USE_RAID
uint raid_type=0,raid_chunks=0;
#endif
DBUG_ENTER("mi_rename");
#ifdef EXTRA_DEBUG
check_table_is_closed(old_name,"rename old_table");
check_table_is_closed(new_name,"rename new table2");
#endif
#ifdef USE_RAID
{
MI_INFO *info;
if (!(info=mi_open(old_name, O_RDONLY, 0)))
DBUG_RETURN(my_errno);
raid_type = info->s->base.raid_type;
raid_chunks = info->s->base.raid_chunks;
mi_close(info);
}
#ifdef EXTRA_DEBUG
check_table_is_closed(old_name,"rename raidcheck");
#endif
#endif /* USE_RAID */
fn_format(from,old_name,"",MI_NAME_IEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT);
fn_format(to,new_name,"",MI_NAME_IEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT);
......@@ -51,11 +35,6 @@ int mi_rename(const char *old_name, const char *new_name)
DBUG_RETURN(my_errno);
fn_format(from,old_name,"",MI_NAME_DEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT);
fn_format(to,new_name,"",MI_NAME_DEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT);
#ifdef USE_RAID
if (raid_type)
DBUG_RETURN(my_raid_rename(from, to, raid_chunks, MYF(MY_WME)) ? my_errno :
0);
#endif
DBUG_RETURN(mysql_file_rename_with_symlink(mi_key_file_dfile,
from, to,
MYF(MY_WME)) ? my_errno : 0);
......
......@@ -29,11 +29,6 @@
#endif
SET_STACK_SIZE(9000) /* Minimum stack size for program */
#ifndef USE_RAID
#define my_raid_create(A,B,C,D,E,F,G) my_create(A,B,C,G)
#define my_raid_delete(A,B,C) my_delete(A,B)
#endif
static uint decode_bits;
static char **default_argv;
static const char *load_default_groups[]= { "myisamchk", 0 };
......@@ -782,7 +777,6 @@ static int myisamchk(MI_CHECK *param, char * filename)
{
int error,lock_type,recreate;
int rep_quick= param->testflag & (T_QUICK | T_FORCE_UNIQUENESS);
uint raid_chunks;
MI_INFO *info;
File datafile;
char llbuff[22],llbuff2[22];
......@@ -844,7 +838,6 @@ static int myisamchk(MI_CHECK *param, char * filename)
share->options&= ~HA_OPTION_READ_ONLY_DATA; /* We are modifing it */
share->tot_locks-= share->r_locks;
share->r_locks=0;
raid_chunks=share->base.raid_chunks;
/*
Skip the checking of the file if:
......@@ -1013,9 +1006,7 @@ static int myisamchk(MI_CHECK *param, char * filename)
if (param->out_flag & O_NEW_DATA)
{ /* Change temp file to org file */
(void) my_close(info->dfile,MYF(MY_WME)); /* Close new file */
error|=change_to_newfile(filename,MI_NAME_DEXT,DATA_TMP_EXT,
raid_chunks,
MYF(0));
error|=change_to_newfile(filename, MI_NAME_DEXT, DATA_TMP_EXT, MYF(0));
if (mi_open_datafile(info,info->s, NULL, -1))
error=1;
param->out_flag&= ~O_NEW_DATA; /* We are using new datafile */
......@@ -1146,12 +1137,10 @@ static int myisamchk(MI_CHECK *param, char * filename)
{
if (param->out_flag & O_NEW_DATA)
error|=change_to_newfile(filename,MI_NAME_DEXT,DATA_TMP_EXT,
raid_chunks,
((param->testflag & T_BACKUP_DATA) ?
MYF(MY_REDEL_MAKE_BACKUP) : MYF(0)));
if (param->out_flag & O_NEW_INDEX)
error|=change_to_newfile(filename,MI_NAME_IEXT,INDEX_TMP_EXT,0,
MYF(0));
error|=change_to_newfile(filename, MI_NAME_IEXT, INDEX_TMP_EXT, MYF(0));
}
(void) fflush(stdout); (void) fflush(stderr);
if (param->error_printed)
......@@ -1247,16 +1236,9 @@ static void descript(MI_CHECK *param, register MI_INFO *info, char * name)
share->base.auto_key,
llstr(share->state.auto_increment,llbuff));
}
if (share->base.raid_type)
{
printf("RAID: Type: %u Chunks: %u Chunksize: %lu\n",
share->base.raid_type,
share->base.raid_chunks,
share->base.raid_chunksize);
}
if (share->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD))
printf("Checksum: %23s\n",llstr(info->state->checksum,llbuff));
;
if (share->options & HA_OPTION_DELAY_KEY_WRITE)
printf("Keys are only flushed at close\n");
......@@ -1527,14 +1509,11 @@ static int mi_sort_records(MI_CHECK *param,
goto err;
}
fn_format(param->temp_filename,name,"", MI_NAME_DEXT,2+4+32);
new_file=my_raid_create(fn_format(param->temp_filename,
param->temp_filename,"",
DATA_TMP_EXT,2+4),
0,param->tmpfile_createflag,
share->base.raid_type,
share->base.raid_chunks,
share->base.raid_chunksize,
MYF(0));
new_file= my_create(fn_format(param->temp_filename,
param->temp_filename, "",
DATA_TMP_EXT, 2+4),
0, param->tmpfile_createflag,
MYF(0));
if (new_file < 0)
{
mi_check_print_error(param,"Can't create new tempfile: '%s'",
......@@ -1609,8 +1588,7 @@ static int mi_sort_records(MI_CHECK *param,
{
(void) end_io_cache(&info->rec_cache);
(void) my_close(new_file,MYF(MY_WME));
(void) my_raid_delete(param->temp_filename, share->base.raid_chunks,
MYF(MY_WME));
(void) my_delete(param->temp_filename, MYF(MY_WME));
}
if (temp_buff)
{
......
......@@ -26,8 +26,9 @@
#endif
#include <mysql/psi/mysql_file.h>
#if defined(my_write) && !defined(MAP_TO_USE_RAID)
#undef my_write /* undef map from my_nosys; We need test-if-disk full */
/* undef map from my_nosys; We need test-if-disk full */
#if defined(my_write)
#undef my_write
#endif
typedef struct st_mi_status_info
......@@ -130,9 +131,6 @@ typedef struct st_mi_base_info
/* Extra allocation when using dynamic record format */
uint extra_alloc_bytes;
uint extra_alloc_procent;
/* Info about raid */
uint raid_type,raid_chunks;
ulong raid_chunksize;
/* The following are from the header */
uint key_parts,all_key_parts;
} MI_BASE_INFO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment