diff options
Diffstat (limited to 'myisammrg')
-rw-r--r-- | myisammrg/.cvsignore | 3 | ||||
-rw-r--r-- | myisammrg/Makefile.am | 28 | ||||
-rwxr-xr-x | myisammrg/make-ccc | 3 | ||||
-rw-r--r-- | myisammrg/myrg_close.c | 40 | ||||
-rw-r--r-- | myisammrg/myrg_create.c | 72 | ||||
-rw-r--r-- | myisammrg/myrg_def.h | 33 | ||||
-rw-r--r-- | myisammrg/myrg_delete.c | 27 | ||||
-rw-r--r-- | myisammrg/myrg_extra.c | 68 | ||||
-rw-r--r-- | myisammrg/myrg_info.c | 68 | ||||
-rw-r--r-- | myisammrg/myrg_locking.c | 33 | ||||
-rw-r--r-- | myisammrg/myrg_open.c | 172 | ||||
-rw-r--r-- | myisammrg/myrg_panic.c | 46 | ||||
-rw-r--r-- | myisammrg/myrg_queue.c | 79 | ||||
-rw-r--r-- | myisammrg/myrg_range.c | 36 | ||||
-rw-r--r-- | myisammrg/myrg_rfirst.c | 49 | ||||
-rw-r--r-- | myisammrg/myrg_rkey.c | 94 | ||||
-rw-r--r-- | myisammrg/myrg_rlast.c | 50 | ||||
-rw-r--r-- | myisammrg/myrg_rnext.c | 53 | ||||
-rw-r--r-- | myisammrg/myrg_rnext_same.c | 51 | ||||
-rw-r--r-- | myisammrg/myrg_rprev.c | 53 | ||||
-rw-r--r-- | myisammrg/myrg_rrnd.c | 117 | ||||
-rw-r--r-- | myisammrg/myrg_rsame.c | 28 | ||||
-rw-r--r-- | myisammrg/myrg_static.c | 30 | ||||
-rw-r--r-- | myisammrg/myrg_update.c | 27 | ||||
-rw-r--r-- | myisammrg/myrg_write.c | 30 |
25 files changed, 0 insertions, 1290 deletions
diff --git a/myisammrg/.cvsignore b/myisammrg/.cvsignore deleted file mode 100644 index e9955884756..00000000000 --- a/myisammrg/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -.deps -Makefile -Makefile.in diff --git a/myisammrg/Makefile.am b/myisammrg/Makefile.am deleted file mode 100644 index 14e3295c1ae..00000000000 --- a/myisammrg/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -# 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 - -INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -pkglib_LIBRARIES = libmyisammrg.a -noinst_HEADERS = myrg_def.h -libmyisammrg_a_SOURCES = myrg_open.c myrg_extra.c myrg_info.c myrg_locking.c \ - myrg_rrnd.c myrg_update.c myrg_delete.c myrg_rsame.c \ - myrg_panic.c myrg_close.c myrg_create.c myrg_static.c \ - myrg_rkey.c myrg_rfirst.c myrg_rlast.c myrg_rnext.c \ - myrg_rprev.c myrg_queue.c myrg_write.c myrg_range.c \ - myrg_rnext_same.c - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/myisammrg/make-ccc b/myisammrg/make-ccc deleted file mode 100755 index a7e3dfc3cdb..00000000000 --- a/myisammrg/make-ccc +++ /dev/null @@ -1,3 +0,0 @@ -ccc -I./../include -I../include -DDBUG_OFF -fast -O3 -c myrg_close.c myrg_create.c myrg_delete.c myrg_extra.c myrg_info.c myrg_locking.c myrg_open.c myrg_panic.c myrg_rrnd.c myrg_rsame.c myrg_static.c myrg_update.c -rm libmyisammrg.a -ar -cr libmyisammrg.a myrg_close.o diff --git a/myisammrg/myrg_close.c b/myisammrg/myrg_close.c deleted file mode 100644 index 897020c6865..00000000000 --- a/myisammrg/myrg_close.c +++ /dev/null @@ -1,40 +0,0 @@ -/* 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 */ - -/* close a isam-database */ - -#include "myrg_def.h" - -int myrg_close(MYRG_INFO *info) -{ - int error=0,new_error; - MYRG_TABLE *file; - DBUG_ENTER("myrg_close"); - - for (file=info->open_tables ; file != info->end_table ; file++) - if ((new_error=mi_close(file->table))) - error=new_error; - delete_queue(&info->by_key); - pthread_mutex_lock(&THR_LOCK_open); - myrg_open_list=list_delete(myrg_open_list,&info->open_list); - pthread_mutex_unlock(&THR_LOCK_open); - my_free((gptr) info,MYF(0)); - if (error) - { - DBUG_RETURN(my_errno=error); - } - DBUG_RETURN(0); -} diff --git a/myisammrg/myrg_create.c b/myisammrg/myrg_create.c deleted file mode 100644 index 7ddb7ecb3b9..00000000000 --- a/myisammrg/myrg_create.c +++ /dev/null @@ -1,72 +0,0 @@ -/* 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 */ - -/* Create a MYMERGE_-file */ - -#include "myrg_def.h" - - /* create file named 'name' and save filenames in it - table_names should be NULL or a vector of string-pointers with - a NULL-pointer last - */ - -int myrg_create(const char *name, const char **table_names, - uint insert_method, my_bool fix_names) -{ - int save_errno; - uint errpos; - File file; - char buff[FN_REFLEN],*end; - DBUG_ENTER("myrg_create"); - - errpos=0; - if ((file = my_create(fn_format(buff,name,"",MYRG_NAME_EXT,4),0, - O_RDWR | O_EXCL | O_NOFOLLOW,MYF(MY_WME))) < 0) - goto err; - errpos=1; - if (table_names) - { - for ( ; *table_names ; table_names++) - { - strmov(buff,*table_names); - if (fix_names) - fn_same(buff,name,4); - *(end=strend(buff))='\n'; - end[1]=0; - if (my_write(file,buff,(uint) (end-buff+1), - MYF(MY_WME | MY_NABP))) - goto err; - } - } - if (insert_method != MERGE_INSERT_DISABLED) - { - end=strxmov(buff,"#INSERT_METHOD=", - get_type(&merge_insert_method,insert_method-1),"\n",NullS); - if (my_write(file,buff,(uint) (end-buff),MYF(MY_WME | MY_NABP))) - goto err; - } - if (my_close(file,MYF(0))) - goto err; - DBUG_RETURN(0); - -err: - save_errno=my_errno ? my_errno : -1; - switch (errpos) { - case 1: - VOID(my_close(file,MYF(0))); - } - DBUG_RETURN(my_errno=save_errno); -} /* myrg_create */ diff --git a/myisammrg/myrg_def.h b/myisammrg/myrg_def.h deleted file mode 100644 index 00e7950bccf..00000000000 --- a/myisammrg/myrg_def.h +++ /dev/null @@ -1,33 +0,0 @@ -/* 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 */ - -/* This file is included by all myisam-merge files */ - -#ifndef N_MAXKEY -#include "../myisam/myisamdef.h" -#endif - -#include "myisammrg.h" - -extern LIST *myrg_open_list; - -#ifdef THREAD -extern pthread_mutex_t THR_LOCK_open; -#endif - -int _myrg_init_queue(MYRG_INFO *info,int inx,enum ha_rkey_function search_flag); -int _myrg_mi_read_record(MI_INFO *info, byte *buf); - diff --git a/myisammrg/myrg_delete.c b/myisammrg/myrg_delete.c deleted file mode 100644 index 8b89ed62ac1..00000000000 --- a/myisammrg/myrg_delete.c +++ /dev/null @@ -1,27 +0,0 @@ -/* 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 */ - -/* Delete last read record */ - -#include "myrg_def.h" - -int myrg_delete(MYRG_INFO *info, const byte *record) -{ - if (!info->current_table) - return (my_errno= HA_ERR_NO_ACTIVE_RECORD); - - return mi_delete(info->current_table->table,record); -} diff --git a/myisammrg/myrg_extra.c b/myisammrg/myrg_extra.c deleted file mode 100644 index 62cf5f01aba..00000000000 --- a/myisammrg/myrg_extra.c +++ /dev/null @@ -1,68 +0,0 @@ -/* 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 */ - -/* - Extra functions we want to do with a database - - All flags, exept record-cache-flags, are set in all used databases - record-cache-flags are set in myrg_rrnd when we are changing database. -*/ - -#include "myrg_def.h" - -int myrg_extra(MYRG_INFO *info,enum ha_extra_function function, - void *extra_arg) -{ - int error,save_error=0; - MYRG_TABLE *file; - DBUG_ENTER("myrg_extra"); - DBUG_PRINT("info",("function: %d",(ulong) function)); - - if (function == HA_EXTRA_CACHE) - { - info->cache_in_use=1; - info->cache_size= (extra_arg ? *(ulong*) extra_arg : - my_default_record_cache_size); - } - else - { - if (function == HA_EXTRA_NO_CACHE || function == HA_EXTRA_RESET || - function == HA_EXTRA_PREPARE_FOR_UPDATE) - info->cache_in_use=0; - if (function == HA_EXTRA_RESET || function == HA_EXTRA_RESET_STATE) - { - info->current_table=0; - info->last_used_table=info->open_tables; - } - for (file=info->open_tables ; file != info->end_table ; file++) - { - if ((error=mi_extra(file->table, function, extra_arg))) - save_error=error; - } - } - DBUG_RETURN(save_error); -} - - -void myrg_extrafunc(MYRG_INFO *info, invalidator_by_filename inv) -{ - MYRG_TABLE *file; - DBUG_ENTER("myrg_extrafunc"); - - for (file=info->open_tables ; file != info->end_table ; file++) - file->table->s->invalidator = inv; - - DBUG_VOID_RETURN; -} diff --git a/myisammrg/myrg_info.c b/myisammrg/myrg_info.c deleted file mode 100644 index ba840ac444b..00000000000 --- a/myisammrg/myrg_info.c +++ /dev/null @@ -1,68 +0,0 @@ -/* 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 */ - -#include "myrg_def.h" - -ulonglong myrg_position(MYRG_INFO *info) -{ - MYRG_TABLE *current_table; - - if (!(current_table = info->current_table) && - info->open_tables != info->end_table) - current_table = info->open_tables; - return current_table ? - current_table->table->lastpos + current_table->file_offset : - ~(ulonglong) 0; -} - -int myrg_status(MYRG_INFO *info,register MYMERGE_INFO *x,int flag) -{ - MYRG_TABLE *current_table; - DBUG_ENTER("myrg_status"); - - if (!(current_table = info->current_table) && - info->open_tables != info->end_table) - current_table = info->open_tables; - x->recpos = info->current_table ? - info->current_table->table->lastpos + info->current_table->file_offset : - (ulong) -1L; - if (flag != HA_STATUS_POS) - { - MYRG_TABLE *file; - - info->records=info->del=info->data_file_length=0; - for (file=info->open_tables ; file != info->end_table ; file++) - { - file->file_offset=info->data_file_length; - info->data_file_length+=file->table->s->state.state.data_file_length; - info->records+=file->table->s->state.state.records; - info->del+=file->table->s->state.state.del; - DBUG_PRINT("info2",("table: %s, offset: %lu", - file->table->filename,(ulong) file->file_offset)); - } - x->records= info->records; - x->deleted= info->del; - x->data_file_length= info->data_file_length; - x->reclength= info->reclength; - x->options= info->options; - if (current_table) - x->errkey= current_table->table->errkey; - else - x->errkey= 0; - x->rec_per_key = info->rec_per_key_part; - } - DBUG_RETURN(0); -} diff --git a/myisammrg/myrg_locking.c b/myisammrg/myrg_locking.c deleted file mode 100644 index e5a8d3f3d9d..00000000000 --- a/myisammrg/myrg_locking.c +++ /dev/null @@ -1,33 +0,0 @@ -/* 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 */ - -/* - Lock databases against read or write. -*/ - -#include "myrg_def.h" - -int myrg_lock_database(MYRG_INFO *info, int lock_type) -{ - int error,new_error; - MYRG_TABLE *file; - - error=0; - for (file=info->open_tables ; file != info->end_table ; file++) - if ((new_error=mi_lock_database(file->table,lock_type))) - error=new_error; - return(error); -} diff --git a/myisammrg/myrg_open.c b/myisammrg/myrg_open.c deleted file mode 100644 index f9cdc2bb205..00000000000 --- a/myisammrg/myrg_open.c +++ /dev/null @@ -1,172 +0,0 @@ -/* 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 */ - -/* open a MyISAM MERGE table */ - -#include "myrg_def.h" -#include <stddef.h> -#include <errno.h> -#ifdef VMS -#include "mrg_static.c" -#endif - -/* - open a MyISAM MERGE table - if handle_locking is 0 then exit with error if some table is locked - if handle_locking is 1 then wait if table is locked -*/ - - -MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking) -{ - int save_errno,errpos=0; - uint files=0,i,dir_length,length,key_parts; - ulonglong file_offset=0; - char name_buff[FN_REFLEN*2],buff[FN_REFLEN],*end; - MYRG_INFO *m_info=0; - File fd; - IO_CACHE file; - MI_INFO *isam=0; - uint found_merge_insert_method= 0; - DBUG_ENTER("myrg_open"); - - LINT_INIT(key_parts); - - bzero((char*) &file,sizeof(file)); - if ((fd=my_open(fn_format(name_buff,name,"",MYRG_NAME_EXT,4), - O_RDONLY | O_SHARE,MYF(0))) < 0) - goto err; - errpos=1; - if (init_io_cache(&file, fd, 4*IO_SIZE, READ_CACHE, 0, 0, - MYF(MY_WME | MY_NABP))) - goto err; - errpos=2; - dir_length=dirname_part(name_buff,name); - while ((length=my_b_gets(&file,buff,FN_REFLEN-1))) - { - if ((end=buff+length)[-1] == '\n') - end[-1]='\0'; - if (buff[0] && buff[0] != '#') - files++; - } - - my_b_seek(&file, 0); - while ((length=my_b_gets(&file,buff,FN_REFLEN-1))) - { - if ((end=buff+length)[-1] == '\n') - *--end='\0'; - if (!buff[0]) - continue; /* Skip empty lines */ - if (buff[0] == '#') - { - if (!strncmp(buff+1,"INSERT_METHOD=",14)) - { /* Lookup insert method */ - int tmp=find_type(buff+15,&merge_insert_method,2); - found_merge_insert_method = (uint) (tmp >= 0 ? tmp : 0); - } - continue; /* Skip comments */ - } - - if (!has_path(buff)) - { - VOID(strmake(name_buff+dir_length,buff, - sizeof(name_buff)-1-dir_length)); - VOID(cleanup_dirname(buff,name_buff)); - } - else - fn_format(buff, buff, "", "", 0); - if (!(isam=mi_open(buff,mode,(handle_locking?HA_OPEN_WAIT_IF_LOCKED:0)))) - goto err; - if (!m_info) /* First file */ - { - key_parts=isam->s->base.key_parts; - if (!(m_info= (MYRG_INFO*) my_malloc(sizeof(MYRG_INFO) + - files*sizeof(MYRG_TABLE) + - key_parts*sizeof(long), - MYF(MY_WME|MY_ZEROFILL)))) - goto err; - if (files) - { - m_info->open_tables=(MYRG_TABLE *) (m_info+1); - m_info->rec_per_key_part=(ulong *) (m_info->open_tables+files); - m_info->tables= files; - files= 0; - } - m_info->reclength=isam->s->base.reclength; - errpos=3; - } - m_info->open_tables[files].table= isam; - m_info->open_tables[files].file_offset=(my_off_t) file_offset; - file_offset+=isam->state->data_file_length; - files++; - if (m_info->reclength != isam->s->base.reclength) - { - my_errno=HA_ERR_WRONG_MRG_TABLE_DEF; - goto err; - } - m_info->options|= isam->s->options; - m_info->records+= isam->state->records; - m_info->del+= isam->state->del; - m_info->data_file_length+= isam->state->data_file_length; - for (i=0; i < key_parts; i++) - m_info->rec_per_key_part[i]+= (isam->s->state.rec_per_key_part[i] / - m_info->tables); - } - - if (!m_info && !(m_info= (MYRG_INFO*) my_malloc(sizeof(MYRG_INFO), - MYF(MY_WME | MY_ZEROFILL)))) - goto err; - /* Don't mark table readonly, for ALTER TABLE ... UNION=(...) to work */ - m_info->options&= ~(HA_OPTION_COMPRESS_RECORD | HA_OPTION_READ_ONLY_DATA); - m_info->merge_insert_method= found_merge_insert_method; - - if (sizeof(my_off_t) == 4 && file_offset > (ulonglong) (ulong) ~0L) - { - my_errno=HA_ERR_RECORD_FILE_FULL; - goto err; - } - m_info->keys= files ? isam->s->base.keys : 0; - bzero((char*) &m_info->by_key,sizeof(m_info->by_key)); - - /* this works ok if the table list is empty */ - m_info->end_table=m_info->open_tables+files; - m_info->last_used_table=m_info->open_tables; - - VOID(my_close(fd,MYF(0))); - end_io_cache(&file); - m_info->open_list.data=(void*) m_info; - pthread_mutex_lock(&THR_LOCK_open); - myrg_open_list=list_add(myrg_open_list,&m_info->open_list); - pthread_mutex_unlock(&THR_LOCK_open); - DBUG_RETURN(m_info); - -err: - save_errno=my_errno; - switch (errpos) { - case 3: - while (files) - mi_close(m_info->open_tables[--files].table); - my_free((char*) m_info,MYF(0)); - /* Fall through */ - case 2: - end_io_cache(&file); - /* Fall through */ - case 1: - VOID(my_close(fd,MYF(0))); - } - my_errno=save_errno; - DBUG_RETURN (NULL); -} diff --git a/myisammrg/myrg_panic.c b/myisammrg/myrg_panic.c deleted file mode 100644 index ab08b8082c3..00000000000 --- a/myisammrg/myrg_panic.c +++ /dev/null @@ -1,46 +0,0 @@ -/* 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 */ - -#include "myrg_def.h" - - /* if flag == HA_PANIC_CLOSE then all misam files are closed */ - /* if flag == HA_PANIC_WRITE then all misam files are unlocked and - all changed data in single user misam is written to file */ - /* if flag == HA_PANIC_READ then all misam files that was locked when - mi_panic(HA_PANIC_WRITE) was done is locked. A mi_readinfo() is - done for all single user files to get changes in database */ - - -int myrg_panic(enum ha_panic_function flag) -{ - int error=0; - LIST *list_element,*next_open; - MYRG_INFO *info; - DBUG_ENTER("myrg_panic"); - - for (list_element=myrg_open_list ; list_element ; list_element=next_open) - { - next_open=list_element->next; /* Save if close */ - info=(MYRG_INFO*) list_element->data; - if (flag == HA_PANIC_CLOSE && myrg_close(info)) - error=my_errno; - } - if (myrg_open_list && flag != HA_PANIC_CLOSE) - DBUG_RETURN(mi_panic(flag)); - if (error) - my_errno=error; - DBUG_RETURN(error); -} diff --git a/myisammrg/myrg_queue.c b/myisammrg/myrg_queue.c deleted file mode 100644 index 2e600a526c0..00000000000 --- a/myisammrg/myrg_queue.c +++ /dev/null @@ -1,79 +0,0 @@ -/* 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 */ - -#include "myrg_def.h" - -static int queue_key_cmp(void *keyseg, byte *a, byte *b) -{ - MYRG_TABLE *ma= (MYRG_TABLE *)a; - MYRG_TABLE *mb= (MYRG_TABLE *)b; - MI_INFO *aa= ma->table; - MI_INFO *bb= mb->table; - uint not_used[2]; - int ret= ha_key_cmp((HA_KEYSEG *)keyseg, aa->lastkey, bb->lastkey, - USE_WHOLE_KEY, SEARCH_FIND, not_used); - if (ret < 0) - return -1; - if (ret > 0) - return 1; - - /* - If index tuples have the same values, let the record with least rowid - value be "smaller", so index scans return records ordered by (keytuple, - rowid). This is used by index_merge access method, grep for ROR in - sql/opt_range.cc for details. - */ - return (ma->file_offset < mb->file_offset)? -1 : (ma->file_offset > - mb->file_offset) ? 1 : 0; -} /* queue_key_cmp */ - - -int _myrg_init_queue(MYRG_INFO *info,int inx,enum ha_rkey_function search_flag) -{ - int error=0; - QUEUE *q= &(info->by_key); - - if (inx < (int) info->keys) - { - 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; -} - -int _myrg_mi_read_record(MI_INFO *info, byte *buf) -{ - if (!(*info->read_record)(info,info->lastpos,buf)) - { - info->update|= HA_STATE_AKTIV; /* Record is read */ - return 0; - } - return my_errno; -} diff --git a/myisammrg/myrg_range.c b/myisammrg/myrg_range.c deleted file mode 100644 index aafdf70525c..00000000000 --- a/myisammrg/myrg_range.c +++ /dev/null @@ -1,36 +0,0 @@ -/* 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 */ - -#include "myrg_def.h" - -ha_rows myrg_records_in_range(MYRG_INFO *info, int inx, - key_range *min_key, key_range *max_key) -{ - ha_rows records=0, res; - MYRG_TABLE *table; - - for (table=info->open_tables ; table != info->end_table ; table++) - { - res= mi_records_in_range(table->table, inx, min_key, max_key); - if (res == HA_POS_ERROR) - return HA_POS_ERROR; - if (records > HA_POS_ERROR - res) - return HA_POS_ERROR-1; - records+=res; - } - return records; -} - diff --git a/myisammrg/myrg_rfirst.c b/myisammrg/myrg_rfirst.c deleted file mode 100644 index 9ba07686c47..00000000000 --- a/myisammrg/myrg_rfirst.c +++ /dev/null @@ -1,49 +0,0 @@ -/* 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 */ - -#include "myrg_def.h" - - /* Read first row according to specific key */ - -int myrg_rfirst(MYRG_INFO *info, byte *buf, int inx) -{ - MYRG_TABLE *table; - MI_INFO *mi; - int err; - - if (_myrg_init_queue(info,inx,HA_READ_KEY_OR_NEXT)) - return my_errno; - - for (table=info->open_tables ; table != info->end_table ; table++) - { - if ((err=mi_rfirst(table->table,NULL,inx))) - { - if (err == HA_ERR_END_OF_FILE) - continue; - return err; - } - /* adding to queue */ - queue_insert(&(info->by_key),(byte *)table); - } - /* We have done a read in all tables */ - info->last_used_table=table; - - if (!info->by_key.elements) - return HA_ERR_END_OF_FILE; - - mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table; - return _myrg_mi_read_record(mi,buf); -} diff --git a/myisammrg/myrg_rkey.c b/myisammrg/myrg_rkey.c deleted file mode 100644 index f87b264081e..00000000000 --- a/myisammrg/myrg_rkey.c +++ /dev/null @@ -1,94 +0,0 @@ -/* 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 */ - -/* Read record based on a key */ - -/* - * HA_READ_KEY_EXACT => SEARCH_BIGGER - * HA_READ_KEY_OR_NEXT => SEARCH_BIGGER - * HA_READ_AFTER_KEY => SEARCH_BIGGER - * HA_READ_PREFIX => SEARCH_BIGGER - * HA_READ_KEY_OR_PREV => SEARCH_SMALLER - * HA_READ_BEFORE_KEY => SEARCH_SMALLER - * HA_READ_PREFIX_LAST => SEARCH_SMALLER - */ - - -#include "myrg_def.h" - -/* todo: we could store some additional info to speedup lookups: - column (key, keyseg) can be constant per table - it can also be increasing (table1.val > table2.val > ...), - or decreasing, <=, >=, etc. - SerG -*/ - -int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key, - uint key_len, enum ha_rkey_function search_flag) -{ - byte *key_buff; - uint pack_key_length; - MYRG_TABLE *table; - MI_INFO *mi; - int err; - DBUG_ENTER("myrg_rkey"); - LINT_INIT(key_buff); - LINT_INIT(pack_key_length); - - if (_myrg_init_queue(info,inx,search_flag)) - DBUG_RETURN(my_errno); - - for (table=info->open_tables ; table != info->end_table ; table++) - { - mi=table->table; - - if (table == info->open_tables) - { - err=mi_rkey(mi,0,inx,key,key_len,search_flag); - /* Get the saved packed key and packed key length. */ - key_buff=(byte*) mi->lastkey+mi->s->base.max_key_length; - pack_key_length=mi->pack_key_length; - } - else - { - mi->once_flags|= USE_PACKED_KEYS; - err=mi_rkey(mi,0,inx,key_buff,pack_key_length,search_flag); - } - info->last_used_table=table+1; - - if (err) - { - if (err == HA_ERR_KEY_NOT_FOUND) - continue; - DBUG_PRINT("exit", ("err: %d", err)); - DBUG_RETURN(err); - } - /* adding to queue */ - queue_insert(&(info->by_key),(byte *)table); - - } - - DBUG_PRINT("info", ("tables with matches: %u", info->by_key.elements)); - if (!info->by_key.elements) - DBUG_RETURN(HA_ERR_KEY_NOT_FOUND); - - mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table; - mi->once_flags|= RRND_PRESERVE_LASTINX; - DBUG_PRINT("info", ("using table no: %d", - info->current_table - info->open_tables + 1)); - DBUG_DUMP("result key", (byte*) mi->lastkey, mi->lastkey_length); - DBUG_RETURN(_myrg_mi_read_record(mi,buf)); -} diff --git a/myisammrg/myrg_rlast.c b/myisammrg/myrg_rlast.c deleted file mode 100644 index 96bb798bd4f..00000000000 --- a/myisammrg/myrg_rlast.c +++ /dev/null @@ -1,50 +0,0 @@ -/* 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 */ - -#include "myrg_def.h" - - /* Read last row with the same key as the previous read. */ - -int myrg_rlast(MYRG_INFO *info, byte *buf, int inx) -{ - MYRG_TABLE *table; - MI_INFO *mi; - int err; - - if (_myrg_init_queue(info,inx, HA_READ_KEY_OR_PREV)) - return my_errno; - - for (table=info->open_tables ; table < info->end_table ; table++) - { - if ((err=mi_rlast(table->table,NULL,inx))) - { - if (err == HA_ERR_END_OF_FILE) - continue; - return err; - } - /* adding to queue */ - queue_insert(&(info->by_key),(byte *)table); - } - /* We have done a read in all tables */ - info->last_used_table=table; - - if (!info->by_key.elements) - return HA_ERR_END_OF_FILE; - - mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table; - return _myrg_mi_read_record(mi,buf); -} - diff --git a/myisammrg/myrg_rnext.c b/myisammrg/myrg_rnext.c deleted file mode 100644 index 0929c63fc1d..00000000000 --- a/myisammrg/myrg_rnext.c +++ /dev/null @@ -1,53 +0,0 @@ -/* 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 */ - -#include "myrg_def.h" - - /* - Read next row with the same key as previous read - */ - -int myrg_rnext(MYRG_INFO *info, byte *buf, int inx) -{ - int err; - MI_INFO *mi; - - if (!info->current_table) - return (HA_ERR_KEY_NOT_FOUND); - - /* at first, do rnext for the table found before */ - if ((err=mi_rnext(info->current_table->table,NULL,inx))) - { - if (err == HA_ERR_END_OF_FILE) - { - queue_remove(&(info->by_key),0); - if (!info->by_key.elements) - return HA_ERR_END_OF_FILE; - } - else - return err; - } - else - { - /* Found here, adding to queue */ - queue_top(&(info->by_key))=(byte *)(info->current_table); - queue_replaced(&(info->by_key)); - } - - /* now, mymerge's read_next is as simple as one queue_top */ - mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table; - return _myrg_mi_read_record(mi,buf); -} diff --git a/myisammrg/myrg_rnext_same.c b/myisammrg/myrg_rnext_same.c deleted file mode 100644 index 997e4100acd..00000000000 --- a/myisammrg/myrg_rnext_same.c +++ /dev/null @@ -1,51 +0,0 @@ -/* 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 */ - -#include "myrg_def.h" - - -int myrg_rnext_same(MYRG_INFO *info, byte *buf) -{ - int err; - MI_INFO *mi; - - if (!info->current_table) - return (HA_ERR_KEY_NOT_FOUND); - - /* at first, do rnext for the table found before */ - if ((err=mi_rnext_same(info->current_table->table,NULL))) - { - if (err == HA_ERR_END_OF_FILE) - { - queue_remove(&(info->by_key),0); - if (!info->by_key.elements) - return HA_ERR_END_OF_FILE; - } - else - return err; - } - else - { - /* Found here, adding to queue */ - queue_top(&(info->by_key))=(byte *)(info->current_table); - queue_replaced(&(info->by_key)); - } - - /* now, mymerge's read_next is as simple as one queue_top */ - mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table; - return _myrg_mi_read_record(mi,buf); -} - diff --git a/myisammrg/myrg_rprev.c b/myisammrg/myrg_rprev.c deleted file mode 100644 index 797993e903d..00000000000 --- a/myisammrg/myrg_rprev.c +++ /dev/null @@ -1,53 +0,0 @@ -/* 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 */ - -#include "myrg_def.h" - - /* - Read previous row with the same key as previous read - */ - -int myrg_rprev(MYRG_INFO *info, byte *buf, int inx) -{ - int err; - MI_INFO *mi; - - if (!info->current_table) - return (HA_ERR_KEY_NOT_FOUND); - - /* at first, do rprev for the table found before */ - if ((err=mi_rprev(info->current_table->table,NULL,inx))) - { - if (err == HA_ERR_END_OF_FILE) - { - queue_remove(&(info->by_key),0); - if (!info->by_key.elements) - return HA_ERR_END_OF_FILE; - } - else - return err; - } - else - { - /* Found here, adding to queue */ - queue_top(&(info->by_key))=(byte *)(info->current_table); - queue_replaced(&(info->by_key)); - } - - /* now, mymerge's read_prev is as simple as one queue_top */ - mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table; - return _myrg_mi_read_record(mi,buf); -} diff --git a/myisammrg/myrg_rrnd.c b/myisammrg/myrg_rrnd.c deleted file mode 100644 index d623ea8ea9c..00000000000 --- a/myisammrg/myrg_rrnd.c +++ /dev/null @@ -1,117 +0,0 @@ -/* 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 */ - -/* - Read a record with random-access. The position to the record must - get by myrg_info(). The next record can be read with pos= -1 */ - - -#include "myrg_def.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: - 0 = Ok. - HA_ERR_RECORD_DELETED = Record is deleted. - HA_ERR_END_OF_FILE = EOF. -*/ - -int myrg_rrnd(MYRG_INFO *info,byte *buf,ulonglong filepos) -{ - int error; - MI_INFO *isam_info; - DBUG_ENTER("myrg_rrnd"); - DBUG_PRINT("info",("offset: %lu", (ulong) filepos)); - - if (filepos == HA_OFFSET_ERROR) - { - if (!info->current_table) - { - if (info->open_tables == info->end_table) - { /* No tables */ - DBUG_RETURN(my_errno=HA_ERR_END_OF_FILE); - } - isam_info=(info->current_table=info->open_tables)->table; - if (info->cache_in_use) - mi_extra(isam_info,HA_EXTRA_CACHE,(byte*) &info->cache_size); - filepos=isam_info->s->pack.header_length; - isam_info->lastinx= (uint) -1; /* Can't forward or backward */ - } - else - { - isam_info=info->current_table->table; - filepos= isam_info->nextpos; - } - - for (;;) - { - isam_info->update&= HA_STATE_CHANGED; - if ((error=(*isam_info->s->read_rnd)(isam_info,(byte*) buf, - (my_off_t) filepos,1)) != - HA_ERR_END_OF_FILE) - DBUG_RETURN(error); - if (info->cache_in_use) - mi_extra(info->current_table->table, HA_EXTRA_NO_CACHE, - (byte*) &info->cache_size); - if (info->current_table+1 == info->end_table) - DBUG_RETURN(HA_ERR_END_OF_FILE); - info->current_table++; - info->last_used_table=info->current_table; - if (info->cache_in_use) - mi_extra(info->current_table->table, HA_EXTRA_CACHE, - (byte*) &info->cache_size); - info->current_table->file_offset= - info->current_table[-1].file_offset+ - info->current_table[-1].table->state->data_file_length; - - isam_info=info->current_table->table; - filepos=isam_info->s->pack.header_length; - isam_info->lastinx= (uint) -1; - } - } - info->current_table=find_table(info->open_tables, - info->end_table-1,filepos); - isam_info=info->current_table->table; - isam_info->update&= HA_STATE_CHANGED; - DBUG_RETURN((*isam_info->s->read_rnd) - (isam_info, (byte*) buf, - (my_off_t) (filepos - info->current_table->file_offset), - 0)); -} - - - /* Find which table to use according to file-pos */ - -static MYRG_TABLE *find_table(MYRG_TABLE *start, MYRG_TABLE *end, - ulonglong pos) -{ - MYRG_TABLE *mid; - DBUG_ENTER("find_table"); - - while (start != end) - { - mid=start+((uint) (end-start)+1)/2; - if (mid->file_offset > pos) - end=mid-1; - else - start=mid; - } - DBUG_PRINT("info",("offset: %lu, table: %s", - (ulong) pos, start->table->filename)); - DBUG_RETURN(start); -} diff --git a/myisammrg/myrg_rsame.c b/myisammrg/myrg_rsame.c deleted file mode 100644 index f6b2164dc21..00000000000 --- a/myisammrg/myrg_rsame.c +++ /dev/null @@ -1,28 +0,0 @@ -/* 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 */ - -#include "myrg_def.h" - -int myrg_rsame(MYRG_INFO *info,byte *record,int inx) -{ - if (inx) /* not yet used, should be 0 */ - return (my_errno=HA_ERR_WRONG_INDEX); - - if (!info->current_table) - return (my_errno=HA_ERR_NO_ACTIVE_RECORD); - - return mi_rsame(info->current_table->table,record,inx); -} diff --git a/myisammrg/myrg_static.c b/myisammrg/myrg_static.c deleted file mode 100644 index 9e76cbae07b..00000000000 --- a/myisammrg/myrg_static.c +++ /dev/null @@ -1,30 +0,0 @@ -/* 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 */ - -/* - Static variables for pisam library. All definied here for easy making of - a shared library -*/ - -#ifndef stdin -#include "myrg_def.h" -#endif - -LIST *myrg_open_list=0; -static const char *merge_insert_methods[] = -{ "FIRST", "LAST", NullS }; -TYPELIB merge_insert_method= { array_elements(merge_insert_methods)-1,"", - merge_insert_methods, 0}; diff --git a/myisammrg/myrg_update.c b/myisammrg/myrg_update.c deleted file mode 100644 index 7b9f614b965..00000000000 --- a/myisammrg/myrg_update.c +++ /dev/null @@ -1,27 +0,0 @@ -/* 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 */ - -/* Update last read record */ - -#include "myrg_def.h" - -int myrg_update(register MYRG_INFO *info,const byte *oldrec, byte *newrec) -{ - if (!info->current_table) - return (my_errno=HA_ERR_NO_ACTIVE_RECORD); - - return mi_update(info->current_table->table,oldrec,newrec); -} diff --git a/myisammrg/myrg_write.c b/myisammrg/myrg_write.c deleted file mode 100644 index 532709e361d..00000000000 --- a/myisammrg/myrg_write.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (C) 2001 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 */ - -/* Write a row to a MyISAM MERGE table */ - -#include "myrg_def.h" - -int myrg_write(register MYRG_INFO *info, byte *rec) -{ - /* [phi] MERGE_WRITE_DISABLED is handled by the else case */ - if (info->merge_insert_method == MERGE_INSERT_TO_FIRST) - return mi_write((info->current_table=info->open_tables)->table,rec); - else if (info->merge_insert_method == MERGE_INSERT_TO_LAST) - return mi_write((info->current_table=info->end_table-1)->table,rec); - else /* unsupported insertion method */ - return (my_errno= HA_ERR_WRONG_COMMAND); -} |