~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/varstring.h

  • Committer: Monty Taylor
  • Date: 2009-12-08 23:39:39 UTC
  • mto: (1240.1.8 build)
  • mto: This revision was merged to the branch mainline in revision 1241.
  • Revision ID: mordred@inaugust.com-20091208233939-w0v4o04xer9pqqhu
Make range test shut up.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <drizzled/field/str.h>
25
25
#include <string>
26
26
 
27
 
namespace drizzled
28
 
{
29
 
 
30
27
class Field_varstring :public Field_str {
31
28
public:
32
29
 
41
38
    length_bytes.
42
39
  */
43
40
  static const uint32_t MAX_SIZE;
44
 
private:
45
41
  /* Store number of bytes used to store length (1 or 2) */
46
42
  uint32_t length_bytes;
47
 
public:
48
43
  Field_varstring(unsigned char *ptr_arg,
49
44
                  uint32_t len_arg,
50
45
                  uint32_t length_bytes_arg,
51
46
                  unsigned char *null_ptr_arg,
52
47
                  unsigned char null_bit_arg,
53
48
                  const char *field_name_arg,
 
49
                  TableShare *share,
54
50
                  const CHARSET_INFO * const cs);
55
51
  Field_varstring(uint32_t len_arg,
56
52
                  bool maybe_null_arg,
57
53
                  const char *field_name_arg,
 
54
                  TableShare *share,
58
55
                  const CHARSET_INFO * const cs);
59
56
 
60
57
  enum_field_types type() const { return DRIZZLE_TYPE_VARCHAR; }
61
58
  enum ha_base_keytype key_type() const;
 
59
  uint32_t row_pack_length() { return field_length; }
62
60
  bool zero_pack() const { return 0; }
63
61
  int  reset(void) { memset(ptr, 0, field_length+length_bytes); return 0; }
64
62
  uint32_t pack_length() const { return (uint32_t) field_length+length_bytes; }
65
 
  uint32_t pack_length_no_ptr() const { return length_bytes; }
66
63
  uint32_t key_length() const { return (uint32_t) field_length; }
67
64
  uint32_t sort_length() const
68
65
  {
69
66
    return (uint32_t) field_length + (field_charset == &my_charset_bin ?
70
 
                                      length_bytes : 0);
 
67
                                    length_bytes : 0);
71
68
  }
72
69
  int  store(const char *to,uint32_t length, const CHARSET_INFO * const charset);
73
70
 
78
75
  int64_t val_int(void);
79
76
  String *val_str(String*,String *);
80
77
  inline String *val_str(String *str) { return val_str(str, str); }
81
 
  type::Decimal *val_decimal(type::Decimal *);
 
78
  my_decimal *val_decimal(my_decimal *);
82
79
  int cmp_max(const unsigned char *, const unsigned char *, uint32_t max_length);
83
80
  inline  int cmp(const unsigned char *str) { return cmp(ptr,str); }
84
81
  int cmp(const unsigned char *a,const unsigned char *b)
109
106
  enum_field_types real_type() const { return DRIZZLE_TYPE_VARCHAR; }
110
107
  bool has_charset(void) const
111
108
  { return charset() == &my_charset_bin ? false : true; }
112
 
  Field *new_field(memory::Root *root, Table *new_table, bool keep_type);
113
 
  Field *new_key_field(memory::Root *root, Table *new_table,
 
109
  Field *new_field(MEM_ROOT *root, Table *new_table, bool keep_type);
 
110
  Field *new_key_field(MEM_ROOT *root, Table *new_table,
114
111
                       unsigned char *new_ptr, unsigned char *new_null_ptr,
115
112
                       uint32_t new_null_bit);
116
113
};
117
114
 
118
 
} /* namespace drizzled */
119
 
 
120
115
#endif /* DRIZZLED_FIELD_VARSTRING_H */
121
116