summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
Diffstat (limited to 'myisam')
-rw-r--r--myisam/ft_static.c1
-rw-r--r--myisam/mi_cache.c7
-rw-r--r--myisam/mi_check.c13
-rw-r--r--myisam/mi_open.c2
-rw-r--r--myisam/mi_packrec.c12
-rw-r--r--myisam/mi_test3.c14
-rw-r--r--myisam/myisamchk.c6
-rw-r--r--myisam/myisamdef.h3
8 files changed, 36 insertions, 22 deletions
diff --git a/myisam/ft_static.c b/myisam/ft_static.c
index b714a7f0c35..44e80847fd7 100644
--- a/myisam/ft_static.c
+++ b/myisam/ft_static.c
@@ -63,6 +63,7 @@ FT_INFO *ft_init_search(uint mode, void *info, uint keynr,
query, query_len, presort);
}
+const char *ft_stopword_file = 0;
const char *ft_precompiled_stopwords[] = {
#ifdef COMPILE_STOPWORDS_IN
diff --git a/myisam/mi_cache.c b/myisam/mi_cache.c
index 462e48b3532..8dee068c50e 100644
--- a/myisam/mi_cache.c
+++ b/myisam/mi_cache.c
@@ -29,7 +29,8 @@
Allows "partial read" errors in the record header (when READING_HEADER flag
is set) - unread part is bzero'ed
- Note: out-of-cache reads are disabled for shared IO_CACHE's
+ Note: out-of-cache reads are enabled for shared IO_CACHE's too,
+ as these reads will be cached by OS cache (and my_pread is always atomic)
*/
@@ -43,7 +44,7 @@ int _mi_read_cache(IO_CACHE *info, byte *buff, my_off_t pos, uint length,
char *in_buff_pos;
DBUG_ENTER("_mi_read_cache");
- if (pos < info->pos_in_file && ! info->share)
+ if (pos < info->pos_in_file)
{
read_length=length;
if ((my_off_t) read_length > (my_off_t) (info->pos_in_file-pos))
@@ -70,7 +71,7 @@ int _mi_read_cache(IO_CACHE *info, byte *buff, my_off_t pos, uint length,
}
else
in_buff_length=0;
- if (flag & READING_NEXT || info->share)
+ if (flag & READING_NEXT)
{
if (pos != (info->pos_in_file +
(uint) (info->read_end - info->request_pos)))
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index abd6cdde657..d3000f63126 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -905,7 +905,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
goto err;
start_recpos=pos;
splits++;
- VOID(_mi_pack_get_block_info(info,&block_info, -1, start_recpos, NullS));
+ VOID(_mi_pack_get_block_info(info,&block_info, -1, start_recpos));
pos=block_info.filepos+block_info.rec_len;
if (block_info.rec_len < (uint) info->s->min_pack_length ||
block_info.rec_len > (uint) info->s->max_pack_length)
@@ -2115,7 +2115,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
const char * name, int rep_quick)
{
int got_error;
- uint i,key, total_key_length;
+ uint i,key, total_key_length, istep;
ulong rec_length;
ha_rows start_records;
my_off_t new_header_length,del;
@@ -2250,8 +2250,8 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
info->state->records=info->state->del=share->state.split=0;
info->state->empty=0;
- for (i=key=0 ; key < share->base.keys ;
- rec_per_key_part+=sort_param[i].keyinfo->keysegs, i++, key++)
+ for (i=key=0, istep=1 ; key < share->base.keys ;
+ rec_per_key_part+=sort_param[i].keyinfo->keysegs, i+=istep, key++)
{
sort_param[i].key=key;
sort_param[i].keyinfo=share->keyinfo+key;
@@ -2262,9 +2262,10 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
(char*) (share->state.rec_per_key_part+
(uint) (rec_per_key_part - param->rec_per_key_part)),
sort_param[i].keyinfo->keysegs*sizeof(*rec_per_key_part));
- i--;
+ istep=0;
continue;
}
+ istep=1;
if ((!(param->testflag & T_SILENT)))
printf ("- Fixing index %d\n",key+1);
if (sort_param[i].keyinfo->flag & HA_FULLTEXT)
@@ -2887,7 +2888,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
DBUG_RETURN(1); /* Something wrong with data */
}
sort_param->start_recpos=sort_param->pos;
- if (_mi_pack_get_block_info(info,&block_info,-1,sort_param->pos, NullS))
+ if (_mi_pack_get_block_info(info,&block_info,-1,sort_param->pos))
DBUG_RETURN(-1);
if (!block_info.rec_len &&
sort_param->pos + MEMMAP_EXTRA_MARGIN ==
diff --git a/myisam/mi_open.c b/myisam/mi_open.c
index 4eb7376cdb6..406facec164 100644
--- a/myisam/mi_open.c
+++ b/myisam/mi_open.c
@@ -116,7 +116,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
DBUG_PRINT("error",("Wrong header in %s",name_buff));
DBUG_DUMP("error_dump",(char*) share->state.header.file_version,
head_length);
- my_errno=HA_ERR_WRONG_TABLE_DEF;
+ my_errno=HA_ERR_NOT_A_TABLE;
goto err;
}
share->options= mi_uint2korr(share->state.header.options);
diff --git a/myisam/mi_packrec.c b/myisam/mi_packrec.c
index 818788a5e74..66cfd169026 100644
--- a/myisam/mi_packrec.c
+++ b/myisam/mi_packrec.c
@@ -416,8 +416,7 @@ int _mi_read_pack_record(MI_INFO *info, my_off_t filepos, byte *buf)
DBUG_RETURN(-1); /* _search() didn't find record */
file=info->dfile;
- if (_mi_pack_get_block_info(info, &block_info, file, filepos,
- info->rec_buff))
+ if (_mi_pack_get_block_info(info, &block_info, file, filepos))
goto err;
if (my_read(file,(byte*) info->rec_buff + block_info.offset ,
block_info.rec_len - block_info.offset, MYF(MY_NABP)))
@@ -963,11 +962,10 @@ int _mi_read_rnd_pack_record(MI_INFO *info, byte *buf,
if (_mi_read_cache(&info->rec_cache,(byte*) block_info.header,filepos,
share->pack.ref_length, skip_deleted_blocks))
goto err;
- b_type=_mi_pack_get_block_info(info,&block_info,-1, filepos, NullS);
+ b_type=_mi_pack_get_block_info(info,&block_info,-1, filepos);
}
else
- b_type=_mi_pack_get_block_info(info,&block_info,info->dfile,filepos,
- info->rec_buff);
+ b_type=_mi_pack_get_block_info(info,&block_info,info->dfile,filepos);
if (b_type)
goto err; /* Error code is already set */
#ifndef DBUG_OFF
@@ -1007,7 +1005,7 @@ int _mi_read_rnd_pack_record(MI_INFO *info, byte *buf,
/* Read and process header from a huff-record-file */
uint _mi_pack_get_block_info(MI_INFO *myisam, MI_BLOCK_INFO *info, File file,
- my_off_t filepos, char *rec_buff)
+ my_off_t filepos)
{
uchar *header=info->header;
uint head_length,ref_length;
@@ -1067,7 +1065,7 @@ uint _mi_pack_get_block_info(MI_INFO *myisam, MI_BLOCK_INFO *info, File file,
if (file > 0)
{
info->offset=min(info->rec_len, ref_length - head_length);
- memcpy(rec_buff, header+head_length, info->offset);
+ memcpy(myisam->rec_buff, header+head_length, info->offset);
}
return 0;
}
diff --git a/myisam/mi_test3.c b/myisam/mi_test3.c
index c2cee12978e..defe041a99f 100644
--- a/myisam/mi_test3.c
+++ b/myisam/mi_test3.c
@@ -16,6 +16,8 @@
/* Test av locking */
+#ifndef __NETWARE__
+
#include "myisam.h"
#include <sys/types.h>
#ifdef HAVE_SYS_WAIT_H
@@ -485,3 +487,15 @@ int test_update(MI_INFO *file,int id,int lock_type)
printf("%2d: update: %5d\n",id,update); fflush(stdout);
return 0;
}
+
+#else /* __NETWARE__ */
+
+#include <stdio.h>
+
+main()
+{
+ fprintf(stderr,"this test has not been ported to NetWare\n");
+ return 0;
+}
+
+#endif /* __NETWARE__ */
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c
index bbeef27d81b..0a5aa889a1a 100644
--- a/myisam/myisamchk.c
+++ b/myisam/myisamchk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -750,7 +750,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
case HA_ERR_CRASHED:
mi_check_print_error(param,"'%s' doesn't have a correct index definition. You need to recreate it before you can do a repair",filename);
break;
- case HA_ERR_WRONG_TABLE_DEF:
+ case HA_ERR_NOT_A_TABLE:
mi_check_print_error(param,"'%s' is not a MyISAM-table",filename);
break;
case HA_ERR_CRASHED_ON_USAGE:
@@ -875,7 +875,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
else
{
if (share->state.header.fulltext_keys)
- ft_init_stopwords(ft_precompiled_stopwords);
+ ft_init_stopwords();
if (!(param->testflag & T_READONLY))
lock_type = F_WRLCK; /* table is changed */
diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h
index e9485048959..ad07da12c12 100644
--- a/myisam/myisamdef.h
+++ b/myisam/myisamdef.h
@@ -641,8 +641,7 @@ extern "C" {
extern uint _mi_get_block_info(MI_BLOCK_INFO *,File, my_off_t);
extern uint _mi_rec_pack(MI_INFO *info,byte *to,const byte *from);
-extern uint _mi_pack_get_block_info(MI_INFO *mysql, MI_BLOCK_INFO *, File,
- my_off_t, char *rec_buf);
+extern uint _mi_pack_get_block_info(MI_INFO *, MI_BLOCK_INFO *, File, my_off_t);
extern void _my_store_blob_length(byte *pos,uint pack_length,uint length);
extern void _myisam_log(enum myisam_log_commands command,MI_INFO *info,
const byte *buffert,uint length);