~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/null.h

  • Committer: Monty Taylor
  • Date: 2008-09-15 17:24:04 UTC
  • Revision ID: monty@inaugust.com-20080915172404-ygh6hiyu0q7qpa9x
Removed strndup calls.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* - mode: c++ c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
4
 *  Copyright (C) 2008 MySQL
26
26
 */
27
27
 
28
28
class Field_null :public Field_str {
29
 
  static unsigned char null[1];
 
29
  static uchar null[1];
30
30
public:
31
 
  Field_null(unsigned char *ptr_arg, uint32_t len_arg,
 
31
  Field_null(uchar *ptr_arg, uint32_t len_arg,
32
32
             enum utype unireg_check_arg, const char *field_name_arg,
33
33
             const CHARSET_INFO * const cs)
34
34
    :Field_str(ptr_arg, len_arg, null, 1,
36
36
    {}
37
37
  enum_field_types type() const { return DRIZZLE_TYPE_NULL;}
38
38
  int  store(const char *to __attribute__((unused)),
39
 
             uint32_t length __attribute__((unused)),
 
39
             uint length __attribute__((unused)),
40
40
             const CHARSET_INFO * const cs __attribute__((unused)))
41
41
  { null[0]=1; return 0; }
42
42
  int store(double nr __attribute__((unused)))
56
56
  String *val_str(String *value __attribute__((unused)),
57
57
                  String *value2)
58
58
  { value2->length(0); return value2;}
59
 
  int cmp(const unsigned char *a __attribute__((unused)),
60
 
          const unsigned char *b __attribute__((unused))) { return 0;}
61
 
  void sort_string(unsigned char *buff __attribute__((unused)),
62
 
                   uint32_t length __attribute__((unused)))  {}
 
59
  int cmp(const uchar *a __attribute__((unused)),
 
60
          const uchar *b __attribute__((unused))) { return 0;}
 
61
  void sort_string(uchar *buff __attribute__((unused)),
 
62
                   uint length __attribute__((unused)))  {}
63
63
  uint32_t pack_length() const { return 0; }
64
64
  void sql_type(String &str) const;
65
 
  uint32_t size_of() const { return sizeof(*this); }
 
65
  uint size_of() const { return sizeof(*this); }
66
66
  uint32_t max_display_length() { return 4; }
67
67
};
68
68