67
67
{ return new (mem_root) Key(*this, mem_root); }
71
int find_ref_key(KEY *key, uint32_t key_count, unsigned char *record, Field *field,
72
uint32_t *key_length, uint32_t *keypart);
74
Copy part of a record that forms a key or key prefix to a buffer.
76
The function takes a complete table record (as e.g. retrieved by
77
handler::index_read()), and a description of an index on the same table,
78
and extracts the first key_length bytes of the record which are part of a
79
key into to_key. If length == 0 then copy all bytes from the record that
82
@param to_key buffer that will be used as a key
83
@param from_record full record to be copied from
84
@param key_info descriptor of the index
85
@param key_length specifies length of all keyparts that will be copied
88
void key_copy(unsigned char *to_key, unsigned char *from_record, KEY *key_info, uint32_t key_length);
89
void key_copy(std::basic_string<unsigned char> &to_key,
90
unsigned char *from_record, KEY *key_info, uint32_t key_length);
91
void key_restore(unsigned char *to_record, unsigned char *from_key, KEY *key_info,
93
void key_zero_nulls(unsigned char *tuple, KEY *key_info);
94
bool key_cmp_if_same(Table *form,const unsigned char *key,uint32_t index,uint32_t key_length);
95
void key_unpack(String *to,Table *form,uint32_t index);
96
bool is_key_used(Table *table, uint32_t idx, const MY_BITMAP *fields);
97
int key_cmp(KEY_PART_INFO *key_part, const unsigned char *key, uint32_t key_length);
98
extern "C" int key_rec_cmp(void *key_info, unsigned char *a, unsigned char *b);
70
99
#endif /* DRIZZLED_KEY_H */