~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/varstring.h

  • Committer: Monty Taylor
  • Date: 2008-08-02 01:03:15 UTC
  • mto: (236.1.42 codestyle)
  • mto: This revision was merged to the branch mainline in revision 261.
  • Revision ID: monty@inaugust.com-20080802010315-65h5938pymg9d99z
Moved m4 macros to top-level m4 dir, per GNU standards (and where gettext wanted it :)

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef DRIZZLE_SERVER_FIELD_VARSTRING
22
22
#define DRIZZLE_SERVER_FIELD_VARSTRING
23
23
 
 
24
#include <drizzled/mysql_priv.h>
 
25
 
24
26
class Field_varstring :public Field_longstr {
25
27
public:
26
28
  /*
34
36
                  uint32_t len_arg, uint length_bytes_arg,
35
37
                  uchar *null_ptr_arg, uchar null_bit_arg,
36
38
                  enum utype unireg_check_arg, const char *field_name_arg,
37
 
                  TABLE_SHARE *share, const CHARSET_INFO * const cs)
 
39
                  TABLE_SHARE *share, CHARSET_INFO *cs)
38
40
    :Field_longstr(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
39
41
                   unireg_check_arg, field_name_arg, cs),
40
42
     length_bytes(length_bytes_arg)
43
45
  }
44
46
  Field_varstring(uint32_t len_arg,bool maybe_null_arg,
45
47
                  const char *field_name_arg,
46
 
                  TABLE_SHARE *share, const CHARSET_INFO * const cs)
 
48
                  TABLE_SHARE *share, CHARSET_INFO *cs)
47
49
    :Field_longstr((uchar*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
48
50
                   NONE, field_name_arg, cs),
49
51
     length_bytes(len_arg < 256 ? 1 :2)
63
65
    return (uint32_t) field_length + (field_charset == &my_charset_bin ?
64
66
                                    length_bytes : 0);
65
67
  }
66
 
  int  store(const char *to,uint length, const CHARSET_INFO * const charset);
 
68
  int  store(const char *to,uint length,CHARSET_INFO *charset);
67
69
  int  store(int64_t nr, bool unsigned_val);
68
70
  int  store(double nr) { return Field_str::store(nr); } /* QQ: To be deleted */
69
71
  double val_real(void);
89
91
  const uchar *unpack_key(uchar* to, const uchar *from,
90
92
                          uint max_length, bool low_byte_first);
91
93
  int pack_cmp(const uchar *a, const uchar *b, uint key_length,
92
 
               bool insert_or_update);
93
 
  int pack_cmp(const uchar *b, uint key_length,bool insert_or_update);
 
94
               my_bool insert_or_update);
 
95
  int pack_cmp(const uchar *b, uint key_length,my_bool insert_or_update);
94
96
  int cmp_binary(const uchar *a,const uchar *b, uint32_t max_length=~0L);
95
97
  int key_cmp(const uchar *,const uchar*);
96
98
  int key_cmp(const uchar *str, uint length);
107
109
                       uchar *new_ptr, uchar *new_null_ptr,
108
110
                       uint new_null_bit);
109
111
  uint is_equal(Create_field *new_field);
110
 
  void hash(uint32_t *nr, uint32_t *nr2);
 
112
  void hash(ulong *nr, ulong *nr2);
111
113
private:
112
114
  int do_save_field_metadata(uchar *first_byte);
113
115
};