~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/blob.h

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
RemoveĀ uint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
class Field_blob :public Field_longstr {
25
25
protected:
26
 
  uint packlength;
 
26
  uint32_t packlength;
27
27
  String value;                         // For temporaries
28
28
public:
29
29
  Field_blob(unsigned char *ptr_arg, unsigned char *null_ptr_arg, unsigned char null_bit_arg,
30
30
             enum utype unireg_check_arg, const char *field_name_arg,
31
 
             TABLE_SHARE *share, uint blob_pack_length, const CHARSET_INFO * const cs);
 
31
             TABLE_SHARE *share, uint32_t blob_pack_length, const CHARSET_INFO * const cs);
32
32
  Field_blob(uint32_t len_arg,bool maybe_null_arg, const char *field_name_arg,
33
33
             const CHARSET_INFO * const cs)
34
34
    :Field_longstr((unsigned char*) 0, len_arg, maybe_null_arg ? (unsigned char*) "": 0, 0,
58
58
  enum_field_types type() const { return DRIZZLE_TYPE_BLOB;}
59
59
  enum ha_base_keytype key_type() const
60
60
    { return binary() ? HA_KEYTYPE_VARBINARY2 : HA_KEYTYPE_VARTEXT2; }
61
 
  int  store(const char *to,uint length, const CHARSET_INFO * const charset);
 
61
  int  store(const char *to,uint32_t length, const CHARSET_INFO * const charset);
62
62
  int  store(double nr);
63
63
  int  store(int64_t nr, bool unsigned_val);
64
64
  double val_real(void);
71
71
  int cmp(const unsigned char *a, uint32_t a_length, const unsigned char *b, uint32_t b_length);
72
72
  int cmp_binary(const unsigned char *a,const unsigned char *b, uint32_t max_length=UINT32_MAX);
73
73
  int key_cmp(const unsigned char *,const unsigned char*);
74
 
  int key_cmp(const unsigned char *str, uint length);
 
74
  int key_cmp(const unsigned char *str, uint32_t length);
75
75
  uint32_t key_length() const { return 0; }
76
 
  void sort_string(unsigned char *buff,uint length);
 
76
  void sort_string(unsigned char *buff,uint32_t length);
77
77
  uint32_t pack_length() const
78
78
  { return (uint32_t) (packlength+table->s->blob_ptr_size); }
79
79
 
87
87
  */
88
88
  uint32_t pack_length_no_ptr() const
89
89
  { return (uint32_t) (packlength); }
90
 
  uint row_pack_length() { return pack_length_no_ptr(); }
 
90
  uint32_t row_pack_length() { return pack_length_no_ptr(); }
91
91
  uint32_t sort_length() const;
92
92
  virtual uint32_t max_data_length() const
93
93
  {
98
98
#ifndef WORDS_BIGENDIAN
99
99
  static
100
100
#endif
101
 
  void store_length(unsigned char *i_ptr, uint i_packlength, uint32_t i_number, bool low_byte_first);
102
 
  void store_length(unsigned char *i_ptr, uint i_packlength, uint32_t i_number)
 
101
  void store_length(unsigned char *i_ptr, uint32_t i_packlength, uint32_t i_number, bool low_byte_first);
 
102
  void store_length(unsigned char *i_ptr, uint32_t i_packlength, uint32_t i_number)
103
103
  {
104
104
    store_length(i_ptr, i_packlength, i_number, table->s->db_low_byte_first);
105
105
  }
119
119
  uint32_t get_packed_size(const unsigned char *ptr_arg, bool low_byte_first)
120
120
    {return packlength + get_length(ptr_arg, packlength, low_byte_first);}
121
121
 
122
 
  inline uint32_t get_length(uint row_offset= 0)
 
122
  inline uint32_t get_length(uint32_t row_offset= 0)
123
123
  { return get_length(ptr+row_offset, this->packlength, table->s->db_low_byte_first); }
124
 
  uint32_t get_length(const unsigned char *ptr, uint packlength, bool low_byte_first);
 
124
  uint32_t get_length(const unsigned char *ptr, uint32_t packlength, bool low_byte_first);
125
125
  uint32_t get_length(const unsigned char *ptr_arg)
126
126
  { return get_length(ptr_arg, this->packlength, table->s->db_low_byte_first); }
127
127
  void put_length(unsigned char *pos, uint32_t length);
129
129
    {
130
130
      memcpy(str,ptr+packlength,sizeof(unsigned char*));
131
131
    }
132
 
  inline void get_ptr(unsigned char **str, uint row_offset)
 
132
  inline void get_ptr(unsigned char **str, uint32_t row_offset)
133
133
    {
134
134
      memcpy(str,ptr+packlength+row_offset,sizeof(char*));
135
135
    }
148
148
    {
149
149
      set_ptr_offset(0, length, data);
150
150
    }
151
 
  uint get_key_image(unsigned char *buff,uint length, imagetype type);
152
 
  void set_key_image(const unsigned char *buff,uint length);
 
151
  uint32_t get_key_image(unsigned char *buff,uint32_t length, imagetype type);
 
152
  void set_key_image(const unsigned char *buff,uint32_t length);
153
153
  void sql_type(String &str) const;
154
154
  inline bool copy()
155
155
  {
165
165
    return 0;
166
166
  }
167
167
  virtual unsigned char *pack(unsigned char *to, const unsigned char *from,
168
 
                      uint max_length, bool low_byte_first);
 
168
                      uint32_t max_length, bool low_byte_first);
169
169
  unsigned char *pack_key(unsigned char *to, const unsigned char *from,
170
 
                  uint max_length, bool low_byte_first);
 
170
                  uint32_t max_length, bool low_byte_first);
