~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/string.h

  • Committer: Brian Aker
  • Date: 2009-05-15 19:36:46 UTC
  • mfrom: (1022.1.3 merge)
  • Revision ID: brian@gaz-20090515193646-g0vvy78rkk08e440
Merge in changes for charset and dead code cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
{
27
27
public:
28
28
  Item_string(const char *str,uint32_t length,
29
 
              const CHARSET_INFO * const cs, Derivation dv= DERIVATION_COERCIBLE,
30
 
              uint32_t repertoire= MY_REPERTOIRE_UNICODE30)
 
29
              const CHARSET_INFO * const cs, Derivation dv= DERIVATION_COERCIBLE)
31
30
    : m_cs_specified(false)
32
31
  {
33
32
    str_value.set_or_copy_aligned(str, length, cs);
34
 
    collation.set(cs, dv, repertoire);
 
33
    collation.set(cs, dv);
35
34
    /*
36
35
      We have to have a different max_length than 'length' here to
37
36
      ensure that we get the right length if we do use the item
56
55
    fixed= 1;
57
56
  }
58
57
  Item_string(const char *name_par, const char *str, uint32_t length,
59
 
              const CHARSET_INFO * const cs, Derivation dv= DERIVATION_COERCIBLE,
60
 
              uint32_t repertoire= MY_REPERTOIRE_UNICODE30)
 
58
              const CHARSET_INFO * const cs, Derivation dv= DERIVATION_COERCIBLE)
61
59
    : m_cs_specified(false)
62
60
  {
63
61
    str_value.set_or_copy_aligned(str, length, cs);
64
 
    collation.set(cs, dv, repertoire);
 
62
    collation.set(cs, dv);
65
63
    max_length= str_value.numchars()*cs->mbmaxlen;
66
64
    set_name(name_par, 0, cs);
67
65
    decimals=NOT_FIXED_DEC;
68
66
    // it is constant => can be used without fix_fields (and frequently used)
69
67
    fixed= 1;
70
68
  }
71
 
  void set_repertoire_from_value()
72
 
  {
73
 
    collation.repertoire= my_string_repertoire(str_value.charset(),
74
 
                                               str_value.ptr(),
75
 
                                               str_value.length());
76
 
  }
77
69
  enum Type type() const { return STRING_ITEM; }
78
70
  double val_real();
79
71
  int64_t val_int();