~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/varstring.h

  • Committer: Andrew Hutchings
  • Date: 2011-01-21 11:23:19 UTC
  • mto: (2100.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 2101.
  • Revision ID: andrew@linuxjedi.co.uk-20110121112319-nj1cvg0yt3nnf2rr
Add errors page to drizzle client docs
Add link to specific error in migration docs
Minor changes to migration docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
    length_bytes.
42
42
  */
43
43
  static const uint32_t MAX_SIZE;
 
44
private:
44
45
  /* Store number of bytes used to store length (1 or 2) */
45
46
  uint32_t length_bytes;
 
47
public:
46
48
  Field_varstring(unsigned char *ptr_arg,
47
49
                  uint32_t len_arg,
48
50
                  uint32_t length_bytes_arg,
49
51
                  unsigned char *null_ptr_arg,
50
52
                  unsigned char null_bit_arg,
51
53
                  const char *field_name_arg,
52
 
                  TableShare *share,
53
54
                  const CHARSET_INFO * const cs);
54
55
  Field_varstring(uint32_t len_arg,
55
56
                  bool maybe_null_arg,
56
57
                  const char *field_name_arg,
57
 
                  TableShare *share,
58
58
                  const CHARSET_INFO * const cs);
59
59
 
60
60
  enum_field_types type() const { return DRIZZLE_TYPE_VARCHAR; }
62
62
  bool zero_pack() const { return 0; }
63
63
  int  reset(void) { memset(ptr, 0, field_length+length_bytes); return 0; }
64
64
  uint32_t pack_length() const { return (uint32_t) field_length+length_bytes; }
 
65
  uint32_t pack_length_no_ptr() const { return length_bytes; }
65
66
  uint32_t key_length() const { return (uint32_t) field_length; }
66
67
  uint32_t sort_length() const
67
68
  {
68
69
    return (uint32_t) field_length + (field_charset == &my_charset_bin ?
69
 
                                    length_bytes : 0);
 
70
                                      length_bytes : 0);
70
71
  }
71
72
  int  store(const char *to,uint32_t length, const CHARSET_INFO * const charset);
72
73
 
77
78
  int64_t val_int(void);
78
79
  String *val_str(String*,String *);
79
80
  inline String *val_str(String *str) { return val_str(str, str); }
80
 
  my_decimal *val_decimal(my_decimal *);
 
81
  type::Decimal *val_decimal(type::Decimal *);
81
82
  int cmp_max(const unsigned char *, const unsigned char *, uint32_t max_length);
82
83
  inline  int cmp(const unsigned char *str) { return cmp(ptr,str); }
83
84
  int cmp(const unsigned char *a,const unsigned char *b)