~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/blob.cc

  • Committer: Brian Aker
  • Date: 2011-02-20 21:00:32 UTC
  • mfrom: (2181.2.6 drizzle-build)
  • Revision ID: brian@tangent.org-20110220210032-fc9g8qugt0n1yjr6
Brian Aker 2011-02-20 Merge in additional header bits for strerror_r
Brian Aker 2011-02-20 Create CONST on additional Field methods.
Brian Aker 2011-02-19 Further commit const on field.
Brian Aker 2011-02-18 This fixes DEBUG based compiles.
Brian Aker 2011-02-18 Protect all of the val_* methods from modification.

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
 
91
91
 
92
92
uint32_t Field_blob::get_length(const unsigned char *pos,
93
 
                                bool low_byte_first)
 
93
                                bool low_byte_first) const
94
94
{
95
95
#ifndef WORDS_BIGENDIAN
96
96
  (void)low_byte_first;
113
113
}
114
114
 
115
115
 
116
 
uint32_t Field_blob::get_length(uint32_t row_offset)
 
116
uint32_t Field_blob::get_length(uint32_t row_offset) const
117
117
{
118
118
  return get_length(ptr+row_offset,
119
119
                    getTable()->getShare()->db_low_byte_first);
120
120
}
121
121
 
122
122
 
123
 
uint32_t Field_blob::get_length(const unsigned char *ptr_arg)
 
123
uint32_t Field_blob::get_length(const unsigned char *ptr_arg) const
124
124
{
125
125
  return get_length(ptr_arg, getTable()->getShare()->db_low_byte_first);
126
126
}
224
224
}
225
225
 
226
226
 
227
 
double Field_blob::val_real(void)
 
227
double Field_blob::val_real(void) const
228
228
{
229
229
  int not_used;
230
230
  char *end_not_used, *blob;
242
242
}
243
243
 
244
244
 
245
 
int64_t Field_blob::val_int(void)
 
245
int64_t Field_blob::val_int(void) const
246
246
{
247
247
  int not_used;
248
248
  char *blob;
252
252
  memcpy(&blob,ptr+sizeof(uint32_t),sizeof(char*));
253
253
  if (!blob)
254
254
    return 0;
255
 
  uint32_t length=get_length(ptr);
 
255
  uint32_t length= get_length(ptr);
256
256
  return my_strntoll(charset(),blob,length,10,NULL,&not_used);
257
257
}
258
258
 
259
 
String *Field_blob::val_str(String *,
260
 
                            String *val_ptr)
 
259
String *Field_blob::val_str(String *, String *val_ptr) const
261
260
{
262
261
  char *blob;
263
262
 
272
271
}
273
272
 
274
273
 
275
 
type::Decimal *Field_blob::val_decimal(type::Decimal *decimal_value)
 
274
type::Decimal *Field_blob::val_decimal(type::Decimal *decimal_value) const
276
275
{
277
276
  const char *blob;
278
277
  size_t length;