~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/double.cc

  • Committer: Brian Aker
  • Date: 2009-08-15 00:59:30 UTC
  • mfrom: (1115.1.7 merge)
  • Revision ID: brian@gaz-20090815005930-q47yenjrq1esiwsz
Merge of Trond + Brian

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 */
20
20
 
21
21
 
22
 
#include "config.h"
23
 
 
24
 
#include <float.h>
25
 
#include <math.h>
26
 
 
27
 
#include <algorithm>
28
 
 
 
22
#include <drizzled/server_includes.h>
29
23
#include <drizzled/field/double.h>
30
24
#include <drizzled/error.h>
31
25
#include <drizzled/table.h>
32
26
#include <drizzled/session.h>
33
 
#include "drizzled/internal/m_string.h"
 
27
 
 
28
#include <algorithm>
34
29
 
35
30
using namespace std;
36
31
 
37
 
namespace drizzled
38
 
{
39
32
 
40
33
/****************************************************************************
41
34
  double precision floating point numbers
164
157
  size_t len;
165
158
 
166
159
  if (dec >= NOT_FIXED_DEC)
167
 
    len= internal::my_gcvt(nr, internal::MY_GCVT_ARG_DOUBLE, to_length - 1, to, NULL);
 
160
    len= my_gcvt(nr, MY_GCVT_ARG_DOUBLE, to_length - 1, to, NULL);
168
161
  else
169
 
    len= internal::my_fcvt(nr, dec, to, NULL);
 
162
    len= my_fcvt(nr, dec, to, NULL);
170
163
 
171
164
  val_buffer->length((uint32_t) len);
172
165
 
209
202
}
210
203
 
211
204
 
 
205
/**
 
206
   Save the field metadata for double fields.
 
207
 
 
208
   Saves the pack length in the first byte of the field metadata array
 
209
   at index of *metadata_ptr.
 
210
 
 
211
   @param   metadata_ptr   First byte of field metadata
 
212
 
 
213
   @returns number of bytes written to metadata_ptr
 
214
*/
 
215
int Field_double::do_save_field_metadata(unsigned char *metadata_ptr)
 
216
{
 
217
  *metadata_ptr= pack_length();
 
218
  return 1;
 
219
}
 
220
 
 
221
 
212
222
void Field_double::sql_type(String &res) const
213
223
{
214
224
  const CHARSET_INFO * const cs=res.charset();
223
233
  }
224
234
}
225
235
 
226
 
} /* namespace drizzled */