~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/long.h

  • Committer: Lee Bieber
  • Date: 2010-11-14 23:15:42 UTC
  • mfrom: (1929.1.42 warning-stack-frame)
  • Revision ID: kalebral@gmail.com-20101114231542-fnnu6ydd2p17n582
Merge Monty - fix bug 672372: some functions use > 32k stack

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#ifndef DRIZZLED_FIELD_INT32_H
22
 
#define DRIZZLED_FIELD_INT32_H
 
21
#ifndef DRIZZLED_FIELD_LONG_H
 
22
#define DRIZZLED_FIELD_LONG_H
23
23
 
24
24
#include <drizzled/field/num.h>
25
25
 
26
26
namespace drizzled
27
27
{
28
28
 
29
 
namespace field
30
 
{
31
 
 
32
 
class Int32 :public Field_num {
 
29
class Field_long :public Field_num {
33
30
public:
34
31
 
35
32
  using Field::val_int;
39
36
  using Field::store;
40
37
  using Field::unpack;
41
38
 
42
 
  Int32(unsigned char *ptr_arg, uint32_t len_arg, unsigned char *null_ptr_arg,
43
 
        unsigned char null_bit_arg,
44
 
        enum utype unireg_check_arg,
45
 
        const char *field_name_arg) :
46
 
    Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
47
 
              unireg_check_arg, field_name_arg,
48
 
              0, false, false)
49
 
  {}
50
 
 
51
 
  Int32(uint32_t len_arg,bool maybe_null_arg, const char *field_name_arg,
52
 
        bool unsigned_arg) :
53
 
    Field_num((unsigned char*) 0, len_arg, maybe_null_arg ? (unsigned char*) "": 0,0,
54
 
              NONE, field_name_arg,0,0,unsigned_arg)
55
 
    {}
56
 
 
 
39
  Field_long(unsigned char *ptr_arg, uint32_t len_arg, unsigned char *null_ptr_arg,
 
40
             unsigned char null_bit_arg,
 
41
             enum utype unireg_check_arg, const char *field_name_arg,
 
42
             bool zero_arg, bool unsigned_arg)
 
43
    :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
 
44
               unireg_check_arg, field_name_arg,
 
45
               0, zero_arg,unsigned_arg)
 
46
    {}
 
47
  Field_long(uint32_t len_arg,bool maybe_null_arg, const char *field_name_arg,
 
48
             bool unsigned_arg)
 
49
    :Field_num((unsigned char*) 0, len_arg, maybe_null_arg ? (unsigned char*) "": 0,0,
 
50
               NONE, field_name_arg,0,0,unsigned_arg)
 
51
    {}
57
52
  enum Item_result result_type () const { return INT_RESULT; }
58
53
  enum_field_types type() const { return DRIZZLE_TYPE_LONG;}
59
54
  enum ha_base_keytype key_type() const
60
 
  { return unsigned_flag ? HA_KEYTYPE_ULONG_INT : HA_KEYTYPE_LONG_INT; }
 
55
    { return unsigned_flag ? HA_KEYTYPE_ULONG_INT : HA_KEYTYPE_LONG_INT; }
61
56
  int store(const char *to,uint32_t length, const CHARSET_INFO * const charset);
62
57
  int store(double nr);
63
58
  int store(int64_t nr, bool unsigned_val);
71
66
  void sql_type(String &str) const;
72
67
  uint32_t max_display_length() { return MY_INT32_NUM_DECIMAL_DIGITS; }
73
68
  virtual unsigned char *pack(unsigned char* to, const unsigned char *from,
74
 
                              uint32_t max_length,
 
69
                      uint32_t max_length,
 
70
                      bool low_byte_first);
 
71
 
 
72
  virtual const unsigned char *unpack(unsigned char* to, const unsigned char *from,
 
73
                              uint32_t param_data,
75
74
                              bool low_byte_first);
76
 
 
77
 
  virtual const unsigned char *unpack(unsigned char* to, const unsigned char *from,
78
 
                                      uint32_t param_data,
79
 
                                      bool low_byte_first);
80
75
};
81
76
 
82
 
} /* namespace field */
83
77
} /* namespace drizzled */
84
78
 
85
 
#endif /* DRIZZLED_FIELD_INT32_H */
 
79
#endif /* DRIZZLED_FIELD_LONG_H */
86
80