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[] = { ...@@ -627,10 +627,6 @@ static COMMANDS commands[] = {
{ "QUARTER", 0, 0, 0, ""}, { "QUARTER", 0, 0, 0, ""},
{ "QUERY", 0, 0, 0, ""}, { "QUERY", 0, 0, 0, ""},
{ "QUICK", 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, ""}, { "READ", 0, 0, 0, ""},
{ "READS", 0, 0, 0, ""}, { "READS", 0, 0, 0, ""},
{ "REAL", 0, 0, 0, ""}, { "REAL", 0, 0, 0, ""},
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
fill_buffer_retaining() is taken from gnu-grep and modified. fill_buffer_retaining() is taken from gnu-grep and modified.
*/ */
#define DONT_USE_RAID
#include <my_global.h> #include <my_global.h>
#include <m_ctype.h> #include <m_ctype.h>
#include <my_sys.h> #include <my_sys.h>
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
versions into symbolic names. By Sasha Pachev <sasha@mysql.com> versions into symbolic names. By Sasha Pachev <sasha@mysql.com>
*/ */
#define DONT_USE_RAID
#include <my_global.h> #include <my_global.h>
#include <m_ctype.h> #include <m_ctype.h>
#include <my_sys.h> #include <my_sys.h>
......
...@@ -1125,22 +1125,6 @@ typedef long long intptr; ...@@ -1125,22 +1125,6 @@ typedef long long intptr;
#define MY_ERRPTR ((void*)(intptr)1) #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) #if defined(_WIN32)
typedef unsigned long long my_off_t; typedef unsigned long long my_off_t;
typedef unsigned long long os_off_t; typedef unsigned long long os_off_t;
...@@ -1699,8 +1683,6 @@ static inline double rint(double x) ...@@ -1699,8 +1683,6 @@ static inline double rint(double x)
#undef HAVE_SMEM /* No shared memory */ #undef HAVE_SMEM /* No shared memory */
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */ #undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
#define DONT_USE_RAID
#endif /* EMBEDDED_LIBRARY */ #endif /* EMBEDDED_LIBRARY */
#endif /* my_global_h */ #endif /* my_global_h */
...@@ -30,7 +30,7 @@ extern "C" { ...@@ -30,7 +30,7 @@ extern "C" {
#include <malloc.h> #include <malloc.h>
#endif #endif
#undef my_read /* Can be predefined in raid.h */ #undef my_read
#undef my_write #undef my_write
#undef my_seek #undef my_seek
#define my_read(a,b,c,d) my_quick_read(a,b,c,d) #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 */ ...@@ -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_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_IGNORE_BADFD 32 /* my_sync: ignore 'bad descriptor' errors */
#define MY_SYNC_DIR 8192 /* my_create/delete/rename: sync directory */ #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_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_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */
#define MY_LINK_WARNING 32 /* my_redel() gives warning if links */ #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, ...@@ -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, int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
const char * name, int rep_quick); const char * name, int rep_quick);
int change_to_newfile(const char * filename, const char * old_ext, int change_to_newfile(const char * filename, const char * old_ext,
const char * new_ext, uint raid_chunks, const char * new_ext, myf myflags);
myf myflags);
int lock_file(MI_CHECK *param, File file, my_off_t start, int lock_type, int lock_file(MI_CHECK *param, File file, my_off_t start, int lock_type,
const char *filetype, const char *filename); const char *filetype, const char *filename);
void lock_memory(MI_CHECK *param); void lock_memory(MI_CHECK *param);
......
...@@ -28,7 +28,5 @@ ...@@ -28,7 +28,5 @@
#undef HAVE_SMEM /* No shared memory */ #undef HAVE_SMEM /* No shared memory */
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */ #undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
#define DONT_USE_RAID
#endif /* EMBEDDED_LIBRARY */ #endif /* EMBEDDED_LIBRARY */
#endif /* MYSQL_EMBED_INCLUDED */ #endif /* MYSQL_EMBED_INCLUDED */
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
# This file is public domain and comes with NO WARRANTY of any kind # This file is public domain and comes with NO WARRANTY of any kind
target = libmysqlclient.la target = libmysqlclient.la
target_defs = -DMYSQL_CLIENT_NO_THREADS -DDONT_USE_RAID \ target_defs = -DMYSQL_CLIENT_NO_THREADS -DDISABLE_MYSQL_THREAD_H \
-DDISABLE_MYSQL_THREAD_H @LIB_EXTRA_CCFLAGS@ @LIB_EXTRA_CCFLAGS@
LIBS = @CLIENT_LIBS@ LIBS = @CLIENT_LIBS@
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
......
...@@ -21,8 +21,7 @@ ...@@ -21,8 +21,7 @@
# This file is public domain and comes with NO WARRANTY of any kind # This file is public domain and comes with NO WARRANTY of any kind
target = libmysqlclient_r.la target = libmysqlclient_r.la
target_defs = -DDISABLE_MYSQL_PRLOCK_H -DDONT_USE_RAID \ target_defs = -DDISABLE_MYSQL_PRLOCK_H -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@
-DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@
LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@ LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@
......
DROP TABLE IF EXISTS t1,t2;
DROP DATABASE IF EXISTS test_$1;
create database test_$1;
create table test_$1.r1 (i int) raid_type=1;
create table test_$1.r2 (i int) raid_type=1 raid_chunks=32;
drop database test_$1;
create database test_$1;
create table test_$1.r2 (i int) raid_type=1 raid_chunks=257;
show create table test_$1.r2;
Table Create Table
r2 CREATE TABLE `r2` (
`i` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 RAID_TYPE=striped RAID_CHUNKS=255 RAID_CHUNKSIZE=256
drop database test_$1;
CREATE TABLE t1 (
id int unsigned not null auto_increment primary key,
c char(255) not null
) RAID_TYPE=STRIPED RAID_CHUNKS=2 RAID_CHUNKSIZE=123;
INSERT INTO t1 VALUES
(NULL,'1'),(NULL,'a'),(NULL,'a'),(NULL,'a'),(NULL,'p'),(NULL,'a'),
(NULL,'2'),(NULL,'b'),(NULL,'a'),(NULL,'a'),(NULL,'q'),(NULL,'a'),
(NULL,'3'),(NULL,'c'),(NULL,'a'),(NULL,'a'),(NULL,'r'),(NULL,'a'),
(NULL,'4'),(NULL,'d'),(NULL,'a'),(NULL,'a'),(NULL,'s'),(NULL,'a'),
(NULL,'5'),(NULL,'e'),(NULL,'a'),(NULL,'a'),(NULL,'t'),(NULL,'a'),
(NULL,'6'),(NULL,'f'),(NULL,'a'),(NULL,'a'),(NULL,'u'),(NULL,'a'),
(NULL,'7'),(NULL,'g'),(NULL,'a'),(NULL,'a'),(NULL,'v'),(NULL,'a'),
(NULL,'8'),(NULL,'h'),(NULL,'a'),(NULL,'a'),(NULL,'w'),(NULL,'a'),
(NULL,'9'),(NULL,'i'),(NULL,'a'),(NULL,'a'),(NULL,'x'),(NULL,'a'),
(NULL,'0'),(NULL,'j'),(NULL,'a'),(NULL,'a'),(NULL,'y'),(NULL,'a'),
(NULL,'1'),(NULL,'k'),(NULL,'a'),(NULL,'a'),(NULL,'z'),(NULL,'a'),
(NULL,'2'),(NULL,'l'),(NULL,'a'),(NULL,'a'),(NULL,'/'),(NULL,'a'),
(NULL,'3'),(NULL,'m'),(NULL,'a'),(NULL,'a'),(NULL,'*'),(NULL,'a'),
(NULL,'4'),(NULL,'n'),(NULL,'a'),(NULL,'a'),(NULL,'+'),(NULL,'a'),
(NULL,'5'),(NULL,'o'),(NULL,'a'),(NULL,'a'),(NULL,'?'),(NULL,'a');
INSERT INTO t1 VALUES
(NULL,'1'),(NULL,'a'),(NULL,'a'),(NULL,'a'),(NULL,'p'),(NULL,'a'),
(NULL,'2'),(NULL,'b'),(NULL,'a'),(NULL,'a'),(NULL,'q'),(NULL,'a'),
(NULL,'3'),(NULL,'c'),(NULL,'a'),(NULL,'a'),(NULL,'r'),(NULL,'a'),
(NULL,'4'),(NULL,'d'),(NULL,'a'),(NULL,'a'),(NULL,'s'),(NULL,'a'),
(NULL,'5'),(NULL,'e'),(NULL,'a'),(NULL,'a'),(NULL,'t'),(NULL,'a'),
(NULL,'6'),(NULL,'f'),(NULL,'a'),(NULL,'a'),(NULL,'u'),(NULL,'a'),
(NULL,'7'),(NULL,'g'),(NULL,'a'),(NULL,'a'),(NULL,'v'),(NULL,'a'),
(NULL,'8'),(NULL,'h'),(NULL,'a'),(NULL,'a'),(NULL,'w'),(NULL,'a'),
(NULL,'9'),(NULL,'i'),(NULL,'a'),(NULL,'a'),(NULL,'x'),(NULL,'a'),
(NULL,'0'),(NULL,'j'),(NULL,'a'),(NULL,'a'),(NULL,'y'),(NULL,'a'),
(NULL,'1'),(NULL,'k'),(NULL,'a'),(NULL,'a'),(NULL,'z'),(NULL,'a'),
(NULL,'2'),(NULL,'l'),(NULL,'a'),(NULL,'a'),(NULL,'/'),(NULL,'a'),
(NULL,'3'),(NULL,'m'),(NULL,'a'),(NULL,'a'),(NULL,'*'),(NULL,'a'),
(NULL,'4'),(NULL,'n'),(NULL,'a'),(NULL,'a'),(NULL,'+'),(NULL,'a'),
(NULL,'5'),(NULL,'o'),(NULL,'a'),(NULL,'a'),(NULL,'?'),(NULL,'a');
INSERT INTO t1 VALUES
(NULL,'1'),(NULL,'a'),(NULL,'a'),(NULL,'a'),(NULL,'p'),(NULL,'a'),
(NULL,'2'),(NULL,'b'),(NULL,'a'),(NULL,'a'),(NULL,'q'),(NULL,'a'),
(NULL,'3'),(NULL,'c'),(NULL,'a'),(NULL,'a'),(NULL,'r'),(NULL,'a'),
(NULL,'4'),(NULL,'d'),(NULL,'a'),(NULL,'a'),(NULL,'s'),(NULL,'a'),
(NULL,'5'),(NULL,'e'),(NULL,'a'),(NULL,'a'),(NULL,'t'),(NULL,'a'),
(NULL,'6'),(NULL,'f'),(NULL,'a'),(NULL,'a'),(NULL,'u'),(NULL,'a'),
(NULL,'7'),(NULL,'g'),(NULL,'a'),(NULL,'a'),(NULL,'v'),(NULL,'a'),
(NULL,'8'),(NULL,'h'),(NULL,'a'),(NULL,'a'),(NULL,'w'),(NULL,'a'),
(NULL,'9'),(NULL,'i'),(NULL,'a'),(NULL,'a'),(NULL,'x'),(NULL,'a'),
(NULL,'0'),(NULL,'j'),(NULL,'a'),(NULL,'a'),(NULL,'y'),(NULL,'a'),
(NULL,'1'),(NULL,'k'),(NULL,'a'),(NULL,'a'),(NULL,'z'),(NULL,'a'),
(NULL,'2'),(NULL,'l'),(NULL,'a'),(NULL,'a'),(NULL,'/'),(NULL,'a'),
(NULL,'3'),(NULL,'m'),(NULL,'a'),(NULL,'a'),(NULL,'*'),(NULL,'a'),
(NULL,'4'),(NULL,'n'),(NULL,'a'),(NULL,'a'),(NULL,'+'),(NULL,'a'),
(NULL,'5'),(NULL,'o'),(NULL,'a'),(NULL,'a'),(NULL,'?'),(NULL,'a');
INSERT INTO t1 VALUES
(NULL,'1'),(NULL,'a'),(NULL,'a'),(NULL,'a'),(NULL,'p'),(NULL,'a'),
(NULL,'2'),(NULL,'b'),(NULL,'a'),(NULL,'a'),(NULL,'q'),(NULL,'a'),
(NULL,'3'),(NULL,'c'),(NULL,'a'),(NULL,'a'),(NULL,'r'),(NULL,'a'),
(NULL,'4'),(NULL,'d'),(NULL,'a'),(NULL,'a'),(NULL,'s'),(NULL,'a'),
(NULL,'5'),(NULL,'e'),(NULL,'a'),(NULL,'a'),(NULL,'t'),(NULL,'a'),
(NULL,'6'),(NULL,'f'),(NULL,'a'),(NULL,'a'),(NULL,'u'),(NULL,'a'),
(NULL,'7'),(NULL,'g'),(NULL,'a'),(NULL,'a'),(NULL,'v'),(NULL,'a'),
(NULL,'8'),(NULL,'h'),(NULL,'a'),(NULL,'a'),(NULL,'w'),(NULL,'a'),
(NULL,'9'),(NULL,'i'),(NULL,'a'),(NULL,'a'),(NULL,'x'),(NULL,'a'),
(NULL,'0'),(NULL,'j'),(NULL,'a'),(NULL,'a'),(NULL,'y'),(NULL,'a'),
(NULL,'1'),(NULL,'k'),(NULL,'a'),(NULL,'a'),(NULL,'z'),(NULL,'a'),
(NULL,'2'),(NULL,'l'),(NULL,'a'),(NULL,'a'),(NULL,'/'),(NULL,'a'),
(NULL,'3'),(NULL,'m'),(NULL,'a'),(NULL,'a'),(NULL,'*'),(NULL,'a'),
(NULL,'4'),(NULL,'n'),(NULL,'a'),(NULL,'a'),(NULL,'+'),(NULL,'a'),
(NULL,'5'),(NULL,'o'),(NULL,'a'),(NULL,'a'),(NULL,'?'),(NULL,'a');
INSERT INTO t1 VALUES
(NULL,'1'),(NULL,'a'),(NULL,'a'),(NULL,'a'),(NULL,'p'),(NULL,'a'),
(NULL,'2'),(NULL,'b'),(NULL,'a'),(NULL,'a'),(NULL,'q'),(NULL,'a'),
(NULL,'3'),(NULL,'c'),(NULL,'a'),(NULL,'a'),(NULL,'r'),(NULL,'a'),
(NULL,'4'),(NULL,'d'),(NULL,'a'),(NULL,'a'),(NULL,'s'),(NULL,'a'),
(NULL,'5'),(NULL,'e'),(NULL,'a'),(NULL,'a'),(NULL,'t'),(NULL,'a'),
(NULL,'6'),(NULL,'f'),(NULL,'a'),(NULL,'a'),(NULL,'u'),(NULL,'a'),
(NULL,'7'),(NULL,'g'),(NULL,'a'),(NULL,'a'),(NULL,'v'),(NULL,'a'),
(NULL,'8'),(NULL,'h'),(NULL,'a'),(NULL,'a'),(NULL,'w'),(NULL,'a'),
(NULL,'9'),(NULL,'i'),(NULL,'a'),(NULL,'a'),(NULL,'x'),(NULL,'a'),
(NULL,'0'),(NULL,'j'),(NULL,'a'),(NULL,'a'),(NULL,'y'),(NULL,'a'),
(NULL,'1'),(NULL,'k'),(NULL,'a'),(NULL,'a'),(NULL,'z'),(NULL,'a'),
(NULL,'2'),(NULL,'l'),(NULL,'a'),(NULL,'a'),(NULL,'/'),(NULL,'a'),
(NULL,'3'),(NULL,'m'),(NULL,'a'),(NULL,'a'),(NULL,'*'),(NULL,'a'),
(NULL,'4'),(NULL,'n'),(NULL,'a'),(NULL,'a'),(NULL,'+'),(NULL,'a'),
(NULL,'5'),(NULL,'o'),(NULL,'a'),(NULL,'a'),(NULL,'?'),(NULL,'a');
select count(*) from t1;
count(*)
450
ALTER TABLE t1 ADD COLUMN x INT UNSIGNED NOT NULL;
ALTER TABLE t1 ADD KEY c (c);
ALTER TABLE t1 DROP KEY c;
ALTER TABLE t1 DROP COLUMN x;
ALTER TABLE t1 RENAME t2;
select count(*) from t2;
count(*)
450
DROP TABLE t2;
/* variable rows */
CREATE TABLE t1 (
id int unsigned not null auto_increment primary key,
c varchar(255) not null
) RAID_TYPE=STRIPED RAID_CHUNKS=5 RAID_CHUNKSIZE=121;
INSERT INTO t1 VALUES
(NULL,'1'),(NULL,'a'),(NULL,'a'),(NULL,'a'),(NULL,'p'),(NULL,'a'),
(NULL,'2'),(NULL,'b'),(NULL,'a'),(NULL,'a'),(NULL,'q'),(NULL,'a'),
(NULL,'3'),(NULL,'c'),(NULL,'a'),(NULL,'a'),(NULL,'r'),(NULL,'a'),
(NULL,'4'),(NULL,'d'),(NULL,'a'),(NULL,'a'),(NULL,'s'),(NULL,'a'),
(NULL,'5'),(NULL,'e'),(NULL,'a'),(NULL,'a'),(NULL,'t'),(NULL,'a'),
(NULL,'6'),(NULL,'f'),(NULL,'a'),(NULL,'a'),(NULL,'u'),(NULL,'a'),
(NULL,'7'),(NULL,'g'),(NULL,'a'),(NULL,'a'),(NULL,'v'),(NULL,'a'),
(NULL,'8'),(NULL,'h'),(NULL,'a'),(NULL,'a'),(NULL,'w'),(NULL,'a'),
(NULL,'9'),(NULL,'i'),(NULL,'a'),(NULL,'a'),(NULL,'x'),(NULL,'a'),
(NULL,'0'),(NULL,'j'),(NULL,'a'),(NULL,'a'),(NULL,'y'),(NULL,'a'),
(NULL,'1'),(NULL,'k'),(NULL,'a'),(NULL,'a'),(NULL,'z'),(NULL,'a'),
(NULL,'2'),(NULL,'l'),(NULL,'a'),(NULL,'a'),(NULL,'/'),(NULL,'a'),
(NULL,'3'),(NULL,'m'),(NULL,'a'),(NULL,'a'),(NULL,'*'),(NULL,'a'),
(NULL,'4'),(NULL,'n'),(NULL,'a'),(NULL,'a'),(NULL,'+'),(NULL,'a'),
(NULL,'5'),(NULL,'o'),(NULL,'a'),(NULL,'a'),(NULL,'?'),(NULL,'a');
INSERT INTO t1 VALUES
(NULL,'1'),(NULL,'a'),(NULL,'a'),(NULL,'a'),(NULL,'p'),(NULL,'a'),
(NULL,'2'),(NULL,'b'),(NULL,'a'),(NULL,'a'),(NULL,'q'),(NULL,'a'),
(NULL,'3'),(NULL,'c'),(NULL,'a'),(NULL,'a'),(NULL,'r'),(NULL,'a'),
(NULL,'4'),(NULL,'d'),(NULL,'a'),(NULL,'a'),(NULL,'s'),(NULL,'a'),
(NULL,'5'),(NULL,'e'),(NULL,'a'),(NULL,'a'),(NULL,'t'),(NULL,'a'),
(NULL,'6'),(NULL,'f'),(NULL,'a'),(NULL,'a'),(NULL,'u'),(NULL,'a'),
(NULL,'7'),(NULL,'g'),(NULL,'a'),(NULL,'a'),(NULL,'v'),(NULL,'a'),
(NULL,'8'),(NULL,'h'),(NULL,'a'),(NULL,'a'),(NULL,'w'),(NULL,'a'),
(NULL,'9'),(NULL,'i'),(NULL,'a'),(NULL,'a'),(NULL,'x'),(NULL,'a'),
(NULL,'0'),(NULL,'j'),(NULL,'a'),(NULL,'a'),(NULL,'y'),(NULL,'a'),
(NULL,'1'),(NULL,'k'),(NULL,'a'),(NULL,'a'),(NULL,'z'),(NULL,'a'),
(NULL,'2'),(NULL,'l'),(NULL,'a'),(NULL,'a'),(NULL,'/'),(NULL,'a'),
(NULL,'3'),(NULL,'m'),(NULL,'a'),(NULL,'a'),(NULL,'*'),(NULL,'a'),
(NULL,'4'),(NULL,'n'),(NULL,'a'),(NULL,'a'),(NULL,'+'),(NULL,'a'),
(NULL,'5'),(NULL,'o'),(NULL,'a'),(NULL,'a'),(NULL,'?'),(NULL,'a');
INSERT INTO t1 VALUES
(NULL,'1'),(NULL,'a'),(NULL,'a'),(NULL,'a'),(NULL,'p'),(NULL,'a'),
(NULL,'2'),(NULL,'b'),(NULL,'a'),(NULL,'a'),(NULL,'q'),(NULL,'a'),
(NULL,'3'),(NULL,'c'),(NULL,'a'),(NULL,'a'),(NULL,'r'),(NULL,'a'),
(NULL,'4'),(NULL,'d'),(NULL,'a'),(NULL,'a'),(NULL,'s'),(NULL,'a'),
(NULL,'5'),(NULL,'e'),(NULL,'a'),(NULL,'a'),(NULL,'t'),(NULL,'a'),
(NULL,'6'),(NULL,'f'),(NULL,'a'),(NULL,'a'),(NULL,'u'),(NULL,'a'),
(NULL,'7'),(NULL,'g'),(NULL,'a'),(NULL,'a'),(NULL,'v'),(NULL,'a'),
(NULL,'8'),(NULL,'h'),(NULL,'a'),(NULL,'a'),(NULL,'w'),(NULL,'a'),
(NULL,'9'),(NULL,'i'),(NULL,'a'),(NULL,'a'),(NULL,'x'),(NULL,'a'),
(NULL,'0'),(NULL,'j'),(NULL,'a'),(NULL,'a'),(NULL,'y'),(NULL,'a'),
(NULL,'1'),(NULL,'k'),(NULL,'a'),(NULL,'a'),(NULL,'z'),(NULL,'a'),
(NULL,'2'),(NULL,'l'),(NULL,'a'),(NULL,'a'),(NULL,'/'),(NULL,'a'),
(NULL,'3'),(NULL,'m'),(NULL,'a'),(NULL,'a'),(NULL,'*'),(NULL,'a'),
(NULL,'4'),(NULL,'n'),(NULL,'a'),(NULL,'a'),(NULL,'+'),(NULL,'a'),
(NULL,'5'),(NULL,'o'),(NULL,'a'),(NULL,'a'),(NULL,'?'),(NULL,'a');
INSERT INTO t1 VALUES
(NULL,'1'),(NULL,'a'),(NULL,'a'),(NULL,'a'),(NULL,'p'),(NULL,'a'),
(NULL,'2'),(NULL,'b'),(NULL,'a'),(NULL,'a'),(NULL,'q'),(NULL,'a'),
(NULL,'3'),(NULL,'c'),(NULL,'a'),(NULL,'a'),(NULL,'r'),(NULL,'a'),
(NULL,'4'),(NULL,'d'),(NULL,'a'),(NULL,'a'),(NULL,'s'),(NULL,'a'),
(NULL,'5'),(NULL,'e'),(NULL,'a'),(NULL,'a'),(NULL,'t'),(NULL,'a'),
(NULL,'6'),(NULL,'f'),(NULL,'a'),(NULL,'a'),(NULL,'u'),(NULL,'a'),
(NULL,'7'),(NULL,'g'),(NULL,'a'),(NULL,'a'),(NULL,'v'),(NULL,'a'),
(NULL,'8'),(NULL,'h'),(NULL,'a'),(NULL,'a'),(NULL,'w'),(NULL,'a'),
(NULL,'9'),(NULL,'i'),(NULL,'a'),(NULL,'a'),(NULL,'x'),(NULL,'a'),
(NULL,'0'),(NULL,'j'),(NULL,'a'),(NULL,'a'),(NULL,'y'),(NULL,'a'),
(NULL,'1'),(NULL,'k'),(NULL,'a'),(NULL,'a'),(NULL,'z'),(NULL,'a'),
(NULL,'2'),(NULL,'l'),(NULL,'a'),(NULL,'a'),(NULL,'/'),(NULL,'a'),
(NULL,'3'),(NULL,'m'),(NULL,'a'),(NULL,'a'),(NULL,'*'),(NULL,'a'),
(NULL,'4'),(NULL,'n'),(NULL,'a'),(NULL,'a'),(NULL,'+'),(NULL,'a'),
(NULL,'5'),(NULL,'o'),(NULL,'a'),(NULL,'a'),(NULL,'?'),(NULL,'a');
INSERT INTO t1 VALUES
(NULL,'1'),(NULL,'a'),(NULL,'a'),(NULL,'a'),(NULL,'p'),(NULL,'a'),
(NULL,'2'),(NULL,'b'),(NULL,'a'),(NULL,'a'),(NULL,'q'),(NULL,'a'),
(NULL,'3'),(NULL,'c'),(NULL,'a'),(NULL,'a'),(NULL,'r'),(NULL,'a'),
(NULL,'4'),(NULL,'d'),(NULL,'a'),(NULL,'a'),(NULL,'s'),(NULL,'a'),
(NULL,'5'),(NULL,'e'),(NULL,'a'),(NULL,'a'),(NULL,'t'),(NULL,'a'),
(NULL,'6'),(NULL,'f'),(NULL,'a'),(NULL,'a'),(NULL,'u'),(NULL,'a'),
(NULL,'7'),(NULL,'g'),(NULL,'a'),(NULL,'a'),(NULL,'v'),(NULL,'a'),
(NULL,'8'),(NULL,'h'),(NULL,'a'),(NULL,'a'),(NULL,'w'),(NULL,'a'),
(NULL,'9'),(NULL,'i'),(NULL,'a'),(NULL,'a'),(NULL,'x'),(NULL,'a'),
(NULL,'0'),(NULL,'j'),(NULL,'a'),(NULL,'a'),(NULL,'y'),(NULL,'a'),
(NULL,'1'),(NULL,'k'),(NULL,'a'),(NULL,'a'),(NULL,'z'),(NULL,'a'),
(NULL,'2'),(NULL,'l'),(NULL,'a'),(NULL,'a'),(NULL,'/'),(NULL,'a'),
(NULL,'3'),(NULL,'m'),(NULL,'a'),(NULL,'a'),(NULL,'*'),(NULL,'a'),
(NULL,'4'),(NULL,'n'),(NULL,'a'),(NULL,'a'),(NULL,'+'),(NULL,'a'),
(NULL,'5'),(NULL,'o'),(NULL,'a'),(NULL,'a'),(NULL,'?'),(NULL,'a');
select count(*) from t1;
count(*)
450
ALTER TABLE t1 ADD COLUMN x INT UNSIGNED NOT NULL;
ALTER TABLE t1 ADD KEY c (c);
ALTER TABLE t1 DROP KEY c;
ALTER TABLE t1 DROP COLUMN x;
ALTER TABLE t1 RENAME t2;
ALTER TABLE t2 CHANGE COLUMN c c VARCHAR(251) NOT NULL;
select count(*) from t2;
count(*)
450
DROP TABLE t2;
...@@ -173,7 +173,7 @@ type_long_blob longblob, ...@@ -173,7 +173,7 @@ type_long_blob longblob,
index(type_short) 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; ) 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; show create table t1;
insert into t1 (type_timestamp) values ("2003-02-07 10:00:01"); insert into t1 (type_timestamp) values ("2003-02-07 10:00:01");
select * from t1; select * from t1;
......
...@@ -47,7 +47,6 @@ TODO: ...@@ -47,7 +47,6 @@ TODO:
write buffer to the read buffer before we start to reuse it. write buffer to the read buffer before we start to reuse it.
*/ */
#define MAP_TO_USE_RAID
#include "mysys_priv.h" #include "mysys_priv.h"
#include <m_string.h> #include <m_string.h>
#ifdef HAVE_AIOWAIT #ifdef HAVE_AIOWAIT
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
More functions to be used with IO_CACHE files More functions to be used with IO_CACHE files
*/ */
#define MAP_TO_USE_RAID
#include "mysys_priv.h" #include "mysys_priv.h"
#include <m_string.h> #include <m_string.h>
#include <stdarg.h> #include <stdarg.h>
......
...@@ -52,11 +52,6 @@ ...@@ -52,11 +52,6 @@
#endif #endif
#include "rt_index.h" #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 */ /* Functions defined in this file */
static int check_k_link(MI_CHECK *param, MI_INFO *info,uint nr); static int check_k_link(MI_CHECK *param, MI_INFO *info,uint nr);
...@@ -1577,14 +1572,11 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info, ...@@ -1577,14 +1572,11 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
if (!rep_quick) if (!rep_quick)
{ {
/* Get real path for data file */ /* Get real path for data file */
if ((new_file= my_raid_create(mi_key_file_datatmp, if ((new_file= mysql_file_create(mi_key_file_datatmp,
fn_format(param->temp_filename, fn_format(param->temp_filename,
share->data_file_name, "", share->data_file_name, "",
DATA_TMP_EXT, 2+4), DATA_TMP_EXT, 2+4),
0, param->tmpfile_createflag, 0, param->tmpfile_createflag,
share->base.raid_type,
share->base.raid_chunks,
share->base.raid_chunksize,
MYF(0))) < 0) MYF(0))) < 0)
{ {
mi_check_print_error(param,"Can't create new tempfile: '%s'", mi_check_print_error(param,"Can't create new tempfile: '%s'",
...@@ -1751,8 +1743,7 @@ err: ...@@ -1751,8 +1743,7 @@ err:
(size_t) info->s->mmaped_length); (size_t) info->s->mmaped_length);
info->s->file_map= NULL; info->s->file_map= NULL;
} }
if (change_to_newfile(share->data_file_name,MI_NAME_DEXT, if (change_to_newfile(share->data_file_name, MI_NAME_DEXT, DATA_TMP_EXT,
DATA_TMP_EXT, share->base.raid_chunks,
(param->testflag & T_BACKUP_DATA ? (param->testflag & T_BACKUP_DATA ?
MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) || MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
mi_open_datafile(info,share,name,-1)) mi_open_datafile(info,share,name,-1))
...@@ -1767,9 +1758,8 @@ err: ...@@ -1767,9 +1758,8 @@ err:
if (new_file >= 0) if (new_file >= 0)
{ {
(void) mysql_file_close(new_file, MYF(0)); (void) mysql_file_close(new_file, MYF(0));
(void) my_raid_delete(mi_key_file_datatmp, (void) mysql_file_delete(mi_key_file_datatmp,
param->temp_filename, info->s->base.raid_chunks, param->temp_filename, MYF(MY_WME));
MYF(MY_WME));
info->rec_cache.file=-1; /* don't flush data to new_file, it's closed */ info->rec_cache.file=-1; /* don't flush data to new_file, it's closed */
} }
mi_mark_crashed_on_repair(info); mi_mark_crashed_on_repair(info);
...@@ -2011,7 +2001,7 @@ int mi_sort_index(MI_CHECK *param, register MI_INFO *info, char * name) ...@@ -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)); (void) mysql_file_close(share->kfile, MYF(MY_WME));
share->kfile = -1; share->kfile = -1;
(void) mysql_file_close(new_file, MYF(MY_WME)); (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)) || MYF(0)) ||
mi_open_keyfile(share)) mi_open_keyfile(share))
goto err2; goto err2;
...@@ -2141,18 +2131,9 @@ err: ...@@ -2141,18 +2131,9 @@ err:
*/ */
int change_to_newfile(const char * filename, const char * old_ext, int change_to_newfile(const char * filename, const char * old_ext,
const char * new_ext, const char * new_ext, myf MyFlags)
uint raid_chunks __attribute__((unused)),
myf MyFlags)
{ {
char old_filename[FN_REFLEN],new_filename[FN_REFLEN]; 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 */ /* Get real path to filename */
(void) fn_format(old_filename,filename,"",old_ext,2+4+32); (void) fn_format(old_filename,filename,"",old_ext,2+4+32);
return my_redel(old_filename, return my_redel(old_filename,
...@@ -2293,14 +2274,11 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, ...@@ -2293,14 +2274,11 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
if (!rep_quick) if (!rep_quick)
{ {
/* Get real path for data file */ /* Get real path for data file */
if ((new_file= my_raid_create(mi_key_file_datatmp, if ((new_file= mysql_file_create(mi_key_file_datatmp,
fn_format(param->temp_filename, fn_format(param->temp_filename,
share->data_file_name, "", share->data_file_name, "",
DATA_TMP_EXT, 2+4), DATA_TMP_EXT, 2+4),
0, param->tmpfile_createflag, 0, param->tmpfile_createflag,
share->base.raid_type,
share->base.raid_chunks,
share->base.raid_chunksize,
MYF(0))) < 0) MYF(0))) < 0)
{ {
mi_check_print_error(param,"Can't create new tempfile: '%s'", mi_check_print_error(param,"Can't create new tempfile: '%s'",
...@@ -2527,7 +2505,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, ...@@ -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)
skr=share->base.reloc*share->base.min_pack_length; skr=share->base.reloc*share->base.min_pack_length;
#endif #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))) if (mysql_file_chsize(info->dfile, skr, 0, MYF(0)))
mi_check_print_warning(param, mi_check_print_warning(param,
"Can't change size of datafile, error: %d", "Can't change size of datafile, error: %d",
...@@ -2565,8 +2543,7 @@ err: ...@@ -2565,8 +2543,7 @@ err:
{ {
mysql_file_close(new_file, MYF(0)); mysql_file_close(new_file, MYF(0));
info->dfile=new_file= -1; info->dfile=new_file= -1;
if (change_to_newfile(share->data_file_name,MI_NAME_DEXT, if (change_to_newfile(share->data_file_name,MI_NAME_DEXT, DATA_TMP_EXT,
DATA_TMP_EXT, share->base.raid_chunks,
(param->testflag & T_BACKUP_DATA ? (param->testflag & T_BACKUP_DATA ?
MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) || MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
mi_open_datafile(info,share,name,-1)) mi_open_datafile(info,share,name,-1))
...@@ -2580,9 +2557,8 @@ err: ...@@ -2580,9 +2557,8 @@ err:
if (new_file >= 0) if (new_file >= 0)
{ {
(void) mysql_file_close(new_file, MYF(0)); (void) mysql_file_close(new_file, MYF(0));
(void) my_raid_delete(mi_key_file_datatmp, (void) mysql_file_delete(mi_key_file_datatmp,
param->temp_filename, share->base.raid_chunks, param->temp_filename, MYF(MY_WME));
MYF(MY_WME));
if (info->dfile == new_file) /* Retry with key cache */ if (info->dfile == new_file) /* Retry with key cache */
if (unlikely(mi_open_datafile(info, share, name, -1))) if (unlikely(mi_open_datafile(info, share, name, -1)))
param->retry_repair= 0; /* Safety */ param->retry_repair= 0; /* Safety */
...@@ -2751,15 +2727,11 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, ...@@ -2751,15 +2727,11 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
if (!rep_quick) if (!rep_quick)
{ {
/* Get real path for data file */ /* Get real path for data file */
if ((new_file= my_raid_create(mi_key_file_datatmp, if ((new_file= mysql_file_create(mi_key_file_datatmp,
fn_format(param->temp_filename, fn_format(param->temp_filename,
share->data_file_name, "", share->data_file_name, "",
DATA_TMP_EXT, DATA_TMP_EXT, 2+4),
2+4),
0, param->tmpfile_createflag, 0, param->tmpfile_createflag,
share->base.raid_type,
share->base.raid_chunks,
share->base.raid_chunksize,
MYF(0))) < 0) MYF(0))) < 0)
{ {
mi_check_print_error(param,"Can't create new tempfile: '%s'", mi_check_print_error(param,"Can't create new tempfile: '%s'",
...@@ -3055,7 +3027,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, ...@@ -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)
skr=share->base.reloc*share->base.min_pack_length; skr=share->base.reloc*share->base.min_pack_length;
#endif #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))) if (mysql_file_chsize(info->dfile, skr, 0, MYF(0)))
mi_check_print_warning(param, mi_check_print_warning(param,
"Can't change size of datafile, error: %d", "Can't change size of datafile, error: %d",
...@@ -3105,8 +3077,7 @@ err: ...@@ -3105,8 +3077,7 @@ err:
{ {
mysql_file_close(new_file, MYF(0)); mysql_file_close(new_file, MYF(0));
info->dfile=new_file= -1; info->dfile=new_file= -1;
if (change_to_newfile(share->data_file_name,MI_NAME_DEXT, if (change_to_newfile(share->data_file_name, MI_NAME_DEXT, DATA_TMP_EXT,
DATA_TMP_EXT, share->base.raid_chunks,
(param->testflag & T_BACKUP_DATA ? (param->testflag & T_BACKUP_DATA ?
MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) || MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
mi_open_datafile(info,share,name,-1)) mi_open_datafile(info,share,name,-1))
...@@ -3120,9 +3091,8 @@ err: ...@@ -3120,9 +3091,8 @@ err:
if (new_file >= 0) if (new_file >= 0)
{ {
(void) mysql_file_close(new_file, MYF(0)); (void) mysql_file_close(new_file, MYF(0));
(void) my_raid_delete(mi_key_file_datatmp, (void) mysql_file_delete(mi_key_file_datatmp,
param->temp_filename, share->base.raid_chunks, param->temp_filename, MYF(MY_WME));
MYF(MY_WME));
if (info->dfile == new_file) /* Retry with key cache */ if (info->dfile == new_file) /* Retry with key cache */
if (unlikely(mi_open_datafile(info, share, name, -1))) if (unlikely(mi_open_datafile(info, share, name, -1)))
param->retry_repair= 0; /* Safety */ param->retry_repair= 0; /* Safety */
......
...@@ -549,11 +549,6 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, ...@@ -549,11 +549,6 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
share.base.pack_bits=packed; share.base.pack_bits=packed;
share.base.fields=fields; share.base.fields=fields;
share.base.pack_fields=packed; 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 */ /* max_data_file_length and max_key_file_length are recalculated on open */
if (options & HA_OPTION_TMP_TABLE) if (options & HA_OPTION_TMP_TABLE)
...@@ -642,20 +637,6 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, ...@@ -642,20 +637,6 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
if (!(flags & HA_DONT_TOUCH_DATA)) 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) if (ci->data_file_name)
{ {
...@@ -841,7 +822,6 @@ err: ...@@ -841,7 +822,6 @@ err:
(void) mysql_file_close(dfile, MYF(0)); (void) mysql_file_close(dfile, MYF(0));
/* fall through */ /* fall through */
case 2: case 2:
/* QQ: Tnu should add a call to my_raid_delete() here */
if (! (flags & HA_DONT_TOUCH_DATA)) if (! (flags & HA_DONT_TOUCH_DATA))
mysql_file_delete_with_symlink(mi_key_file_dfile, mysql_file_delete_with_symlink(mi_key_file_dfile,
fn_format(filename, name, "", MI_NAME_DEXT, fn_format(filename, name, "", MI_NAME_DEXT,
......
...@@ -22,40 +22,11 @@ ...@@ -22,40 +22,11 @@
int mi_delete_table(const char *name) int mi_delete_table(const char *name)
{ {
char from[FN_REFLEN]; char from[FN_REFLEN];
#ifdef USE_RAID
uint raid_type=0,raid_chunks=0;
#endif
DBUG_ENTER("mi_delete_table"); DBUG_ENTER("mi_delete_table");
#ifdef EXTRA_DEBUG #ifdef EXTRA_DEBUG
check_table_is_closed(name,"delete"); check_table_is_closed(name,"delete");
#endif #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); fn_format(from,name,"",MI_NAME_IEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT);
if (my_is_symlink(from) && (*myisam_test_invalid_symlink)(from)) if (my_is_symlink(from) && (*myisam_test_invalid_symlink)(from))
...@@ -73,10 +44,6 @@ int mi_delete_table(const char *name) ...@@ -73,10 +44,6 @@ int mi_delete_table(const char *name)
DBUG_RETURN(my_errno); DBUG_RETURN(my_errno);
} }
fn_format(from,name,"",MI_NAME_DEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT); 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)) 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) ...@@ -259,25 +259,6 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
#if SIZEOF_OFF_T == 4 #if SIZEOF_OFF_T == 4
set_if_smaller(max_data_file_length, INT_MAX32); set_if_smaller(max_data_file_length, INT_MAX32);
set_if_smaller(max_key_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 #endif
share->base.max_data_file_length=(my_off_t) max_data_file_length; 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; 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) ...@@ -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->max_key_length); ptr +=2;
mi_int2store(ptr,base->extra_alloc_bytes); ptr +=2; mi_int2store(ptr,base->extra_alloc_bytes); ptr +=2;
*ptr++= base->extra_alloc_procent; *ptr++= base->extra_alloc_procent;
*ptr++= base->raid_type; bzero(ptr,13); ptr +=13; /* extra */
mi_int2store(ptr,base->raid_chunks); ptr +=2;
mi_int4store(ptr,base->raid_chunksize); ptr +=4;
bzero(ptr,6); ptr +=6; /* extra */
return mysql_file_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0; 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) ...@@ -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->max_key_length = mi_uint2korr(ptr); ptr +=2;
base->extra_alloc_bytes = mi_uint2korr(ptr); ptr +=2; base->extra_alloc_bytes = mi_uint2korr(ptr); ptr +=2;
base->extra_alloc_procent = *ptr++; 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; return ptr;
} }
...@@ -1223,7 +1192,7 @@ uchar *mi_recinfo_read(uchar *ptr, MI_COLUMNDEF *recinfo) ...@@ -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 We can't use dup() here as the data file descriptors need to have different
active seek-positions. active seek-positions.
...@@ -1251,18 +1220,6 @@ int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, const char *org_name, ...@@ -1251,18 +1220,6 @@ int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, const char *org_name,
data_name= real_data_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, info->dfile= mysql_file_open(mi_key_file_dfile,
data_name, share->mode | O_SHARE, MYF(MY_WME)); data_name, share->mode | O_SHARE, MYF(MY_WME));
return info->dfile >= 0 ? 0 : 1; return info->dfile >= 0 ? 0 : 1;
......
...@@ -22,28 +22,12 @@ ...@@ -22,28 +22,12 @@
int mi_rename(const char *old_name, const char *new_name) int mi_rename(const char *old_name, const char *new_name)
{ {
char from[FN_REFLEN],to[FN_REFLEN]; char from[FN_REFLEN],to[FN_REFLEN];
#ifdef USE_RAID
uint raid_type=0,raid_chunks=0;
#endif
DBUG_ENTER("mi_rename"); DBUG_ENTER("mi_rename");
#ifdef EXTRA_DEBUG #ifdef EXTRA_DEBUG
check_table_is_closed(old_name,"rename old_table"); check_table_is_closed(old_name,"rename old_table");
check_table_is_closed(new_name,"rename new table2"); check_table_is_closed(new_name,"rename new table2");
#endif #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(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); 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) ...@@ -51,11 +35,6 @@ int mi_rename(const char *old_name, const char *new_name)
DBUG_RETURN(my_errno); DBUG_RETURN(my_errno);
fn_format(from,old_name,"",MI_NAME_DEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT); 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); 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, DBUG_RETURN(mysql_file_rename_with_symlink(mi_key_file_dfile,
from, to, from, to,
MYF(MY_WME)) ? my_errno : 0); MYF(MY_WME)) ? my_errno : 0);
......
...@@ -29,11 +29,6 @@ ...@@ -29,11 +29,6 @@
#endif #endif
SET_STACK_SIZE(9000) /* Minimum stack size for program */ 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 uint decode_bits;
static char **default_argv; static char **default_argv;
static const char *load_default_groups[]= { "myisamchk", 0 }; static const char *load_default_groups[]= { "myisamchk", 0 };
...@@ -782,7 +777,6 @@ static int myisamchk(MI_CHECK *param, char * filename) ...@@ -782,7 +777,6 @@ static int myisamchk(MI_CHECK *param, char * filename)
{ {
int error,lock_type,recreate; int error,lock_type,recreate;
int rep_quick= param->testflag & (T_QUICK | T_FORCE_UNIQUENESS); int rep_quick= param->testflag & (T_QUICK | T_FORCE_UNIQUENESS);
uint raid_chunks;
MI_INFO *info; MI_INFO *info;
File datafile; File datafile;
char llbuff[22],llbuff2[22]; char llbuff[22],llbuff2[22];
...@@ -844,7 +838,6 @@ static int myisamchk(MI_CHECK *param, char * filename) ...@@ -844,7 +838,6 @@ static int myisamchk(MI_CHECK *param, char * filename)
share->options&= ~HA_OPTION_READ_ONLY_DATA; /* We are modifing it */ share->options&= ~HA_OPTION_READ_ONLY_DATA; /* We are modifing it */
share->tot_locks-= share->r_locks; share->tot_locks-= share->r_locks;
share->r_locks=0; share->r_locks=0;
raid_chunks=share->base.raid_chunks;
/* /*
Skip the checking of the file if: Skip the checking of the file if:
...@@ -1013,9 +1006,7 @@ static int myisamchk(MI_CHECK *param, char * filename) ...@@ -1013,9 +1006,7 @@ static int myisamchk(MI_CHECK *param, char * filename)
if (param->out_flag & O_NEW_DATA) if (param->out_flag & O_NEW_DATA)
{ /* Change temp file to org file */ { /* Change temp file to org file */
(void) my_close(info->dfile,MYF(MY_WME)); /* Close new file */ (void) my_close(info->dfile,MYF(MY_WME)); /* Close new file */
error|=change_to_newfile(filename,MI_NAME_DEXT,DATA_TMP_EXT, error|=change_to_newfile(filename, MI_NAME_DEXT, DATA_TMP_EXT, MYF(0));
raid_chunks,
MYF(0));
if (mi_open_datafile(info,info->s, NULL, -1)) if (mi_open_datafile(info,info->s, NULL, -1))
error=1; error=1;
param->out_flag&= ~O_NEW_DATA; /* We are using new datafile */ param->out_flag&= ~O_NEW_DATA; /* We are using new datafile */
...@@ -1146,12 +1137,10 @@ end2: ...@@ -1146,12 +1137,10 @@ end2:
{ {
if (param->out_flag & O_NEW_DATA) if (param->out_flag & O_NEW_DATA)
error|=change_to_newfile(filename,MI_NAME_DEXT,DATA_TMP_EXT, error|=change_to_newfile(filename,MI_NAME_DEXT,DATA_TMP_EXT,
raid_chunks,
((param->testflag & T_BACKUP_DATA) ? ((param->testflag & T_BACKUP_DATA) ?
MYF(MY_REDEL_MAKE_BACKUP) : MYF(0))); MYF(MY_REDEL_MAKE_BACKUP) : MYF(0)));
if (param->out_flag & O_NEW_INDEX) if (param->out_flag & O_NEW_INDEX)
error|=change_to_newfile(filename,MI_NAME_IEXT,INDEX_TMP_EXT,0, error|=change_to_newfile(filename, MI_NAME_IEXT, INDEX_TMP_EXT, MYF(0));
MYF(0));
} }
(void) fflush(stdout); (void) fflush(stderr); (void) fflush(stdout); (void) fflush(stderr);
if (param->error_printed) if (param->error_printed)
...@@ -1247,16 +1236,9 @@ static void descript(MI_CHECK *param, register MI_INFO *info, char * name) ...@@ -1247,16 +1236,9 @@ static void descript(MI_CHECK *param, register MI_INFO *info, char * name)
share->base.auto_key, share->base.auto_key,
llstr(share->state.auto_increment,llbuff)); 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)) if (share->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD))
printf("Checksum: %23s\n",llstr(info->state->checksum,llbuff)); printf("Checksum: %23s\n",llstr(info->state->checksum,llbuff));
;
if (share->options & HA_OPTION_DELAY_KEY_WRITE) if (share->options & HA_OPTION_DELAY_KEY_WRITE)
printf("Keys are only flushed at close\n"); printf("Keys are only flushed at close\n");
...@@ -1527,13 +1509,10 @@ static int mi_sort_records(MI_CHECK *param, ...@@ -1527,13 +1509,10 @@ static int mi_sort_records(MI_CHECK *param,
goto err; goto err;
} }
fn_format(param->temp_filename,name,"", MI_NAME_DEXT,2+4+32); fn_format(param->temp_filename,name,"", MI_NAME_DEXT,2+4+32);
new_file=my_raid_create(fn_format(param->temp_filename, new_file= my_create(fn_format(param->temp_filename,
param->temp_filename,"", param->temp_filename, "",
DATA_TMP_EXT,2+4), DATA_TMP_EXT, 2+4),
0,param->tmpfile_createflag, 0, param->tmpfile_createflag,
share->base.raid_type,
share->base.raid_chunks,
share->base.raid_chunksize,
MYF(0)); MYF(0));
if (new_file < 0) if (new_file < 0)
{ {
...@@ -1609,8 +1588,7 @@ err: ...@@ -1609,8 +1588,7 @@ err:
{ {
(void) end_io_cache(&info->rec_cache); (void) end_io_cache(&info->rec_cache);
(void) my_close(new_file,MYF(MY_WME)); (void) my_close(new_file,MYF(MY_WME));
(void) my_raid_delete(param->temp_filename, share->base.raid_chunks, (void) my_delete(param->temp_filename, MYF(MY_WME));
MYF(MY_WME));
} }
if (temp_buff) if (temp_buff)
{ {
......
...@@ -26,8 +26,9 @@ ...@@ -26,8 +26,9 @@
#endif #endif
#include <mysql/psi/mysql_file.h> #include <mysql/psi/mysql_file.h>
#if defined(my_write) && !defined(MAP_TO_USE_RAID) /* undef map from my_nosys; We need test-if-disk full */
#undef my_write /* undef map from my_nosys; We need test-if-disk full */ #if defined(my_write)
#undef my_write
#endif #endif
typedef struct st_mi_status_info typedef struct st_mi_status_info
...@@ -130,9 +131,6 @@ typedef struct st_mi_base_info ...@@ -130,9 +131,6 @@ typedef struct st_mi_base_info
/* Extra allocation when using dynamic record format */ /* Extra allocation when using dynamic record format */
uint extra_alloc_bytes; uint extra_alloc_bytes;
uint extra_alloc_procent; uint extra_alloc_procent;
/* Info about raid */
uint raid_type,raid_chunks;
ulong raid_chunksize;
/* The following are from the header */ /* The following are from the header */
uint key_parts,all_key_parts; uint key_parts,all_key_parts;
} MI_BASE_INFO; } 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