summaryrefslogtreecommitdiff
path: root/myisammrg/myrg_queue.c
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2000-09-21 01:58:38 +0300
committerunknown <monty@donna.mysql.com>2000-09-21 01:58:38 +0300
commit43044b685f765718f5f90ac26fa3e2317b5749e9 (patch)
treee2dd869fb38dfdf7e26817e7b0f7a7a6add22758 /myisammrg/myrg_queue.c
parent73826420c3114dad809c2c051ba60a6e3f50ee20 (diff)
downloadmariadb-git-43044b685f765718f5f90ac26fa3e2317b5749e9.tar.gz
Fix for SAFE_MUTEX + MERGE tables
Docs/manual.texi: Fix for release include/my_pthread.h: Fix for SAFE_MUTEX for windows include/myisammrg.h: Fix for empty MERGE tables myisam/ft_stopwords.c: Free used memory myisammrg/myrg_open.c: Fix for empty MERGE tables myisammrg/myrg_queue.c: Fix for empty MERGE tables myisammrg/myrg_rfirst.c: cleanup myisammrg/myrg_rkey.c: cleanup mysys/my_thr_init.c: Fix SAFE_MUTEX for windows mysys/my_winthread.c: Fix SAFE_MUTEX for windows mysys/thr_mutex.c: Fix SAFE_MUTEX for windows sql/ha_myisammrg.cc: Fix for empty MERGE tables sql/mysqld.cc: Fix type
Diffstat (limited to 'myisammrg/myrg_queue.c')
-rw-r--r--myisammrg/myrg_queue.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/myisammrg/myrg_queue.c b/myisammrg/myrg_queue.c
index 4d94f984722..d6f831db48c 100644
--- a/myisammrg/myrg_queue.c
+++ b/myisammrg/myrg_queue.c
@@ -34,21 +34,24 @@ int _myrg_init_queue(MYRG_INFO *info,int inx,enum ha_rkey_function search_flag)
int error=0;
QUEUE *q= &(info->by_key);
- if (!is_queue_inited(q))
+ if (inx < (int) info->keys)
{
- if (init_queue(q,info->tables, 0,
- (myisam_readnext_vec[search_flag] == SEARCH_SMALLER),
- queue_key_cmp,
- info->open_tables->table->s->keyinfo[inx].seg))
- error=my_errno;
- }
- else
- {
- if (reinit_queue(q,info->tables, 0,
- (myisam_readnext_vec[search_flag] == SEARCH_SMALLER),
- queue_key_cmp,
- info->open_tables->table->s->keyinfo[inx].seg))
- error=my_errno;
+ if (!is_queue_inited(q))
+ {
+ if (init_queue(q,info->tables, 0,
+ (myisam_readnext_vec[search_flag] == SEARCH_SMALLER),
+ queue_key_cmp,
+ info->open_tables->table->s->keyinfo[inx].seg))
+ error=my_errno;
+ }
+ else
+ {
+ if (reinit_queue(q,info->tables, 0,
+ (myisam_readnext_vec[search_flag] == SEARCH_SMALLER),
+ queue_key_cmp,
+ info->open_tables->table->s->keyinfo[inx].seg))
+ error=my_errno;
+ }
}
return error;
}