~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/num.h

  • Committer: Brian Aker
  • Date: 2009-08-04 06:21:17 UTC
  • mfrom: (1108.2.2 merge)
  • Revision ID: brian@gaz-20090804062117-fef8x6y3ydzrvab3
Merge Brian

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
1
/* - mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
4
 *  Copyright (C) 2008 MySQL
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#ifndef DRIZZLED_FIELD_NUM_H
22
 
#define DRIZZLED_FIELD_NUM_H
23
 
 
24
 
#include "drizzled/field.h"
25
 
 
26
 
namespace drizzled
27
 
{
28
 
 
29
 
class Field_num :public Field 
30
 
{
 
21
#ifndef DRIZZLE_SERVER_FIELD_NUM
 
22
#define DRIZZLE_SERVER_FIELD_NUM
 
23
 
 
24
class Field_num :public Field {
31
25
public:
32
26
  const uint8_t dec;
33
27
  bool decimal_precision;       // Purify cannot handle bit fields & only for decimal type
34
28
  bool unsigned_flag;   // Purify cannot handle bit fields
35
 
 
36
29
  Field_num(unsigned char *ptr_arg,uint32_t len_arg, unsigned char *null_ptr_arg,
37
30
            unsigned char null_bit_arg, utype unireg_check_arg,
38
31
            const char *field_name_arg,
39
32
            uint8_t dec_arg, bool zero_arg, bool unsigned_arg);
40
 
 
41
33
  Item_result result_type () const { return REAL_RESULT; }
42
 
 
43
34
  friend class CreateField;
44
 
 
45
35
  void make_field(SendField *);
46
 
 
47
36
  uint32_t decimals() const { return (uint32_t) dec; }
48
 
 
49
37
  uint32_t size_of() const { return sizeof(*this); }
50
 
 
51
38
  bool eq_def(Field *field);
52
 
 
53
 
  int store_decimal(const type::Decimal *);
54
 
 
55
 
  type::Decimal *val_decimal(type::Decimal *);
56
 
 
 
39
  int store_decimal(const my_decimal *);
 
40
  my_decimal *val_decimal(my_decimal *);
57
41
  uint32_t is_equal(CreateField *new_field);
58
 
 
59
42
  int check_int(const CHARSET_INFO * const cs, const char *str, int length,
60
43
                const char *int_end, int error);
61
 
 
62
44
  bool get_int(const CHARSET_INFO * const cs, const char *from, uint32_t len,
63
45
               int64_t *rnd, uint64_t unsigned_max,
64
46
               int64_t signed_min, int64_t signed_max);
65
47
};
66
48
 
67
 
} /* namespace drizzled */
68
49
 
69
 
#endif /* DRIZZLED_FIELD_NUM_H */
 
50
#endif