~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/fstring.h

  • Committer: Stewart Smith
  • Date: 2008-09-15 07:13:59 UTC
  • mfrom: (383.1.21 drizzle)
  • mto: This revision was merged to the branch mainline in revision 408.
  • Revision ID: stewart@flamingspork.com-20080915071359-f8bznznyaiqrtqxa
merged

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef DRIZZLE_SERVER_FIELD_STRING
22
22
#define DRIZZLE_SERVER_FIELD_STRING
23
23
 
24
 
#include <drizzled/mysql_priv.h>
25
 
 
26
24
class Field_string :public Field_longstr {
27
25
public:
28
26
  bool can_alter_field_type;
29
27
  Field_string(uchar *ptr_arg, uint32_t len_arg,uchar *null_ptr_arg,
30
28
               uchar null_bit_arg,
31
29
               enum utype unireg_check_arg, const char *field_name_arg,
32
 
               CHARSET_INFO *cs)
 
30
               const CHARSET_INFO * const cs)
33
31
    :Field_longstr(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
34
32
                   unireg_check_arg, field_name_arg, cs),
35
33
     can_alter_field_type(1) {};
36
34
  Field_string(uint32_t len_arg,bool maybe_null_arg, const char *field_name_arg,
37
 
               CHARSET_INFO *cs)
 
35
               const CHARSET_INFO * const cs)
38
36
    :Field_longstr((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
39
37
                   NONE, field_name_arg, cs),
40
38
     can_alter_field_type(1) {};
52
50
                          (has_charset() ? ' ' : 0));
53
51
    return 0;
54
52
  }
55
 
  int store(const char *to,uint length,CHARSET_INFO *charset);
 
53
  int store(const char *to,uint length, const CHARSET_INFO * const charset);
56
54
  int store(int64_t nr, bool unsigned_val);
57
55
  int store(double nr) { return Field_str::store(nr); } /* QQ: To be deleted */
58
56
  double val_real(void);
70
68
  { return (field_metadata & 0x00ff); }
71
69
  uint row_pack_length() { return (field_length + 1); }
72
70
  int pack_cmp(const uchar *a,const uchar *b,uint key_length,
73
 
               my_bool insert_or_update);
74
 
  int pack_cmp(const uchar *b,uint key_length,my_bool insert_or_update);
 
71
               bool insert_or_update);
 
72
  int pack_cmp(const uchar *b,uint key_length,bool insert_or_update);
75
73
  uint packed_col_length(const uchar *to, uint length);
76
74
  uint max_packed_col_length(uint max_length);
77
75
  uint size_of() const { return sizeof(*this); }
78
76
  enum_field_types real_type() const { return DRIZZLE_TYPE_VARCHAR; }
79
77
  bool has_charset(void) const
80
78
  { return charset() == &my_charset_bin ? false : true; }
81
 
  Field *new_field(MEM_ROOT *root, struct st_table *new_table, bool keep_type);
 
79
  Field *new_field(MEM_ROOT *root, Table *new_table, bool keep_type);
82
80
  virtual uint get_key_image(uchar *buff,uint length, imagetype type);
83
81
private:
84
82
  int do_save_field_metadata(uchar *first_byte);