00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #pragma once
00022
00023 #include <drizzled/field.h>
00024
00025 namespace drizzled
00026 {
00027
00028 class Field_num :public Field
00029 {
00030 public:
00031 const uint8_t dec;
00032 bool decimal_precision;
00033 bool unsigned_flag;
00034
00035 Field_num(unsigned char *ptr_arg,uint32_t len_arg, unsigned char *null_ptr_arg,
00036 unsigned char null_bit_arg, utype unireg_check_arg,
00037 const char *field_name_arg,
00038 uint8_t dec_arg, bool zero_arg, bool unsigned_arg);
00039
00040 Item_result result_type () const { return REAL_RESULT; }
00041
00042 friend class CreateField;
00043
00044 void make_field(SendField *);
00045
00046 uint32_t decimals() const { return (uint32_t) dec; }
00047
00048 uint32_t size_of() const { return sizeof(*this); }
00049
00050 bool eq_def(Field *field);
00051
00052 int store_decimal(const type::Decimal *);
00053
00054 type::Decimal *val_decimal(type::Decimal *) const;
00055
00056 uint32_t is_equal(CreateField *new_field);
00057
00058 int check_int(const CHARSET_INFO * const cs, const char *str, int length,
00059 const char *int_end, int error);
00060
00061 bool get_int(const CHARSET_INFO * const cs, const char *from, uint32_t len,
00062 int64_t *rnd, uint64_t unsigned_max,
00063 int64_t signed_min, int64_t signed_max);
00064 };
00065
00066 }
00067