~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/key.cc

  • Committer: Brian Aker
  • Date: 2008-10-06 05:57:49 UTC
  • Revision ID: brian@tangent.org-20081006055749-svg700gciuqi0zu1
Remove all of uchar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
       key_length is set to length of key before (not including) field
46
46
*/
47
47
 
48
 
int find_ref_key(KEY *key, uint key_count, uchar *record, Field *field,
 
48
int find_ref_key(KEY *key, uint key_count, unsigned char *record, Field *field,
49
49
                 uint *key_length, uint *keypart)
50
50
{
51
51
  register int i;
105
105
  @param key_length  specifies length of all keyparts that will be copied
106
106
*/
107
107
 
108
 
void key_copy(uchar *to_key, uchar *from_record, KEY *key_info,
 
108
void key_copy(unsigned char *to_key, unsigned char *from_record, KEY *key_info,
109
109
              unsigned int key_length)
110
110
{
111
111
  uint length;
148
148
  Zero the null components of key tuple.
149
149
*/
150
150
 
151
 
void key_zero_nulls(uchar *tuple, KEY *key_info)
 
151
void key_zero_nulls(unsigned char *tuple, KEY *key_info)
152
152
{
153
153
  KEY_PART_INFO *key_part= key_info->key_part;
154
154
  KEY_PART_INFO *key_part_end= key_part + key_info->key_parts;
173
173
  @param key_length  specifies length of all keyparts that will be restored
174
174
*/
175
175
 
176
 
void key_restore(uchar *to_record, uchar *from_key, KEY *key_info,
 
176
void key_restore(unsigned char *to_record, unsigned char *from_key, KEY *key_info,
177
177
                 uint16_t key_length)
178
178
{
179
179
  uint length;
185
185
  }
186
186
  for (key_part= key_info->key_part ; (int) key_length > 0 ; key_part++)
187
187
  {
188
 
    uchar used_uneven_bits= 0;
 
188
    unsigned char used_uneven_bits= 0;
189
189
    if (key_part->null_bit)
190
190
    {
191
191
      if (*from_key++)
255
255
    1   Key has changed
256
256
*/
257
257
 
258
 
bool key_cmp_if_same(Table *table,const uchar *key,uint idx,uint key_length)
 
258
bool key_cmp_if_same(Table *table,const unsigned char *key,uint idx,uint key_length)
259
259
{
260
260
  uint store_length;
261
261
  KEY_PART_INFO *key_part;
262
 
  const uchar *key_end= key + key_length;;
 
262
  const unsigned char *key_end= key + key_length;;
263
263
 
264
264
  for (key_part=table->key_info[idx].key_part;
265
265
       key < key_end ; 
291
291
    {
292
292
      const CHARSET_INFO * const cs= key_part->field->charset();
293
293
      uint char_length= key_part->length / cs->mbmaxlen;
294
 
      const uchar *pos= table->record[0] + key_part->offset;
 
294
      const unsigned char *pos= table->record[0] + key_part->offset;
295
295
      if (length > char_length)
296
296
      {
297
297
        char_length= my_charpos(cs, pos, pos + length, char_length);
298
298
        set_if_smaller(char_length, length);
299
299
      }
300
300
      if (cs->coll->strnncollsp(cs,
301
 
                                (const uchar*) key, length,
302
 
                                (const uchar*) pos, char_length, 0))
 
301
                                (const unsigned char*) key, length,
 
302
                                (const unsigned char*) pos, char_length, 0))
303
303
        return 1;
304
304
      continue;
305
305
    }
429
429
    -   1               Key is larger than range
430
430
*/
431
431
 
432
 
int key_cmp(KEY_PART_INFO *key_part, const uchar *key, uint key_length)
 
432
int key_cmp(KEY_PART_INFO *key_part, const unsigned char *key, uint key_length)
433
433
{
434
434
  uint store_length;
435
435
 
436
 
  for (const uchar *end=key + key_length;
 
436
  for (const unsigned char *end=key + key_length;
437
437
       key < end;
438
438
       key+= store_length, key_part++)
439
439
  {
490
490
    and return the result of the comparison.
491
491
*/
492
492
 
493
 
int key_rec_cmp(void *key, uchar *first_rec, uchar *second_rec)
 
493
int key_rec_cmp(void *key, unsigned char *first_rec, unsigned char *second_rec)
494
494
{
495
495
  KEY *key_info= (KEY*)key;
496
496
  uint key_parts= key_info->key_parts, i= 0;
497
497
  KEY_PART_INFO *key_part= key_info->key_part;
498
 
  uchar *rec0= key_part->field->ptr - key_part->offset;
 
498
  unsigned char *rec0= key_part->field->ptr - key_part->offset;
499
499
  my_ptrdiff_t first_diff= first_rec - rec0, sec_diff= second_rec - rec0;
500
500
  int result= 0;
501
501