~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/create_field.h

  • Committer: Brian Aker
  • Date: 2010-01-22 00:53:13 UTC
  • Revision ID: brian@gaz-20100122005313-jmizcbcdi1lt4tcx
Revert db patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008-2009 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008-2009 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
20
20
#ifndef DRIZZLED_CREATE_FIELD_H
21
21
#define DRIZZLED_CREATE_FIELD_H
22
22
 
23
 
#include <drizzled/field.h>
 
23
#include "drizzled/field.h"
24
24
 
25
 
namespace drizzled
26
 
{
27
25
class Item;
28
26
typedef struct st_typelib TYPELIB;
29
27
 
33
31
 * Basically, all information for a new or altered field
34
32
 * definition is contained in the Create_field class.
35
33
 */
36
 
class CreateField :public memory::SqlAlloc
 
34
class CreateField :public drizzled::memory::SqlAlloc
37
35
{
38
36
public:
39
37
  const char *field_name; /**< Name of the field to be created */
42
40
  LEX_STRING comment; /**< A comment for this field */
43
41
  Item *def; /**< Default value for the new field */
44
42
  enum enum_field_types sql_type; /**< The data type of the new field */
45
 
 
46
 
  enum_field_types type() const
47
 
  {
48
 
    return sql_type;
49
 
  }
50
 
 
51
43
  /**
52
44
   * At various stages in execution this can be length of field in bytes or
53
45
   * max number of characters.
70
62
 
71
63
  uint8_t interval_id;  // For rea_create_table
72
64
  uint32_t offset;
 
65
  uint32_t pack_flag;
73
66
 
74
67
  CreateField() :after(0) {}
75
68
  CreateField(Field *field, Field *orig_field);
76
69
  /* Used to make a clone of this object for ALTER/CREATE TABLE */
77
 
  CreateField *clone(memory::Root *mem_root) const
 
70
  CreateField *clone(drizzled::memory::Root *mem_root) const
78
71
    { return new (mem_root) CreateField(*this); }
79
72
  void create_length_to_internal_length(void);
80
73
 
131
124
            enum column_format_type column_format);
132
125
};
133
126
 
134
 
std::ostream& operator<<(std::ostream& output, const CreateField &field);
135
 
 
136
 
} /* namespace drizzled */
137
 
 
138
127
#endif /* DRIZZLED_CREATE_FIELD_H */