diff options
author | unknown <serg@serg.mysql.com> | 2000-12-07 00:18:46 +0100 |
---|---|---|
committer | unknown <serg@serg.mysql.com> | 2000-12-07 00:18:46 +0100 |
commit | 1ad29ca9228d042f462a2bbc67d35863c7f9b8d6 (patch) | |
tree | f0172afdd76dceaf5fcbd2bf0b5300d34889e369 /myisammrg | |
parent | 84eac0e79278f556bd5919397defa990dafa8da9 (diff) | |
download | mariadb-git-1ad29ca9228d042f462a2bbc67d35863c7f9b8d6.tar.gz |
myrg_rrnd.c merge + insert OK
myrg_info.c merge + insert OK
mymrgdef.h merge + insert OK
mrg000001.test test for the above
mysql-test-run compatibility (FreeBSD) changes from mysql-4.0 backpropagated
mysql-test/mysql-test-run:
compatibility (FreeBSD) changes from mysql-4.0 backpropagated
myisammrg/mymrgdef.h:
merge + insert OK
myisammrg/myrg_info.c:
merge + insert OK
myisammrg/myrg_rrnd.c:
merge + insert OK
Diffstat (limited to 'myisammrg')
-rw-r--r-- | myisammrg/mymrgdef.h | 8 | ||||
-rw-r--r-- | myisammrg/myrg_info.c | 8 | ||||
-rw-r--r-- | myisammrg/myrg_rrnd.c | 26 |
3 files changed, 22 insertions, 20 deletions
diff --git a/myisammrg/mymrgdef.h b/myisammrg/mymrgdef.h index 564900614e2..bfa24c778f4 100644 --- a/myisammrg/mymrgdef.h +++ b/myisammrg/mymrgdef.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -30,3 +30,5 @@ extern pthread_mutex_t THR_LOCK_open; int _myrg_init_queue(MYRG_INFO *info,int inx,enum ha_rkey_function search_flag); int _myrg_finish_scan(MYRG_INFO *info, int inx, enum ha_rkey_function type); +MYRG_TABLE *_myrg_find_table(MYRG_INFO *info, ulonglong pos); + diff --git a/myisammrg/myrg_info.c b/myisammrg/myrg_info.c index 959a34935fd..e556c807dfa 100644 --- a/myisammrg/myrg_info.c +++ b/myisammrg/myrg_info.c @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -35,6 +35,8 @@ int myrg_status(MYRG_INFO *info,register MYMERGE_INFO *x,int flag) MYRG_TABLE *current_table; DBUG_ENTER("myrg_status"); + _myrg_find_table(info, HA_OFFSET_ERROR); + if (!(current_table = info->current_table) && info->open_tables != info->end_table) current_table = info->open_tables; diff --git a/myisammrg/myrg_rrnd.c b/myisammrg/myrg_rrnd.c index c64f48c93cd..298ef112469 100644 --- a/myisammrg/myrg_rrnd.c +++ b/myisammrg/myrg_rrnd.c @@ -21,8 +21,6 @@ #include "mymrgdef.h" -static MYRG_TABLE *find_table(MYRG_TABLE *start,MYRG_TABLE *end,ulonglong pos); - /* If filepos == HA_OFFSET_ERROR, read next Returns same as mi_rrnd: @@ -80,8 +78,7 @@ int myrg_rrnd(MYRG_INFO *info,byte *buf,ulonglong filepos) isam_info->lastinx= (uint) -1; } } - info->current_table=find_table(info->open_tables, - info->end_table-1,filepos); + info->current_table=_myrg_find_table(info,filepos); isam_info=info->current_table->table; isam_info->update&= HA_STATE_CHANGED; return ((*isam_info->s->read_rnd) @@ -93,18 +90,19 @@ int myrg_rrnd(MYRG_INFO *info,byte *buf,ulonglong filepos) /* Find which table to use according to file-pos */ -static MYRG_TABLE *find_table(MYRG_TABLE *start, MYRG_TABLE *end, - ulonglong pos) +MYRG_TABLE *_myrg_find_table(MYRG_INFO *info, ulonglong pos) { - MYRG_TABLE *mid; + MYRG_TABLE *t; + + info->records=info->del=info->data_file_length=0; - while (start != end) + for (t=info->open_tables ; t < info->end_table ; t++) { - mid=start+((uint) (end-start)+1)/2; - if (mid->file_offset > pos) - end=mid-1; - else - start=mid; + t->file_offset=info->data_file_length; + if (pos < t->file_offset) return t-1; + info->data_file_length+=t->table->state->data_file_length; + info->records+=t->table->state->records; + info->del+=t->table->state->del; } - return start; + return t-1; } |