22 #include <plugin/collation_dictionary/dictionary.h>
25 using namespace drizzled;
27 CharacterSetsTool::CharacterSetsTool() :
28 plugin::TableFunction(
"DATA_DICTIONARY",
"CHARACTER_SETS")
30 add_field(
"CHARACTER_SET_NAME");
31 add_field(
"DEFAULT_COLLATE_NAME");
32 add_field(
"DESCRIPTION");
33 add_field(
"MAXLEN", plugin::TableFunction::NUMBER, 0,
false);
36 CharacterSetsTool::Generator::Generator(
Field **arg) :
37 plugin::TableFunction::Generator(arg),
42 bool CharacterSetsTool::Generator::checkCharacterSet()
44 if (character_set() && (character_set()->state & MY_CS_PRIMARY) &&
45 (character_set()->state & MY_CS_AVAILABLE) && not (character_set()->state & MY_CS_HIDDEN))
53 bool CharacterSetsTool::Generator::nextCharacterSetCore()
61 character_set_iter= all_charsets;
65 if (character_set_iter == all_charsets+255)
68 if (checkCharacterSet())
74 bool CharacterSetsTool::Generator::nextCharacterSet()
76 while (not nextCharacterSetCore())
78 if (character_set_iter == all_charsets+255)
85 bool CharacterSetsTool::Generator::populate()
87 if (nextCharacterSet())
96 void CharacterSetsTool::Generator::fill()
101 push(tmp_cs->csname);
107 push(tmp_cs->comment);
110 push(static_cast<int64_t>(tmp_cs->mbmaxlen));