Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00030 #include <config.h>
00031 #include <drizzled/sql_string.h>
00032 #include <drizzled/session.h>
00033 #include <drizzled/index_hint.h>
00034 #include <drizzled/sql_table.h>
00035
00036 namespace drizzled
00037 {
00038
00039
00040
00041
00042
00043 const char *index_hint_type_name[] =
00044 {
00045 "IGNORE INDEX"
00046 , "USE INDEX"
00047 , "FORCE INDEX"
00048 };
00049
00058 void Index_hint::print(Session *session, String *str)
00059 {
00060 str->append(STRING_WITH_LEN(index_hint_type_name[type]));
00061 str->append(STRING_WITH_LEN(" ("));
00062 if (key_name.length)
00063 {
00064 if (session && is_primary_key_name(key_name.str))
00065 str->append(is_primary_key_name(key_name.str));
00066 else
00067 str->append_identifier(key_name.str, key_name.length);
00068 }
00069 str->append(')');
00070 }
00071
00072 }