~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/key.h

  • Committer: Andrew Hutchings
  • Date: 2011-01-10 16:11:45 UTC
  • mto: (2069.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2070.
  • Revision ID: andrew@linuxjedi.co.uk-20110110161145-isdc0ncbo2hx2n5c
Fix pandora error message

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <string>
25
25
#include <boost/dynamic_bitset.hpp>
26
26
 
27
 
#include <drizzled/memory/sql_alloc.h>
28
 
#include <drizzled/key_part_spec.h>
29
 
#include <drizzled/sql_list.h>
30
 
#include <drizzled/lex_string.h>
31
 
#include <drizzled/sql_string.h>
32
 
#include <drizzled/handler_structs.h>
 
27
#include "drizzled/memory/sql_alloc.h"
 
28
#include "drizzled/key_part_spec.h"
 
29
#include "drizzled/sql_list.h"
 
30
#include "drizzled/lex_string.h"
 
31
#include "drizzled/sql_string.h"
 
32
#include "drizzled/handler_structs.h"
33
33
 
34
34
namespace drizzled
35
35
{
41
41
class Key :public memory::SqlAlloc {
42
42
public:
43
43
  enum Keytype { PRIMARY, UNIQUE, MULTIPLE, FOREIGN_KEY};
44
 
  Keytype type;
 
44
  enum Keytype type;
45
45
  KEY_CREATE_INFO key_create_info;
46
46
  List<Key_part_spec> columns;
47
47
  LEX_STRING name;
48
48
  bool generated;
49
49
 
50
 
  Key(Keytype type_par,
51
 
      const lex_string_t &name_arg,
 
50
  Key(enum Keytype type_par, const LEX_STRING &name_arg,
52
51
      KEY_CREATE_INFO *key_info_arg,
53
 
      bool generated_arg, List<Key_part_spec> &cols) :
54
 
    type(type_par),
55
 
    key_create_info(*key_info_arg),
56
 
    columns(cols),
57
 
    name(name_arg),
58
 
    generated(generated_arg)
 
52
      bool generated_arg, List<Key_part_spec> &cols)
 
53
    :type(type_par), key_create_info(*key_info_arg), columns(cols),
 
54
    name(name_arg), generated(generated_arg)
59
55
  {}
60
 
 
61
 
  Key(Keytype type_par,
62
 
      const char *name_arg,
63
 
      size_t name_len_arg,
64
 
      KEY_CREATE_INFO *key_info_arg,
65
 
      bool generated_arg,
66
 
      List<Key_part_spec> &cols) :
67
 
    type(type_par),
68
 
    key_create_info(*key_info_arg),
69
 
    columns(cols),
 
56
  Key(enum Keytype type_par, const char *name_arg, size_t name_len_arg,
 
57
      KEY_CREATE_INFO *key_info_arg, bool generated_arg,
 
58
      List<Key_part_spec> &cols)
 
59
    :type(type_par), key_create_info(*key_info_arg), columns(cols),
70
60
    generated(generated_arg)
71
61
  {
72
62
    name.str= const_cast<char *>(name_arg);
96
86
  @param key_length  specifies length of all keyparts that will be copied
97
87
*/
98
88
 
99
 
DRIZZLED_API void key_copy(unsigned char *to_key, unsigned char *from_record, KeyInfo *key_info, uint32_t key_length);
 
89
void key_copy(unsigned char *to_key, unsigned char *from_record, KeyInfo *key_info, uint32_t key_length);
100
90
void key_copy(std::basic_string<unsigned char> &to_key,
101
91
              unsigned char *from_record, KeyInfo *key_info, uint32_t key_length);
102
92
void key_restore(unsigned char *to_record, unsigned char *from_key, KeyInfo *key_info,
103
93
                 uint16_t key_length);
104
94
void key_zero_nulls(unsigned char *tuple, KeyInfo *key_info);
105
95
bool key_cmp_if_same(Table *form,const unsigned char *key,uint32_t index,uint32_t key_length);
106
 
void key_unpack(String *to, const Table *form,uint32_t index);
 
96
void key_unpack(String *to,Table *form,uint32_t index);
107
97
bool is_key_used(Table *table, uint32_t idx, const boost::dynamic_bitset<>& fields);
108
98
int key_cmp(KeyPartInfo *key_part, const unsigned char *key, uint32_t key_length);
109
99