~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/field/null.h

  • Committer: Patrick Galbraith
  • Date: 2008-07-24 16:57:40 UTC
  • mto: (202.2.4 rename-mysql-to-drizzle)
  • mto: This revision was merged to the branch mainline in revision 212.
  • Revision ID: patg@ishvara-20080724165740-x58yw6zs6d9o17lf
Most everything working with client rename
mysqlslap test still fails... can't connect to the server

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
21
21
#ifndef DRIZZLE_SERVER_FIELD_NULL
22
22
#define DRIZZLE_SERVER_FIELD_NULL
23
23
 
 
24
#include "mysql_priv.h"
 
25
 
24
26
/* 
25
27
  Everything saved in this will disappear. It will always return NULL 
26
28
 */
27
29
 
28
30
class Field_null :public Field_str {
29
 
  static unsigned char null[1];
 
31
  static uchar null[1];
30
32
public:
31
 
  Field_null(unsigned char *ptr_arg, uint32_t len_arg,
 
33
  Field_null(uchar *ptr_arg, uint32_t len_arg,
32
34
             enum utype unireg_check_arg, const char *field_name_arg,
33
 
             const CHARSET_INFO * const cs)
 
35
             CHARSET_INFO *cs)
34
36
    :Field_str(ptr_arg, len_arg, null, 1,
35
37
               unireg_check_arg, field_name_arg, cs)
36
38
    {}
37
 
  enum_field_types type() const { return DRIZZLE_TYPE_NULL;}
38
 
  int  store(const char *to __attribute__((unused)),
39
 
             uint32_t length __attribute__((unused)),
40
 
             const CHARSET_INFO * const cs __attribute__((unused)))
41
 
  { null[0]=1; return 0; }
42
 
  int store(double nr __attribute__((unused)))
43
 
  { null[0]=1; return 0; }
44
 
  int store(int64_t nr __attribute__((unused)),
45
 
            bool unsigned_val __attribute__((unused)))
46
 
  { null[0]=1; return 0; }
47
 
  int store_decimal(const my_decimal *d __attribute__((unused)))
 
39
  enum_field_types type() const { return MYSQL_TYPE_NULL;}
 
40
  int  store(const char *to __attribute__((__unused__)),
 
41
             uint length __attribute__((__unused__)),
 
42
             CHARSET_INFO *cs __attribute__((__unused__)))
 
43
  { null[0]=1; return 0; }
 
44
  int store(double nr __attribute__((__unused__)))
 
45
  { null[0]=1; return 0; }
 
46
  int store(int64_t nr __attribute__((__unused__)),
 
47
            bool unsigned_val __attribute__((__unused__)))
 
48
  { null[0]=1; return 0; }
 
49
  int store_decimal(const my_decimal *d __attribute__((__unused__)))
48
50
  { null[0]=1; return 0; }
49
51
  int reset(void)
50
52
  { return 0; }
53
55
  int64_t val_int(void)
54
56
  { return 0;}
55
57
  my_decimal *val_decimal(my_decimal *) { return 0; }
56
 
  String *val_str(String *value __attribute__((unused)),
 
58
  String *val_str(String *value __attribute__((__unused__)),
57
59
                  String *value2)
58
60
  { 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)))  {}
 
61
  int cmp(const uchar *a __attribute__((__unused__)),
 
62
          const uchar *b __attribute__((__unused__))) { return 0;}
 
63
  void sort_string(uchar *buff __attribute__((__unused__)),
 
64
                   uint length __attribute__((__unused__)))  {}
63
65
  uint32_t pack_length() const { return 0; }
64
66
  void sql_type(String &str) const;
65
 
  uint32_t size_of() const { return sizeof(*this); }
 
67
  uint size_of() const { return sizeof(*this); }
66
68
  uint32_t max_display_length() { return 4; }
67
69
};
68
70