~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/double.cc

  • Committer: Mark Atwood
  • Date: 2009-01-08 23:29:00 UTC
  • mto: (779.1.3 devel)
  • mto: This revision was merged to the branch mainline in revision 784.
  • Revision ID: me@mark.atwood.name-20090108232900-yg03vfahncfabbf2
add syslog based logging plugin

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
  int error;
42
42
  char *end;
43
43
  double nr= my_strntod(cs,(char*) from, len, &end, &error);
44
 
  if (error || (!len || (((uint32_t) (end-from) != len) && table->in_use->count_cuted_fields)))
 
44
  if (error || (!len || (((uint) (end-from) != len) && table->in_use->count_cuted_fields)))
45
45
  {
46
46
    set_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN,
47
47
                (error ? ER_WARN_DATA_OUT_OF_RANGE : ER_WARN_DATA_TRUNCATED), 1);
117
117
  {
118
118
    char buf[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE];
119
119
    String tmp(buf, sizeof(buf), &my_charset_utf8_general_ci), *str;
120
 
    str= val_str(&tmp, &tmp);
 
120
    str= val_str(&tmp, 0);
121
121
    push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
122
122
                        ER_TRUNCATED_WRONG_VALUE,
123
123
                        ER(ER_TRUNCATED_WRONG_VALUE), "INTEGER",
128
128
 
129
129
 
130
130
String *Field_double::val_str(String *val_buffer,
131
 
                              String *)
 
131
                              String *val_ptr __attribute__((unused)))
132
132
{
133
133
  double nr;
134
134
#ifdef WORDS_BIGENDIAN
150
150
  else
151
151
    len= my_fcvt(nr, dec, to, NULL);
152
152
 
153
 
  val_buffer->length((uint32_t) len);
 
153
  val_buffer->length((uint) len);
154
154
 
155
155
  return val_buffer;
156
156
}
157
157
 
 
158
bool Field_double::send_binary(Protocol *protocol)
 
159
{
 
160
  return protocol->store((double) Field_double::val_real(), dec, (String*) 0);
 
161
}
 
162
 
 
163
 
158
164
int Field_double::cmp(const unsigned char *a_ptr, const unsigned char *b_ptr)
159
165
{
160
166
  double a,b;
176
182
 
177
183
/* The following should work for IEEE */
178
184
 
179
 
void Field_double::sort_string(unsigned char *to,uint32_t )
 
185
void Field_double::sort_string(unsigned char *to,uint32_t length __attribute__((unused)))
180
186
{
181
187
  double nr;
182
188
#ifdef WORDS_BIGENDIAN