~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/real.cc

  • Committer: Monty Taylor
  • Date: 2009-03-18 18:45:23 UTC
  • mto: (950.1.1 mordred)
  • mto: This revision was merged to the branch mainline in revision 943.
  • Revision ID: mordred@inaugust.com-20090318184523-mfbjyj5wkipv4n3b
Moved big tests to big suite. Added make target "make test-big" to allow for easy running of the big tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include <config.h>
 
21
#include <drizzled/server_includes.h>
22
22
#include <drizzled/field/real.h>
23
23
#include <drizzled/error.h>
24
24
#include <drizzled/table.h>
25
25
 
26
 
#include <math.h>
27
 
 
28
26
#include <limits>
29
27
 
30
28
using namespace std;
31
29
 
32
 
namespace drizzled
33
 
{
34
 
 
35
 
extern const double log_10[309];
36
 
 
37
30
/*
38
31
  Floating-point numbers
39
32
 */
44
37
{
45
38
  assert(max_length >= pack_length());
46
39
#ifdef WORDS_BIGENDIAN
47
 
  if (low_byte_first != getTable()->getShare()->db_low_byte_first)
 
40
  if (low_byte_first != table->s->db_low_byte_first)
48
41
  {
49
42
    const unsigned char *dptr= from + pack_length();
50
43
    while (dptr-- > from)
61
54
                   uint32_t param_data, bool low_byte_first)
62
55
{
63
56
#ifdef WORDS_BIGENDIAN
64
 
  if (low_byte_first != getTable()->getShare()->db_low_byte_first)
 
57
  if (low_byte_first != table->s->db_low_byte_first)
65
58
  {
66
59
    const unsigned char *dptr= from + pack_length();
67
60
    while (dptr-- > from)
129
122
}
130
123
 
131
124
 
132
 
int Field_real::store_decimal(const type::Decimal *dm)
 
125
int Field_real::store_decimal(const my_decimal *dm)
133
126
{
134
127
  double dbl;
135
 
  class_decimal2double(E_DEC_FATAL_ERROR, dm, &dbl);
 
128
  my_decimal2double(E_DEC_FATAL_ERROR, dm, &dbl);
136
129
  return store(dbl);
137
130
}
138
131
 
139
 
type::Decimal *Field_real::val_decimal(type::Decimal *decimal_value) const
 
132
my_decimal *Field_real::val_decimal(my_decimal *decimal_value)
140
133
{
141
 
  ASSERT_COLUMN_MARKED_FOR_READ;
142
 
 
143
 
  double2_class_decimal(E_DEC_FATAL_ERROR, val_real(), decimal_value);
 
134
  double2my_decimal(E_DEC_FATAL_ERROR, val_real(), decimal_value);
144
135
  return decimal_value;
145
136
}
146
 
 
147
 
} /* namespace drizzled */