~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/varstring.cc

  • Committer: Olaf van der Spek
  • Date: 2011-07-04 19:11:47 UTC
  • mto: This revision was merged to the branch mainline in revision 2367.
  • Revision ID: olafvdspek@gmail.com-20110704191147-s99ojek811zi1fzj
Remove unused Name_resolution_context::error_reporter

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 */
20
20
 
21
21
 
22
 
#include "config.h"
 
22
#include <config.h>
23
23
#include <drizzled/field/varstring.h>
24
24
#include <drizzled/table.h>
25
25
#include <drizzled/session.h>
26
 
#include "plugin/myisam/myisam.h"
 
26
#include <plugin/myisam/myisam.h>
27
27
 
28
28
#include <string>
29
29
 
56
56
                                 unsigned char *null_ptr_arg,
57
57
                                 unsigned char null_bit_arg,
58
58
                                 const char *field_name_arg,
59
 
                                 const CHARSET_INFO * const cs) :
 
59
                                 const charset_info_st * const cs) :
60
60
  Field_str(ptr_arg,
61
61
            len_arg,
62
62
            null_ptr_arg,
69
69
Field_varstring::Field_varstring(uint32_t len_arg,
70
70
                                 bool maybe_null_arg,
71
71
                                 const char *field_name_arg,
72
 
                                 const CHARSET_INFO * const cs) :
 
72
                                 const charset_info_st * const cs) :
73
73
  Field_str((unsigned char*) 0,
74
74
            len_arg,
75
75
            maybe_null_arg ? (unsigned char*) "": 0,
80
80
{
81
81
}
82
82
 
83
 
int Field_varstring::store(const char *from,uint32_t length, const CHARSET_INFO * const cs)
 
83
int Field_varstring::store(const char *from,uint32_t length, const charset_info_st * const cs)
84
84
{
85
85
  uint32_t copy_length;
86
86
  const char *well_formed_error_pos;
124
124
}
125
125
 
126
126
 
127
 
double Field_varstring::val_real(void)
 
127
double Field_varstring::val_real(void) const
128
128
{
129
129
  int not_used;
130
130
  char *end_not_used;
138
138
}
139
139
 
140
140
 
141
 
int64_t Field_varstring::val_int(void)
 
141
int64_t Field_varstring::val_int(void) const
142
142
{
143
143
  int not_used;
144
144
  char *end_not_used;
152
152
                     &end_not_used, &not_used);
153
153
}
154
154
 
155
 
String *Field_varstring::val_str(String *,
156
 
                                 String *val_ptr)
 
155
String *Field_varstring::val_str(String *, String *val_ptr) const
157
156
{
158
157
  uint32_t length=  length_bytes == 1 ? (uint32_t) *ptr : uint2korr(ptr);
159
158
 
165
164
}
166
165
 
167
166
 
168
 
type::Decimal *Field_varstring::val_decimal(type::Decimal *decimal_value)
 
167
type::Decimal *Field_varstring::val_decimal(type::Decimal *decimal_value) const
169
168
{
170
169
  uint32_t length;
171
170
 
282
281
}
283
282
 
284
283
 
285
 
void Field_varstring::sql_type(String &res) const
286
 
{
287
 
  const CHARSET_INFO * const cs=res.charset();
288
 
  uint32_t length;
289
 
 
290
 
  length= cs->cset->snprintf(cs,(char*) res.ptr(),
291
 
                             res.alloced_length(), "%s(%d)",
292
 
                              (has_charset() ? "varchar" : "varbinary"),
293
 
                             (int) field_length / charset()->mbmaxlen);
294
 
  res.length(length);
295
 
}
296
 
 
297
 
 
298
284
uint32_t Field_varstring::used_length()
299
285
{
300
286
  return length_bytes == 1 ? 1 + (uint32_t) (unsigned char) *ptr : 2 + uint2korr(ptr);