~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/key.h

  • Committer: Monty Taylor
  • Date: 2008-12-06 07:22:02 UTC
  • mto: (656.1.7 devel) (660.1.5 codestyle)
  • mto: This revision was merged to the branch mainline in revision 665.
  • Revision ID: monty@inaugust.com-20081206072202-2g25o9doqr1l8euu
OOOh doggie. Got rid of my_alloca.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
    { return new (mem_root) Key(*this, mem_root); }
68
68
};
69
69
 
 
70
 
 
71
int find_ref_key(KEY *key, uint32_t key_count, unsigned char *record, Field *field,
 
72
                 uint32_t *key_length, uint32_t *keypart);
 
73
/**
 
74
  Copy part of a record that forms a key or key prefix to a buffer.
 
75
 
 
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
 
80
    form a key.
 
81
 
 
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
 
86
*/
 
87
 
 
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,
 
92
                 uint16_t key_length);
 
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 */