MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
key.h
1 /* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation; version 2 of the License.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  GNU General Public License for more details.
11 
12  You should have received a copy of the GNU General Public License
13  along with this program; if not, write to the Free Software
14  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
15 
16 #ifndef KEY_INCLUDED
17 #define KEY_INCLUDED
18 
19 #include "my_global.h" /* uchar */
20 
21 class Field;
22 class String;
23 struct TABLE;
24 typedef struct st_bitmap MY_BITMAP;
25 typedef struct st_key KEY;
26 class KEY_PART_INFO;
27 
28 int find_ref_key(KEY *key, uint key_count, uchar *record, Field *field,
29  uint *key_length, uint *keypart);
30 void key_copy(uchar *to_key, uchar *from_record, KEY *key_info, uint key_length);
31 void key_restore(uchar *to_record, uchar *from_key, KEY *key_info,
32  uint key_length);
33 bool key_cmp_if_same(TABLE *form,const uchar *key,uint index,uint key_length);
34 void key_unpack(String *to, TABLE *table, KEY *key);
35 void field_unpack(String *to, Field *field, const uchar *rec, uint max_length,
36  bool prefix_key);
37 bool is_key_used(TABLE *table, uint idx, const MY_BITMAP *fields);
38 int key_cmp(KEY_PART_INFO *key_part, const uchar *key, uint key_length);
39 extern "C" int key_rec_cmp(void *key_info, uchar *a, uchar *b);
40 
41 #endif /* KEY_INCLUDED */