~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/key.h

  • Committer: Monty Taylor
  • Date: 2010-01-02 05:11:55 UTC
  • mto: (1259.3.1 build)
  • mto: This revision was merged to the branch mainline in revision 1262.
  • Revision ID: mordred@inaugust.com-20100102051155-akdm8w5rr6xwzayu
pandora-build - proper detection of memcached.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#define DRIZZLED_KEY_H
23
23
 
24
24
#include <string>
25
 
#include <boost/dynamic_bitset.hpp>
26
25
 
27
26
#include "drizzled/memory/sql_alloc.h"
28
27
#include "drizzled/key_part_spec.h"
31
30
#include "drizzled/sql_string.h"
32
31
#include "drizzled/handler_structs.h"
33
32
 
34
 
namespace drizzled
35
 
{
36
 
 
37
 
namespace memory { class Root; }
38
 
 
39
33
class Item;
 
34
class MyBitmap;
 
35
namespace drizzled { namespace memory { class Root; } }
40
36
 
41
 
class Key :public memory::SqlAlloc {
 
37
class Key :public drizzled::memory::SqlAlloc {
42
38
public:
43
39
  enum Keytype { PRIMARY, UNIQUE, MULTIPLE, FOREIGN_KEY};
44
40
  enum Keytype type;
69
65
};
70
66
 
71
67
 
72
 
int find_ref_key(KeyInfo *key, uint32_t key_count, unsigned char *record, Field *field,
 
68
int find_ref_key(KEY *key, uint32_t key_count, unsigned char *record, Field *field,
73
69
                 uint32_t *key_length, uint32_t *keypart);
74
70
/**
75
71
  Copy part of a record that forms a key or key prefix to a buffer.
86
82
  @param key_length  specifies length of all keyparts that will be copied
87
83
*/
88
84
 
89
 
void key_copy(unsigned char *to_key, unsigned char *from_record, KeyInfo *key_info, uint32_t key_length);
 
85
void key_copy(unsigned char *to_key, unsigned char *from_record, KEY *key_info, uint32_t key_length);
90
86
void key_copy(std::basic_string<unsigned char> &to_key,
91
 
              unsigned char *from_record, KeyInfo *key_info, uint32_t key_length);
92
 
void key_restore(unsigned char *to_record, unsigned char *from_key, KeyInfo *key_info,
 
87
              unsigned char *from_record, KEY *key_info, uint32_t key_length);
 
88
void key_restore(unsigned char *to_record, unsigned char *from_key, KEY *key_info,
93
89
                 uint16_t key_length);
94
 
void key_zero_nulls(unsigned char *tuple, KeyInfo *key_info);
 
90
void key_zero_nulls(unsigned char *tuple, KEY *key_info);
95
91
bool key_cmp_if_same(Table *form,const unsigned char *key,uint32_t index,uint32_t key_length);
96
92
void key_unpack(String *to,Table *form,uint32_t index);
97
 
bool is_key_used(Table *table, uint32_t idx, const boost::dynamic_bitset<>& fields);
98
 
int key_cmp(KeyPartInfo *key_part, const unsigned char *key, uint32_t key_length);
99
 
 
100
 
} /* namespace drizzled */
101
 
 
 
93
bool is_key_used(Table *table, uint32_t idx, const MyBitmap *fields);
 
94
int key_cmp(KEY_PART_INFO *key_part, const unsigned char *key, uint32_t key_length);
 
95
extern "C" int key_rec_cmp(void *key_info, unsigned char *a, unsigned char *b);
102
96
#endif /* DRIZZLED_KEY_H */