00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #pragma once
00022
00023 #include <drizzled/memory/sql_alloc.h>
00024 #include <drizzled/lex_string.h>
00025
00026 namespace drizzled
00027 {
00028
00029 namespace memory { class Root; }
00030
00031 class Item;
00032
00033 class Key_part_spec :public memory::SqlAlloc {
00034 public:
00035 LEX_STRING field_name;
00036 uint32_t length;
00037 Key_part_spec(const LEX_STRING &name, uint32_t len)
00038 : field_name(name), length(len)
00039 {}
00040 Key_part_spec(const char *name, const size_t name_len, uint32_t len)
00041 : length(len)
00042 { field_name.str= const_cast<char *>(name); field_name.length= name_len; }
00043 bool operator==(const Key_part_spec& other) const;
00053 Key_part_spec *clone(memory::Root *mem_root) const
00054 {
00055 return new (mem_root) Key_part_spec(*this);
00056 }
00057 };
00058
00059 }
00060