~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/decimal.h

  • Committer: Monty Taylor
  • Date: 2009-03-04 02:16:28 UTC
  • mto: (917.1.2 mordred)
  • mto: This revision was merged to the branch mainline in revision 912.
  • Revision ID: mordred@inaugust.com-20090304021628-rfq0b16uoi09g8tx
Fix to make VPATH builds work again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef DRIZZLE_SERVER_FIELD_NEW_DECIMAL
22
22
#define DRIZZLE_SERVER_FIELD_NEW_DECIMAL
23
23
 
 
24
#include <drizzled/field/num.h>
 
25
 
24
26
/* New decimal/numeric field which use fixed point arithmetic */
25
27
class Field_new_decimal :public Field_num {
26
28
private:
27
29
  int do_save_field_metadata(unsigned char *first_byte);
28
30
public:
 
31
 
 
32
  using Field::store;
 
33
  using Field::val_int;
 
34
  using Field::val_str;
 
35
  using Field::cmp;
 
36
  using Field::unpack;
 
37
 
29
38
  /* The maximum number of decimal digits can be stored */
30
39
  uint32_t precision;
31
40
  uint32_t bin_size;
33
42
    Constructors take max_length of the field as a parameter - not the
34
43
    precision as the number of decimal digits allowed.
35
44
    So for example we need to count length from precision handling
36
 
    CREATE TABLE ( DECIMAL(x,y)) 
 
45
    CREATE TABLE ( DECIMAL(x,y))
37
46
  */
38
47
  Field_new_decimal(unsigned char *ptr_arg, uint32_t len_arg, unsigned char *null_ptr_arg,
39
48
                    unsigned char null_bit_arg,
62
71
  bool zero_pack() const { return 0; }
63
72
  void sql_type(String &str) const;
64
73
  uint32_t max_display_length() { return field_length; }
65
 
  uint32_t size_of() const { return sizeof(*this); } 
 
74
  uint32_t size_of() const { return sizeof(*this); }
66
75
  uint32_t pack_length() const { return (uint32_t) bin_size; }
67
76
  uint32_t pack_length_from_metadata(uint32_t field_metadata);
68
77
  uint32_t row_pack_length() { return pack_length(); }