2014-01-06 06:22:35 +01:00
|
|
|
/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
|
2010-03-31 16:05:33 +02:00
|
|
|
|
|
|
|
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; version 2 of the License.
|
|
|
|
|
|
|
|
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
|
2019-05-11 20:29:06 +02:00
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
|
2010-03-31 16:05:33 +02:00
|
|
|
|
|
|
|
#ifndef KEY_INCLUDED
|
|
|
|
#define KEY_INCLUDED
|
|
|
|
|
|
|
|
class Field;
|
|
|
|
class String;
|
|
|
|
struct TABLE;
|
|
|
|
typedef struct st_bitmap MY_BITMAP;
|
|
|
|
typedef struct st_key KEY;
|
|
|
|
typedef struct st_key_part_info KEY_PART_INFO;
|
|
|
|
|
|
|
|
int find_ref_key(KEY *key, uint key_count, uchar *record, Field *field,
|
|
|
|
uint *key_length, uint *keypart);
|
2024-11-05 13:38:03 +01:00
|
|
|
void key_copy(uchar *to_key, const uchar *from_record, const KEY *from_key_info,
|
|
|
|
const KEY *to_key_info, uint key_length,
|
|
|
|
bool with_zerofill= FALSE);
|
2020-03-12 14:14:55 +01:00
|
|
|
void key_copy(uchar *to_key, const uchar *from_record, const KEY *key_info,
|
2017-04-16 21:40:39 +02:00
|
|
|
uint key_length, bool with_zerofill= FALSE);
|
2016-10-16 13:01:01 +02:00
|
|
|
void key_restore(uchar *to_record, const uchar *from_key, KEY *key_info,
|
2010-03-31 16:05:33 +02:00
|
|
|
uint key_length);
|
|
|
|
bool key_cmp_if_same(TABLE *form,const uchar *key,uint index,uint key_length);
|
2013-11-28 12:10:44 +01:00
|
|
|
void key_unpack(String *to, TABLE *table, KEY *key);
|
2024-11-05 13:38:03 +01:00
|
|
|
void key_unpack(String *to, const TABLE *table, const KEY *key,
|
|
|
|
size_t prefix_size);
|
2013-11-28 12:10:44 +01:00
|
|
|
void field_unpack(String *to, Field *field, const uchar *rec, uint max_length,
|
|
|
|
bool prefix_key);
|
2010-03-31 16:05:33 +02:00
|
|
|
bool is_key_used(TABLE *table, uint idx, const MY_BITMAP *fields);
|
|
|
|
int key_cmp(KEY_PART_INFO *key_part, const uchar *key, uint key_length);
|
2011-10-19 21:45:18 +02:00
|
|
|
ulong key_hashnr(KEY *key_info, uint used_key_parts, const uchar *key);
|
|
|
|
bool key_buf_cmp(KEY *key_info, uint used_key_parts,
|
|
|
|
const uchar *key1, const uchar *key2);
|
2024-10-26 16:17:03 +02:00
|
|
|
extern "C" int key_rec_cmp(const KEY *const *key_info, const uchar *a,
|
|
|
|
const uchar *b);
|
|
|
|
int key_tuple_cmp(KEY_PART_INFO *part, const uchar *key1, const uchar *key2,
|
|
|
|
uint tuple_length);
|
2024-11-05 13:38:03 +01:00
|
|
|
uint key_get_prefix_store_length(const KEY *key, size_t parts);
|
2010-03-31 16:05:33 +02:00
|
|
|
|
|
|
|
#endif /* KEY_INCLUDED */
|