~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item.cc

  • Committer: Brian Aker
  • Date: 2011-03-28 02:46:21 UTC
  • Revision ID: brian@tangent.org-20110328024621-wtkdtlvdplqm0ybf
Shift CHARSET_INFO to charset_info_st

Show diffs side-by-side

added added

removed removed

Lines of Context:
418
418
  return false;
419
419
}
420
420
 
421
 
void Item::set_name(const char *str, uint32_t length, const CHARSET_INFO * const cs)
 
421
void Item::set_name(const char *str, uint32_t length, const charset_info_st * const cs)
422
422
{
423
423
  if (!length)
424
424
  {
468
468
         ! my_strcasecmp(system_charset_info, name, item->name);
469
469
}
470
470
 
471
 
Item *Item::safe_charset_converter(const CHARSET_INFO * const tocs)
 
471
Item *Item::safe_charset_converter(const charset_info_st * const tocs)
472
472
{
473
473
  Item_func_conv_charset *conv= new Item_func_conv_charset(this, tocs, 1);
474
474
  return conv->safe ? conv : NULL;
595
595
  return copy_or_same(session);
596
596
}
597
597
 
598
 
const CHARSET_INFO *Item::default_charset()
 
598
const charset_info_st *Item::default_charset()
599
599
{
600
600
  return current_session->variables.getCollation();
601
601
}
602
602
 
603
 
const CHARSET_INFO *Item::compare_collation()
 
603
const charset_info_st *Item::compare_collation()
604
604
{
605
605
  return NULL;
606
606
}
1096
1096
String *Item::check_well_formed_result(String *str, bool send_error)
1097
1097
{
1098
1098
  /* Check whether we got a well-formed string */
1099
 
  const CHARSET_INFO * const cs= str->charset();
 
1099
  const charset_info_st * const cs= str->charset();
1100
1100
  int well_formed_error;
1101
1101
  uint32_t wlen= cs->cset->well_formed_len(cs,
1102
1102
                                       str->ptr(), str->ptr() + str->length(),
1125
1125
  return str;
1126
1126
}
1127
1127
 
1128
 
bool Item::eq_by_collation(Item *item, bool binary_cmp, const CHARSET_INFO * const cs)
 
1128
bool Item::eq_by_collation(Item *item, bool binary_cmp, const charset_info_st * const cs)
1129
1129
{
1130
 
  const CHARSET_INFO *save_cs= 0;
1131
 
  const CHARSET_INFO *save_item_cs= 0;
 
1130
  const charset_info_st *save_cs= 0;
 
1131
  const charset_info_st *save_item_cs= 0;
1132
1132
  if (collation.collation != cs)
1133
1133
  {
1134
1134
    save_cs= collation.collation;
1243
1243
  if (result_type() == STRING_RESULT)
1244
1244
  {
1245
1245
    String *result;
1246
 
    const CHARSET_INFO * const cs= collation.collation;
 
1246
    const charset_info_st * const cs= collation.collation;
1247
1247
    char buff[MAX_FIELD_WIDTH];         // Alloc buffer for small columns
1248
1248
    str_value.set_quick(buff, sizeof(buff), cs);
1249
1249
    result=val_str(&str_value);
1433
1433
  return max_length / collation.collation->mbmaxlen;
1434
1434
}
1435
1435
 
1436
 
void Item::fix_length_and_charset(uint32_t max_char_length_arg, CHARSET_INFO *cs)
 
1436
void Item::fix_length_and_charset(uint32_t max_char_length_arg, charset_info_st *cs)
1437
1437
1438
1438
  max_length= char_to_byte_length_safe(max_char_length_arg, cs->mbmaxlen);
1439
1439
  collation.collation= cs;