mariadb/include/myisammrg.h
unknown 70f79563d9 key_cmp -> key_cmp_if_same
New records_in_range() interface (similar to read_range())
Macros for faster bitmap handling
Simplify read_range() code (#WL1786)
New general key_cmp() function to compare keys




heap/hp_hash.c:
  New records_in_range() interface
include/heap.h:
  New records_in_range() interface
include/my_base.h:
  Moved 'key_range' here so that all table handlers can use it
include/my_bitmap.h:
  Make some bitmap functions inline for faster usage in one thread
include/myisam.h:
  New records_in_range() interface
include/myisammrg.h:
  New records_in_range() interface
myisam/mi_range.c:
  New records_in_range() interface
myisam/mi_test2.c:
  New records_in_range() interface
myisam/rt_test.c:
  New records_in_range() interface
  Indentation fixes
myisam/sp_test.c:
  New records_in_range() interface
  Indentation fixes
myisammrg/myrg_range.c:
  New records_in_range() interface
mysys/my_bitmap.c:
  Make some bitmap functions inline for faster usage in one thread
sql/examples/ha_example.cc:
  New records_in_range() interface
sql/field.cc:
  Fixed indentation
sql/ha_berkeley.cc:
  New records_in_range() interface
sql/ha_berkeley.h:
  New records_in_range() interface
sql/ha_heap.cc:
  New records_in_range() interface
sql/ha_heap.h:
  New records_in_range() interface
sql/ha_innodb.cc:
  New records_in_range() interface
sql/ha_innodb.h:
  New records_in_range() interface
sql/ha_isam.cc:
  New records_in_range() interface
sql/ha_isam.h:
  New records_in_range() interface
sql/ha_myisam.cc:
  New records_in_range() interface
sql/ha_myisam.h:
  New records_in_range() interface
sql/ha_myisammrg.cc:
  New records_in_range() interface
sql/ha_myisammrg.h:
  New records_in_range() interface
sql/ha_ndbcluster.cc:
  New records_in_range() interface
sql/ha_ndbcluster.h:
  New records_in_range() interface
sql/handler.cc:
  Simplify read_range() interface:
  - Add 'eq_range' to read_range_first
  - Remove 'eq_range' parameer from read_range_next()
  - Trust values from index_next_same()
  - Simplfy compare_key() by moving key_comparision to key.cc (as this code can be reused from other places)
sql/handler.h:
  Move key_range to my_base.h to be used by external table handlers
  Simplify read_range() interface
  New records_in_range() interface
sql/key.cc:
  Rename key_cmp() to key_cmp_if_same() to make it more descriptive
  Add new key_cmp() function usable from range and handler code.
sql/mysql_priv.h:
  Prototypes for new functions
sql/opt_range.cc:
  New records_in_range() interface
  Simplify cmp_prev()
  (We can in 5.0 simplify cmp_next() the same way)
sql/opt_range.h:
  Added key_part_info to QUICK_SELECT to be able to use key_cmp() in get_next()
sql/opt_sum.cc:
  key_cmp -> key_cmp_if_same
sql/sql_acl.cc:
  key_cmp -> key_cmp_if_same
sql/sql_select.cc:
  key_cmp -> key_cmp_if_same
2004-05-16 14:48:32 +03:00

110 lines
3.7 KiB
C

/* Copyright (C) 2000 MySQL 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 should be included when using merge_isam_funktions */
#ifndef _myisammrg_h
#define _myisammrg_h
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _my_base_h
#include <my_base.h>
#endif
#ifndef _myisam_h
#include <myisam.h>
#endif
#include <queues.h>
#define MYRG_NAME_EXT ".MRG"
/* In which table to INSERT rows */
#define MERGE_INSERT_DISABLED 0
#define MERGE_INSERT_TO_FIRST 1
#define MERGE_INSERT_TO_LAST 2
extern TYPELIB merge_insert_method;
/* Param to/from myrg_info */
typedef struct st_mymerge_info /* Struct from h_info */
{
ulonglong records; /* Records in database */
ulonglong deleted; /* Deleted records in database */
ulonglong recpos; /* Pos for last used record */
ulonglong data_file_length;
uint reclength; /* Recordlength */
int errkey; /* With key was dupplicated on err */
uint options; /* HA_OPTION_... used */
ulong *rec_per_key; /* for sql optimizing */
} MYMERGE_INFO;
typedef struct st_myrg_table_info
{
struct st_myisam_info *table;
ulonglong file_offset;
} MYRG_TABLE;
typedef struct st_myrg_info
{
MYRG_TABLE *open_tables,*current_table,*end_table,*last_used_table;
ulonglong records; /* records in tables */
ulonglong del; /* Removed records */
ulonglong data_file_length;
ulong cache_size;
uint merge_insert_method;
uint tables,options,reclength,keys;
my_bool cache_in_use;
LIST open_list;
QUEUE by_key;
ulong *rec_per_key_part; /* for sql optimizing */
} MYRG_INFO;
/* Prototypes for merge-functions */
extern int myrg_close(MYRG_INFO *file);
extern int myrg_delete(MYRG_INFO *file,const byte *buff);
extern MYRG_INFO *myrg_open(const char *name,int mode,int wait_if_locked);
extern int myrg_panic(enum ha_panic_function function);
extern int myrg_rfirst(MYRG_INFO *file,byte *buf,int inx);
extern int myrg_rlast(MYRG_INFO *file,byte *buf,int inx);
extern int myrg_rnext(MYRG_INFO *file,byte *buf,int inx);
extern int myrg_rprev(MYRG_INFO *file,byte *buf,int inx);
extern int myrg_rnext_same(MYRG_INFO *file,byte *buf);
extern int myrg_rkey(MYRG_INFO *file,byte *buf,int inx,const byte *key,
uint key_len, enum ha_rkey_function search_flag);
extern int myrg_rrnd(MYRG_INFO *file,byte *buf,ulonglong pos);
extern int myrg_rsame(MYRG_INFO *file,byte *record,int inx);
extern int myrg_update(MYRG_INFO *file,const byte *old,byte *new_rec);
extern int myrg_write(MYRG_INFO *info,byte *rec);
extern int myrg_status(MYRG_INFO *file,MYMERGE_INFO *x,int flag);
extern int myrg_lock_database(MYRG_INFO *file,int lock_type);
extern int myrg_create(const char *name, const char **table_names,
uint insert_method, my_bool fix_names);
extern int myrg_extra(MYRG_INFO *file,enum ha_extra_function function,
void *extra_arg);
extern void myrg_extrafunc(MYRG_INFO *info,invalidator_by_filename inv);
extern ha_rows myrg_records_in_range(MYRG_INFO *info,int inx,
key_range *min_key, key_range *max_key);
extern ulonglong myrg_position(MYRG_INFO *info);
#ifdef __cplusplus
}
#endif
#endif