171
171
  unsigned char *pack_key_from_key_image(unsigned char* to, const unsigned char *from,
172
 
                                 uint max_length, bool low_byte_first);
 
172
                                 uint32_t max_length, bool low_byte_first);
173
173
  virtual const unsigned char *unpack(unsigned char *to, const unsigned char *from,
174
 
                              uint param_data, bool low_byte_first);
 
174
                              uint32_t param_data, bool low_byte_first);
175
175
  const unsigned char *unpack_key(unsigned char* to, const unsigned char *from,
176
 
                          uint max_length, bool low_byte_first);
177
 
  int pack_cmp(const unsigned char *a, const unsigned char *b, uint key_length,
 
176
                          uint32_t max_length, bool low_byte_first);
 
177
  int pack_cmp(const unsigned char *a, const unsigned char *b, uint32_t key_length,
178
178
               bool insert_or_update);
179
 
  int pack_cmp(const unsigned char *b, uint key_length,bool insert_or_update);
180
 
  uint packed_col_length(const unsigned char *col_ptr, uint length);
181
 
  uint max_packed_col_length(uint max_length);
 
179
  int pack_cmp(const unsigned char *b, uint32_t key_length,bool insert_or_update);
 
180
  uint32_t packed_col_length(const unsigned char *col_ptr, uint32_t length);
 
181
  uint32_t max_packed_col_length(uint32_t max_length);
182
182
  void free() { value.free(); }
183
183
  inline void clear_temporary() { memset(&value, 0, sizeof(value)); }
184
184
  friend int field_conv(Field *to,Field *from);
185
 
  uint size_of() const { return sizeof(*this); }
 
185
  uint32_t size_of() const { return sizeof(*this); }
186
186
  bool has_charset(void) const
187
187
  { return charset() == &my_charset_bin ? false : true; }
188
188
  uint32_t max_display_length();
189
 
  uint is_equal(Create_field *new_field);
 
189
  uint32_t is_equal(Create_field *new_field);
190
190
  inline bool in_read_set() { return bitmap_is_set(table->read_set, field_index); }
191
191
  inline bool in_write_set() { return bitmap_is_set(table->write_set, field_index); }
192
192
private: