~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/index_hint.h

  • Committer: Mark Atwood
  • Date: 2011-08-21 06:56:57 UTC
  • mfrom: (2385.3.34 rf)
  • Revision ID: me@mark.atwood.name-20110821065657-vk2at03z9u17mf1d
mergeĀ lp:~olafvdspek/drizzle/refactor7

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
#pragma once
28
28
 
29
 
namespace drizzled
30
 
{
 
29
namespace drizzled {
31
30
 
32
31
/*
33
32
  String names used to print a statement with index hints.
34
33
  Keep in sync with index_hint_type.
35
34
*/
36
 
extern const char * index_hint_type_name[];
 
35
extern const char* index_hint_type_name[];
37
36
typedef unsigned char index_clause_map;
38
37
 
39
38
enum index_hint_type
51
50
#define INDEX_HINT_MASK_GROUP (1 << 1)
52
51
#define INDEX_HINT_MASK_ORDER (1 << 2)
53
52
 
54
 
#define INDEX_HINT_MASK_ALL (INDEX_HINT_MASK_JOIN | INDEX_HINT_MASK_GROUP | \
55
 
                             INDEX_HINT_MASK_ORDER)
 
53
#define INDEX_HINT_MASK_ALL (INDEX_HINT_MASK_JOIN | INDEX_HINT_MASK_GROUP | INDEX_HINT_MASK_ORDER)
56
54
 
57
55
/* Single element of an USE/FORCE/IGNORE INDEX list specified as a SQL hint  */
58
56
class Index_hint : public memory::SqlAlloc
59
57
{
60
58
public:
61
59
  /* The type of the hint : USE/FORCE/IGNORE */
62
 
  enum index_hint_type type;
 
60
  index_hint_type type;
63
61
  /* Where the hit applies to. A bitmask of INDEX_HINT_MASK_<place> values */
64
62
  index_clause_map clause;
65
63
  /*
66
64
    The index name. Empty (str=NULL) name represents an empty list
67
65
    USE INDEX () clause
68
66
  */
69
 
  lex_string_t key_name;
 
67
  const char* key_name;
70
68
 
71
 
  Index_hint (enum index_hint_type type_arg, index_clause_map clause_arg,
72
 
              char *str, uint32_t length) :
73
 
    type(type_arg), clause(clause_arg)
 
69
  Index_hint(index_hint_type type_arg, index_clause_map clause_arg, const char *str) :
 
70
    type(type_arg), clause(clause_arg), key_name(str)
74
71
  {
75
 
    key_name.str= str;
76
 
    key_name.length= length;
77
72
  }
78
73
 
79
 
  void print(Session *session, String *str);
 
74
  void print(String&) const;
80
75
};
81
76
 
82
77
} /* namespace drizzled */
83