~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/null.h

  • Committer: Mark Atwood
  • Date: 2011-08-12 04:08:33 UTC
  • mfrom: (2385.2.17 refactor5)
  • Revision ID: me@mark.atwood.name-20110812040833-u6j85nc6ahuc0dtz
mergeĀ lp:~olafvdspek/drizzle/refactor5

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#ifndef DRIZZLED_ITEM_NULL_H
21
 
#define DRIZZLED_ITEM_NULL_H
 
20
#pragma once
22
21
 
23
 
#include <drizzled/charset_info.h>
 
22
#include <drizzled/charset.h>
24
23
#include <drizzled/item/basic_constant.h>
25
24
 
26
 
namespace drizzled
27
 
{
 
25
namespace drizzled {
28
26
 
29
 
class Item_null :public Item_basic_constant
 
27
class Item_null : public Item_basic_constant
30
28
{
31
29
public:
32
30
 
33
 
  Item_null(char *name_par=0)
 
31
  Item_null(const char *name_par=0)
34
32
  {
35
33
    maybe_null= null_value= true;
36
34
    max_length= 0;
37
 
    name= name_par ? name_par : (char*) "NULL";
 
35
    name= name_par ? name_par : "NULL";
38
36
    fixed= 1;
39
37
    collation.set(&my_charset_bin, DERIVATION_IGNORABLE);
40
38
  }
41
 
  enum Type type() const { return NULL_ITEM; }
 
39
  Type type() const { return NULL_ITEM; }
42
40
  bool eq(const Item *item, bool binary_cmp) const;
43
41
  double val_real();
44
42
  int64_t val_int();
46
44
  type::Decimal *val_decimal(type::Decimal *);
47
45
  int save_in_field(Field *field, bool no_conversions);
48
46
  int save_safe_in_field(Field *field);
49
 
  bool send(plugin::Client *client, String *str);
 
47
  void send(plugin::Client *client, String *str);
50
48
  enum Item_result result_type () const { return STRING_RESULT; }
51
49
  enum_field_types field_type() const   { return DRIZZLE_TYPE_NULL; }
52
50
  bool basic_const_item() const { return 1; }
53
51
  Item *clone_item() { return new Item_null(name); }
54
52
  bool is_null() { return true; }
55
53
 
56
 
  virtual void print(String *str, enum_query_type);
 
54
  virtual void print(String *str);
57
55
 
58
 
  Item *safe_charset_converter(const CHARSET_INFO * const tocs);
 
56
  Item *safe_charset_converter(const charset_info_st * const tocs);
59
57
};
60
58
 
61
59
class Item_null_result :public Item_null
72
70
 
73
71
} /* namespace drizzled */
74
72
 
75
 
#endif /* DRIZZLED_ITEM_NULL_H */