summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2002-12-05 19:38:42 +0200
committermonty@mashka.mysql.fi <>2002-12-05 19:38:42 +0200
commit859b68847666823baa328c5c7f3da96787807bb3 (patch)
tree56f9dc35fe3c9e6c4f341e577ff3db68855d9e81 /myisam
parent564487d7c00098e8a37c8e675197414667685452 (diff)
parent496a0e1630f9dc4047fb5244cb87ee5ca03b409e (diff)
downloadmariadb-git-859b68847666823baa328c5c7f3da96787807bb3.tar.gz
Merge with 4.0.6
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_check.c12
-rw-r--r--myisam/mi_extra.c4
-rw-r--r--myisam/mi_rnext_same.c5
-rw-r--r--myisam/sort.c22
4 files changed, 24 insertions, 19 deletions
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index d3222a770a8..34222a5703b 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -2329,13 +2329,13 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
for (i=0 ; i < sort_info.total_keys ; i++)
{
sort_param[i].read_cache=param->read_cache;
+ /*
+ two approaches: the same amount of memory for each thread
+ or the memory for the same number of keys for each thread...
+ In the second one all the threads will fill their sort_buffers
+ (and call write_keys) at the same time, putting more stress on i/o.
+ */
sort_param[i].sortbuff_size=
- /*
- two approaches: the same amount of memory for each thread
- or the memory for the same number of keys for each thread...
- In the second one all the threads will fill their sort_buffers
- (and call write_keys) at the same time, putting more stress on i/o.
- */
#ifndef USING_SECOND_APPROACH
param->sort_buffer_length/sort_info.total_keys;
#else
diff --git a/myisam/mi_extra.c b/myisam/mi_extra.c
index 39eb4b0bd99..d7a3aea516d 100644
--- a/myisam/mi_extra.c
+++ b/myisam/mi_extra.c
@@ -165,6 +165,10 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
HA_STATE_EXTEND_BLOCK);
}
break;
+ case HA_EXTRA_PREPARE_FOR_UPDATE:
+ if (info->s->data_file_type != DYNAMIC_RECORD)
+ break;
+ /* Remove read/write cache if dynamic rows */
case HA_EXTRA_NO_CACHE:
if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED))
{
diff --git a/myisam/mi_rnext_same.c b/myisam/mi_rnext_same.c
index 88146c89f85..200e715bddc 100644
--- a/myisam/mi_rnext_same.c
+++ b/myisam/mi_rnext_same.c
@@ -28,14 +28,13 @@
int mi_rnext_same(MI_INFO *info, byte *buf)
{
int error;
- uint inx,flag,not_used;
+ uint inx,not_used;
MI_KEYDEF *keyinfo;
DBUG_ENTER("mi_rnext_same");
if ((int) (inx=info->lastinx) < 0 || info->lastpos == HA_OFFSET_ERROR)
DBUG_RETURN(my_errno=HA_ERR_WRONG_INDEX);
keyinfo=info->s->keyinfo+inx;
- flag=SEARCH_BIGGER; /* Read next */
if (fast_mi_readinfo(info))
DBUG_RETURN(my_errno);
@@ -57,7 +56,7 @@ int mi_rnext_same(MI_INFO *info, byte *buf)
for (;;)
{
if ((error=_mi_search_next(info,keyinfo,info->lastkey,
- info->lastkey_length,flag,
+ info->lastkey_length,SEARCH_BIGGER,
info->s->state.key_root[inx])))
break;
if (ha_key_cmp(keyinfo->seg,info->lastkey2,info->lastkey,
diff --git a/myisam/sort.c b/myisam/sort.c
index c9ba0f51d9c..7ad23df9358 100644
--- a/myisam/sort.c
+++ b/myisam/sort.c
@@ -376,7 +376,6 @@ pthread_handler_decl(thr_find_all_keys,arg)
mi_check_print_error(info->sort_info->param,"Sort buffer to small"); /* purecov: tested */
goto err; /* purecov: tested */
}
-// (*info->lock_in_memory)(info->sort_info->param);/* Everything is allocated */
if (info->sort_info->param->testflag & T_VERBOSE)
printf("Key %d - Allocating buffer for %d keys\n",info->key+1,keys);
@@ -456,9 +455,9 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
byte *mergebuf=0;
LINT_INIT(length);
- for (i=0, sinfo=sort_param ; i<sort_info->total_keys ; i++,
- rec_per_key_part+=sinfo->keyinfo->keysegs,
- sinfo++)
+ for (i= 0, sinfo= sort_param ;
+ i < sort_info->total_keys ;
+ i++, rec_per_key_part+=sinfo->keyinfo->keysegs, sinfo++)
{
if (!sinfo->sort_keys)
{
@@ -484,15 +483,18 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
}
}
my_free((gptr) sinfo->sort_keys,MYF(0));
- my_free(mi_get_rec_buff_ptr(info, sinfo->rec_buff), MYF(MY_ALLOW_ZERO_PTR));
+ my_free(mi_get_rec_buff_ptr(info, sinfo->rec_buff),
+ MYF(MY_ALLOW_ZERO_PTR));
sinfo->sort_keys=0;
}
- for (i=0, sinfo=sort_param ; i<sort_info->total_keys ; i++,
- delete_dynamic(&sinfo->buffpek),
- close_cached_file(&sinfo->tempfile),
- close_cached_file(&sinfo->tempfile_for_exceptions),
- sinfo++)
+ for (i= 0, sinfo= sort_param ;
+ i < sort_info->total_keys ;
+ i++,
+ delete_dynamic(&sinfo->buffpek),
+ close_cached_file(&sinfo->tempfile),
+ close_cached_file(&sinfo->tempfile_for_exceptions),
+ sinfo++)
{
if (got_error)
continue;