~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/varstring.h

  • Committer: Stewart Smith
  • Date: 2010-03-18 12:01:34 UTC
  • mto: (1666.2.3 build)
  • mto: This revision was merged to the branch mainline in revision 1596.
  • Revision ID: stewart@flamingspork.com-20100318120134-45fdnsw8g3j6c7oy
move RAND() into a plugin

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:
45
44
  /* Store number of bytes used to store length (1 or 2) */
46
45
  uint32_t length_bytes;
47
 
public:
48
46
  Field_varstring(unsigned char *ptr_arg,
49
47
                  uint32_t len_arg,
50
48
                  uint32_t length_bytes_arg,
51
49
                  unsigned char *null_ptr_arg,
52
50
                  unsigned char null_bit_arg,
53
51
                  const char *field_name_arg,
 
52
                  TableShare *share,
54
53
                  const CHARSET_INFO * const cs);
55
54
  Field_varstring(uint32_t len_arg,
56
55
                  bool maybe_null_arg,
57
56
                  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; }
66
65
  uint32_t key_length() const { return (uint32_t) field_length; }
67
66
  uint32_t sort_length() const
68
67
  {
69
68
    return (uint32_t) field_length + (field_charset == &my_charset_bin ?
70
 
                                      length_bytes : 0);
 
69
                                    length_bytes : 0);
71
70
  }
72
71
  int  store(const char *to,uint32_t length, const CHARSET_INFO * const charset);
73
72