summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-05-06 01:38:38 +0300
committerunknown <monty@narttu.mysql.fi>2003-05-06 01:38:38 +0300
commitb96aaea7e15642a8f0d9a478e9daabe470cb966d (patch)
treee4e5fa90d35bf2fc106cf0b773a29900579c7daa /myisam
parent03c1ec3d685b60d04b0db274c5201149322ac667 (diff)
downloadmariadb-git-b96aaea7e15642a8f0d9a478e9daabe470cb966d.tar.gz
Removed compiler warnings
Fixed memory leak in new filesort code Optimzed sub selects to use keys with outer references. Increased max tables in join to 62 client/Makefile.am: Remve test programs myisam/mi_check.c: Remove compiler warnings myisam/mi_delete.c: Remove 'rnd' variable to make usage repeatable myisam/mi_open.c: Remove 'rnd' variable to make usage repeatable myisam/mi_write.c: Remove 'rnd' variable to make usage repeatable myisam/myisamdef.h: Remove 'rnd' variable to make usage repeatable myisam/myisamlog.c: Remove 'rnd' variable to make usage repeatable mysql-test/r/subselect.result: new test mysql-test/t/join.test: Updated test mysql-test/t/subselect.test: new test sql/filesort.cc: Added function to free buffers allocated by filesort sql/item.cc: Sub select optimization sql/item_cmpfunc.cc: Sub select optimization sql/item_subselect.cc: Sub select optimization sql/item_sum.cc: Removed compiler warnings sql/item_sum.h: Simple code cleanup sql/log.cc: Removed compiler warning sql/mysql_priv.h: Made table_map ulonglong to allow 62 tables in join sql/records.cc: Moved free of filesort buffers to own function sql/sql_select.cc: subselect optimization Call filesort_free_buffers() to free memory from filesort sql/unireg.h: Sub select optimization
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_check.c12
-rw-r--r--myisam/mi_delete.c2
-rw-r--r--myisam/mi_open.c4
-rw-r--r--myisam/mi_write.c3
-rw-r--r--myisam/myisamdef.h1
-rw-r--r--myisam/myisamlog.c6
6 files changed, 11 insertions, 17 deletions
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index 73bdcea9cc3..75f2a6c83c4 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -3117,7 +3117,8 @@ int sort_ft_buf_flush(MI_SORT_PARAM *sort_param)
SORT_INFO *sort_info=sort_param->sort_info;
SORT_KEY_BLOCKS *key_block=sort_info->key_block;
MYISAM_SHARE *share=sort_info->info->s;
- uint val_off, val_len, error;
+ uint val_off, val_len;
+ int error;
SORT_FT_BUF *ft_buf=sort_info->ft_buf;
uchar *from, *to;
@@ -3126,14 +3127,17 @@ int sort_ft_buf_flush(MI_SORT_PARAM *sort_param)
to=ft_buf->lastkey+val_off;
if (ft_buf->buf)
- { /* flushing first-level tree */
- error=sort_insert_key(sort_param,key_block,ft_buf->lastkey,HA_OFFSET_ERROR);
+ {
+ /* flushing first-level tree */
+ error=sort_insert_key(sort_param,key_block,ft_buf->lastkey,
+ HA_OFFSET_ERROR);
for (from=to+val_len;
!error && from < ft_buf->buf;
from+= val_len)
{
memcpy(to, from, val_len);
- error=sort_insert_key(sort_param,key_block,ft_buf->lastkey,HA_OFFSET_ERROR);
+ error=sort_insert_key(sort_param,key_block,ft_buf->lastkey,
+ HA_OFFSET_ERROR);
}
return error;
}
diff --git a/myisam/mi_delete.c b/myisam/mi_delete.c
index 96c6400f078..36dd0d2d62c 100644
--- a/myisam/mi_delete.c
+++ b/myisam/mi_delete.c
@@ -491,7 +491,7 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
if (info->s->keyinfo+info->lastinx == keyinfo)
info->page_changed=1;
- if ((keypos < anc_buff+anc_length && (share->rnd++ & 1)) ||
+ if ((keypos < anc_buff+anc_length && (info->state->records & 1)) ||
keypos == anc_buff+2+key_reflength)
{ /* Use page right of anc-page */
DBUG_PRINT("test",("use right page"));
diff --git a/myisam/mi_open.c b/myisam/mi_open.c
index a2602abea5d..a1ce135f02f 100644
--- a/myisam/mi_open.c
+++ b/myisam/mi_open.c
@@ -427,10 +427,6 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
share->kfile=kfile;
share->this_process=(ulong) getpid();
- share->rnd= (int) share->this_process; /* rnd-counter for splits */
-#ifndef DBUG_OFF
- share->rnd=0; /* To make things repeatable */
-#endif
share->last_process= share->state.process;
share->base.key_parts=key_parts;
share->base.all_key_parts=key_parts+unique_key_parts;
diff --git a/myisam/mi_write.c b/myisam/mi_write.c
index 59b4f0d29c3..6985dac7832 100644
--- a/myisam/mi_write.c
+++ b/myisam/mi_write.c
@@ -662,7 +662,8 @@ static int _mi_balance_page(register MI_INFO *info, MI_KEYDEF *keyinfo,
curr_keylength=k_length+nod_flag;
info->page_changed=1;
- if ((father_key_pos != father_buff+father_length && (info->s->rnd++ & 1)) ||
+ if ((father_key_pos != father_buff+father_length &&
+ (info->state->records & 1)) ||
father_key_pos == father_buff+2+info->s->base.key_reflength)
{
right=1;
diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h
index 25f2969a973..50320f1ecbd 100644
--- a/myisam/myisamdef.h
+++ b/myisam/myisamdef.h
@@ -193,7 +193,6 @@ typedef struct st_mi_isam_share { /* Shared between opens */
uint w_locks,r_locks,tot_locks; /* Number of read/write locks */
uint blocksize; /* blocksize of keyfile */
myf write_flag;
- int rnd; /* rnd-counter */
enum data_file_type data_file_type;
my_bool changed, /* If changed since lock */
global_changed, /* If changed since open */
diff --git a/myisam/myisamlog.c b/myisam/myisamlog.c
index d7fb3f24b85..4bb7cc55d30 100644
--- a/myisam/myisamlog.c
+++ b/myisam/myisamlog.c
@@ -448,10 +448,6 @@ static int examine_log(my_string file_name, char **table_names)
goto end;
files_open++;
file_info.closed=0;
- if (opt_myisam_with_debug)
- file_info.isam->s->rnd= 0;
- else
- file_info.isam->s->rnd= isamlog_process;
}
VOID(tree_insert(&tree, (gptr) &file_info, 0, tree.custom_arg));
if (file_info.used)
@@ -806,7 +802,6 @@ static int close_some_file(TREE *tree)
(void*) &access_param,left_root_right));
if (!access_param.found)
return 1; /* No open file that is possibly to close */
- access_param.found->rnd=access_param.found->isam->s->rnd;
if (mi_close(access_param.found->isam))
return 1;
access_param.found->closed=1;
@@ -826,7 +821,6 @@ static int reopen_closed_file(TREE *tree, struct file_info *fileinfo)
if (!(fileinfo->isam= mi_open(name,O_RDWR,HA_OPEN_WAIT_IF_LOCKED)))
return 1;
fileinfo->closed=0;
- fileinfo->isam->s->rnd=fileinfo->rnd;
re_open_count++;
return 0;
}