~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/index_hint.h

  • Committer: Olaf van der Spek
  • Date: 2011-08-15 15:17:19 UTC
  • mto: This revision was merged to the branch mainline in revision 2408.
  • Revision ID: olafvdspek@gmail.com-20110815151719-8jp69yf9tbv89kvc
Refactor

Show diffs side-by-side

added added

removed removed

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