~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/key.h

  • Committer: Brian Aker
  • Date: 2011-02-12 08:20:19 UTC
  • mto: This revision was merged to the branch mainline in revision 2161.
  • Revision ID: brian@tangent.org-20110212082019-09gs5y1b0pxoaesb
Merge in optimizer pieces.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
class Key :public memory::SqlAlloc {
42
42
public:
43
43
  enum Keytype { PRIMARY, UNIQUE, MULTIPLE, FOREIGN_KEY};
44
 
  enum Keytype type;
 
44
  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(enum Keytype type_par, const LEX_STRING &name_arg,
 
50
  Key(Keytype type_par,
 
51
      const lex_string_t &name_arg,
51
52
      KEY_CREATE_INFO *key_info_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)
 
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)
55
59
  {}
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),
 
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),
60
70
    generated(generated_arg)
61
71
  {
62
72
    name.str= const_cast<char *>(name_arg);
86
96
  @param key_length  specifies length of all keyparts that will be copied
87
97
*/
88
98
 
89
 
void key_copy(unsigned char *to_key, unsigned char *from_record, KeyInfo *key_info, uint32_t key_length);
 
99
DRIZZLED_API void key_copy(unsigned char *to_key, unsigned char *from_record, KeyInfo *key_info, uint32_t key_length);
90
100
void key_copy(std::basic_string<unsigned char> &to_key,
91
101
              unsigned char *from_record, KeyInfo *key_info, uint32_t key_length);
92
102
void key_restore(unsigned char *to_record, unsigned char *from_key, KeyInfo *key_info,
93
103
                 uint16_t key_length);
94
104
void key_zero_nulls(unsigned char *tuple, KeyInfo *key_info);
95
105
bool key_cmp_if_same(Table *form,const unsigned char *key,uint32_t index,uint32_t key_length);
96
 
void key_unpack(String *to,Table *form,uint32_t index);
 
106
void key_unpack(String *to, const Table *form,uint32_t index);
97
107
bool is_key_used(Table *table, uint32_t idx, const boost::dynamic_bitset<>& fields);
98
108
int key_cmp(KeyPartInfo *key_part, const unsigned char *key, uint32_t key_length);
99
109