22#include <plugin/collation_dictionary/dictionary.h>
27CharacterSetsTool::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);
36CharacterSetsTool::Generator::Generator(
Field **arg) :
37 plugin::TableFunction::Generator(arg),
38 character_set_iter(NULL),
43bool CharacterSetsTool::Generator::checkCharacterSet()
45 if (character_set() && (character_set()->state & MY_CS_PRIMARY) &&
46 (character_set()->state & MY_CS_AVAILABLE) && not (character_set()->state & MY_CS_HIDDEN))
54bool CharacterSetsTool::Generator::nextCharacterSetCore()
62 character_set_iter= all_charsets;
66 if (character_set_iter == all_charsets+255)
69 if (checkCharacterSet())
75bool CharacterSetsTool::Generator::nextCharacterSet()
77 while (not nextCharacterSetCore())
79 if (character_set_iter == all_charsets+255)
86bool CharacterSetsTool::Generator::populate()
88 if (nextCharacterSet())
97void CharacterSetsTool::Generator::fill()
99 const charset_info_st *
const tmp_cs= character_set_iter[0];
102 push(tmp_cs->csname);
108 push(tmp_cs->comment);
111 push(
static_cast<int64_t
>(tmp_cs->mbmaxlen));
TODO: Rename this file - func.h is stupid.