~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/decimal.h

  • Committer: Toru Maesaka
  • Date: 2008-12-17 07:16:37 UTC
  • mto: (685.1.40 devel) (713.1.5 devel)
  • mto: This revision was merged to the branch mainline in revision 713.
  • Revision ID: dev@torum.net-20081217071637-7j9040w7lpms77r2
Removed my_time() and added error checking

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:
33
35
    Constructors take max_length of the field as a parameter - not the
34
36
    precision as the number of decimal digits allowed.
35
37
    So for example we need to count length from precision handling
36
 
    CREATE TABLE ( DECIMAL(x,y)) 
 
38
    CREATE TABLE ( DECIMAL(x,y))
37
39
  */
38
40
  Field_new_decimal(unsigned char *ptr_arg, uint32_t len_arg, unsigned char *null_ptr_arg,
39
41
                    unsigned char null_bit_arg,
62
64
  bool zero_pack() const { return 0; }
63
65
  void sql_type(String &str) const;
64
66
  uint32_t max_display_length() { return field_length; }
65
 
  uint32_t size_of() const { return sizeof(*this); } 
 
67
  uint32_t size_of() const { return sizeof(*this); }
66
68
  uint32_t pack_length() const { return (uint32_t) bin_size; }
67
69
  uint32_t pack_length_from_metadata(uint32_t field_metadata);
68
70
  uint32_t row_pack_length() { return pack_length(); }