~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/num.h

  • Committer: Brian Aker
  • Date: 2008-07-28 18:01:38 UTC
  • Revision ID: brian@tangent.org-20080728180138-q2pxlq0qiapvqsdn
Remove YEAR field type

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* - mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2008 MySQL
5
 
 *
6
 
 *  This program is free software; you can redistribute it and/or modify
7
 
 *  it under the terms of the GNU General Public License as published by
8
 
 *  the Free Software Foundation; either version 2 of the License, or
9
 
 *  (at your option) any later version.
10
 
 *
11
 
 *  This program is distributed in the hope that it will be useful,
12
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 *  GNU General Public License for more details.
15
 
 *
16
 
 *  You should have received a copy of the GNU General Public License
17
 
 *  along with this program; if not, write to the Free Software
18
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 
 */
20
 
 
21
 
#ifndef DRIZZLED_FIELD_NUM_H
22
 
#define DRIZZLED_FIELD_NUM_H
23
 
 
24
 
#include "drizzled/field.h"
25
 
 
26
 
class Field_num :public Field 
27
 
{
28
 
public:
29
 
  const uint8_t dec;
30
 
  bool decimal_precision;       // Purify cannot handle bit fields & only for decimal type
31
 
  bool unsigned_flag;   // Purify cannot handle bit fields
32
 
  Field_num(unsigned char *ptr_arg,uint32_t len_arg, unsigned char *null_ptr_arg,
33
 
            unsigned char null_bit_arg, utype unireg_check_arg,
34
 
            const char *field_name_arg,
35
 
            uint8_t dec_arg, bool zero_arg, bool unsigned_arg);
36
 
  Item_result result_type () const { return REAL_RESULT; }
37
 
  friend class CreateField;
38
 
  void make_field(SendField *);
39
 
  uint32_t decimals() const { return (uint32_t) dec; }
40
 
  uint32_t size_of() const { return sizeof(*this); }
41
 
  bool eq_def(Field *field);
42
 
  int store_decimal(const my_decimal *);
43
 
  my_decimal *val_decimal(my_decimal *);
44
 
  uint32_t is_equal(CreateField *new_field);
45
 
  int check_int(const CHARSET_INFO * const cs, const char *str, int length,
46
 
                const char *int_end, int error);
47
 
  bool get_int(const CHARSET_INFO * const cs, const char *from, uint32_t len,
48
 
               int64_t *rnd, uint64_t unsigned_max,
49
 
               int64_t signed_min, int64_t signed_max);
50
 
};
51
 
 
52
 
 
53
 
#endif /* DRIZZLED_FIELD_NUM_H */