~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/num.cc

  • Committer: Monty Taylor
  • Date: 2009-03-04 02:48:12 UTC
  • mto: (917.1.2 mordred)
  • mto: This revision was merged to the branch mainline in revision 918.
  • Revision ID: mordred@inaugust.com-20090304024812-5wb6wpye5c1iitbq
Applied atomic patch to current tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 */
20
20
 
21
21
 
22
 
#include "config.h"
 
22
#include <drizzled/server_includes.h>
23
23
#include <drizzled/field/num.h>
24
24
#include <drizzled/error.h>
25
25
#include <drizzled/table.h>
26
26
#include <drizzled/session.h>
27
 
#include "drizzled/internal/my_sys.h"
28
 
 
29
 
namespace drizzled
30
 
{
31
27
 
32
28
/**
33
29
  Numeric fields base class constructor.
74
70
    char buff[128];
75
71
    String tmp(buff, (uint32_t) sizeof(buff), system_charset_info);
76
72
    tmp.copy(str, length, system_charset_info);
77
 
    push_warning_printf(getTable()->in_use, DRIZZLE_ERROR::WARN_LEVEL_WARN,
 
73
    push_warning_printf(table->in_use, DRIZZLE_ERROR::WARN_LEVEL_WARN,
78
74
                        ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
79
75
                        ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
80
76
                        "integer", tmp.c_ptr(), field_name,
81
 
                        (uint32_t) getTable()->in_use->row_count);
 
77
                        (uint32_t) table->in_use->row_count);
82
78
    return 1;
83
79
  }
84
80
  /* Test if we have garbage at the end of the given string. */
132
128
    goto out_of_range;
133
129
  }
134
130
 
135
 
  if (getTable()->in_use->count_cuted_fields &&
 
131
  if (table->in_use->count_cuted_fields &&
136
132
      check_int(cs, from, len, end, error))
137
133
    return 1;
138
134
  return 0;
180
176
my_decimal* Field_num::val_decimal(my_decimal *decimal_value)
181
177
{
182
178
  assert(result_type() == INT_RESULT);
183
 
 
184
179
  int64_t nr= val_int();
185
180
  int2my_decimal(E_DEC_FATAL_ERROR, nr, false, decimal_value);
186
181
  return decimal_value;
187
182
}
188
183
 
189
184
 
190
 
void Field_num::make_field(SendField *field)
 
185
void Field_num::make_field(Send_field *field)
191
186
{
192
187
  Field::make_field(field);
193
188
  field->decimals= dec;
208
203
  return 1;
209
204
}
210
205
 
211
 
uint32_t Field_num::is_equal(CreateField *new_field_ptr)
 
206
uint32_t Field_num::is_equal(Create_field *new_field_ptr)
212
207
{
213
208
  return ((new_field_ptr->sql_type == real_type()) &&
214
209
          ((new_field_ptr->flags & UNSIGNED_FLAG) ==
219
214
}
220
215
 
221
216
 
222
 
} /* namespace drizzled */