2002-04-25 10:36:55 +02:00
|
|
|
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
2003-01-21 19:24:34 +01:00
|
|
|
|
2002-04-25 10:36:55 +02:00
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
2003-01-21 19:24:34 +01:00
|
|
|
|
2002-04-25 10:36:55 +02:00
|
|
|
This library 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
|
|
|
|
Library General Public License for more details.
|
2003-01-21 19:24:34 +01:00
|
|
|
|
2002-04-25 10:36:55 +02:00
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
|
|
|
MA 02111-1307, USA */
|
|
|
|
|
|
|
|
#ifndef _my_handler_h
|
|
|
|
#define _my_handler_h
|
|
|
|
|
|
|
|
#include "my_global.h"
|
|
|
|
#include "my_base.h"
|
|
|
|
#include "m_ctype.h"
|
|
|
|
#include "myisampack.h"
|
|
|
|
|
2002-04-25 12:10:29 +02:00
|
|
|
typedef struct st_HA_KEYSEG /* Key-portion */
|
2002-04-25 10:36:55 +02:00
|
|
|
{
|
|
|
|
uint8 type; /* Type of key (for sort) */
|
|
|
|
uint8 language;
|
|
|
|
uint8 null_bit; /* bitmask to test for NULL */
|
|
|
|
uint8 bit_start,bit_end; /* if bit field */
|
|
|
|
uint16 flag;
|
|
|
|
uint16 length; /* Keylength */
|
|
|
|
uint32 start; /* Start of key in record */
|
|
|
|
uint32 null_pos; /* position to NULL indicator */
|
|
|
|
CHARSET_INFO *charset;
|
2002-04-25 12:10:29 +02:00
|
|
|
} HA_KEYSEG;
|
2002-04-25 10:36:55 +02:00
|
|
|
|
|
|
|
#define get_key_length(length,key) \
|
|
|
|
{ if ((uchar) *(key) != 255) \
|
|
|
|
length= (uint) (uchar) *((key)++); \
|
|
|
|
else \
|
|
|
|
{ length=mi_uint2korr((key)+1); (key)+=3; } \
|
|
|
|
}
|
|
|
|
|
2003-01-21 19:24:34 +01:00
|
|
|
#define get_key_length_rdonly(length,key) \
|
|
|
|
{ if ((uchar) *(key) != 255) \
|
|
|
|
length= ((uint) (uchar) *((key))); \
|
|
|
|
else \
|
|
|
|
{ length=mi_uint2korr((key)+1); } \
|
|
|
|
}
|
|
|
|
|
2002-04-25 10:36:55 +02:00
|
|
|
#define get_key_pack_length(length,length_pack,key) \
|
|
|
|
{ if ((uchar) *(key) != 255) \
|
|
|
|
{ length= (uint) (uchar) *((key)++); length_pack=1; }\
|
|
|
|
else \
|
|
|
|
{ length=mi_uint2korr((key)+1); (key)+=3; length_pack=3; } \
|
|
|
|
}
|
|
|
|
|
2002-05-21 18:54:08 +02:00
|
|
|
extern int mi_compare_text(CHARSET_INFO *, uchar *, uint, uchar *, uint ,
|
2004-03-25 14:05:01 +01:00
|
|
|
my_bool, my_bool);
|
2002-04-25 12:10:29 +02:00
|
|
|
extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
|
2002-05-21 18:54:08 +02:00
|
|
|
register uchar *b, uint key_length, uint nextflag,
|
|
|
|
uint *diff_pos);
|
2002-04-25 10:36:55 +02:00
|
|
|
|
|
|
|
#endif /* _my_handler_h */
|