1 /* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 // vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
3 #ident "$Id$"
4 /*======
5 This file is part of TokuDB
6 
7 
8 Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
9 
10     TokuDBis is free software: you can redistribute it and/or modify
11     it under the terms of the GNU General Public License, version 2,
12     as published by the Free Software Foundation.
13 
14     TokuDB is distributed in the hope that it will be useful,
15     but WITHOUT ANY WARRANTY; without even the implied warranty of
16     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17     GNU General Public License for more details.
18 
19     You should have received a copy of the GNU General Public License
20     along with TokuDB.  If not, see <http://www.gnu.org/licenses/>.
21 
22 ======= */
23 
24 #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
25 
26 // Provide some mimimal MySQL classes just to compile the tokudb cardinality functions
27 class KEY_INFO {
28 public:
29     uint flags;
30     uint key_parts;
31     uint64_t *rec_per_key;
32     char *name;
33 };
34 #define HA_NOSAME 1
35 class TABLE_SHARE {
36 public:
37     uint primary_key;
38     uint keys, key_parts;
39     KEY_INFO *key_info;
40 };
41 class TABLE {
42 public:
43     TABLE_SHARE *s;
44     KEY_INFO *key_info;
45 };
get_key_parts(KEY_INFO * key_info)46 uint get_key_parts(KEY_INFO *key_info) {
47     assert(key_info);
48     return key_info->key_parts;
49 }
50 #define MAX_KEY (1U << 30)
51