~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/fstring.cc

  • Committer: Brian Aker
  • Date: 2008-08-07 16:29:49 UTC
  • mfrom: (264.1.20 codestyle)
  • Revision ID: brian@tangent.org-20080807162949-7o8eyjgdn8ms3n1a
Merge from Monty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#pragma implementation                          // gcc: Class implementation
23
23
#endif
24
24
 
 
25
#include <drizzled/server_includes.h>
25
26
#include <drizzled/field/fstring.h>
26
27
#include <drizzled/drizzled_error_messages.h>
27
28
 
34
35
****************************************************************************/
35
36
 
36
37
/* Copy a string and fill with space */
37
 
int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
 
38
int Field_string::store(const char *from,uint length, const CHARSET_INFO * const cs)
38
39
{
39
40
  uint copy_length;
40
41
  const char *well_formed_error_pos;
70
71
{
71
72
  char buff[64];
72
73
  int  l;
73
 
  CHARSET_INFO *cs=charset();
 
74
  const CHARSET_INFO * const cs= charset();
74
75
  l= (cs->cset->int64_t10_to_str)(cs,buff,sizeof(buff),
75
76
                                   unsigned_val ? 10 : -10, nr);
76
77
  return Field_string::store(buff,(uint)l,cs);
81
82
{
82
83
  int error;
83
84
  char *end;
84
 
  CHARSET_INFO *cs= charset();
 
85
  const CHARSET_INFO * const cs= charset();
85
86
  double result;
86
87
  
87
88
  result=  my_strntod(cs,(char*) ptr,field_length,&end,&error);
106
107
{
107
108
  int error;
108
109
  char *end;
109
 
  CHARSET_INFO *cs= charset();
 
110
  const CHARSET_INFO * const cs= charset();
110
111
  int64_t result;
111
112
 
112
113
  result= my_strntoll(cs, (char*) ptr,field_length,10,&end,&error);
151
152
  if (!table->in_use->no_errors && err)
152
153
  {
153
154
    char buf[DECIMAL_TO_STRING_CONVERSION_BUFFER_SIZE];
154
 
    CHARSET_INFO *cs= charset();
 
155
    const CHARSET_INFO * const cs= charset();
155
156
    String tmp(buf, sizeof(buf), cs);
156
157
    tmp.copy((char*) ptr, field_length, cs);
157
158
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
199
200
void Field_string::sql_type(String &res) const
200
201
{
201
202
  THD *thd= table->in_use;
202
 
  CHARSET_INFO *cs=res.charset();
 
203
  const CHARSET_INFO * const cs= res.charset();
203
204
  ulong length;
204
205
 
205
206
  length= cs->cset->snprintf(cs,(char*) res.ptr(),