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/epoch.h>
00024
00025 namespace drizzled {
00026 namespace field {
00027
00028 class Microtime :public Epoch {
00029 public:
00030
00031 typedef Microtime* pointer;
00032
00033 Microtime(unsigned char *ptr_arg,
00034 unsigned char *null_ptr_arg,
00035 unsigned char null_bit_arg,
00036 enum utype unireg_check_arg,
00037 const char *field_name_arg,
00038 drizzled::TableShare *share);
00039
00040 Microtime(bool maybe_null_arg,
00041 const char *field_name_arg);
00042
00043 enum_field_types type() const { return DRIZZLE_TYPE_MICROTIME;}
00044 enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; }
00045 enum Item_result cmp_type () const { return STRING_RESULT; }
00046 int store(const char *to,uint32_t length,
00047 const charset_info_st * const charset);
00048 int store(double nr);
00049 int store(int64_t nr, bool unsigned_val);
00050 int store_time(type::Time <ime, type::timestamp_t t_type);
00051
00052 String *val_str(String*,String *) const;
00053 double val_real(void) const;
00054 int64_t val_int(void) const;
00055 type::Decimal *val_decimal(type::Decimal *decimal_value) const;
00056
00057 int cmp(const unsigned char *,const unsigned char *);
00058 void sort_string(unsigned char *buff,uint32_t length);
00059 uint32_t pack_length() const { return 12; }
00060 bool can_be_compared_as_int64_t() const { return false; }
00061 bool zero_pack() const { return 0; }
00062 void set_time();
00063
00064
00065 long get_timestamp(bool *null_value) const;
00066
00067 private:
00068 bool get_date(type::Time <ime,uint32_t fuzzydate) const;
00069 bool get_time(type::Time <ime) const;
00070
00071 public:
00072 static size_t max_string_length()
00073 {
00074 return 12;
00075 }
00076 };
00077
00078 }
00079 }
00080
00081