~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to drizzled/key_part_spec.h

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include <drizzled/memory/sql_alloc.h>
24
24
#include <drizzled/lex_string.h>
25
25
 
26
 
namespace drizzled
 
26
namespace drizzled {
 
27
 
 
28
class Key_part_spec : public memory::SqlAlloc 
27
29
{
28
 
 
29
 
namespace memory { class Root; }
30
 
 
31
 
class Item;
32
 
 
33
 
class Key_part_spec :public memory::SqlAlloc {
34
30
public:
35
 
  LEX_STRING field_name;
 
31
  str_ref field_name;
36
32
  uint32_t length;
37
 
  Key_part_spec(const LEX_STRING &name, uint32_t len)
 
33
  Key_part_spec(str_ref name, uint32_t len)
38
34
    : field_name(name), length(len)
39
35
  {}
40
 
  Key_part_spec(const char *name, const size_t name_len, uint32_t len)
41
 
    : length(len)
42
 
  { field_name.str= const_cast<char *>(name); field_name.length= name_len; }
 
36
 
43
37
  bool operator==(const Key_part_spec& other) const;
44
38
  /**
45
39
    Construct a copy of this Key_part_spec. field_name is copied
52
46
  */
53
47
  Key_part_spec *clone(memory::Root *mem_root) const
54
48
  {
55
 
    return new (mem_root) Key_part_spec(*this);
 
49
    return new (*mem_root) Key_part_spec(*this);
56
50
  }
57
51
};
58
52