22 #include <plugin/collation_dictionary/dictionary.h>
28 CollationsTool::CollationsTool() :
31 add_field(
"CHARACTER_SET_NAME");
32 add_field(
"COLLATION_NAME");
33 add_field(
"DESCRIPTION");
34 add_field(
"ID", plugin::TableFunction::NUMBER, 0,
false);
35 add_field(
"IS_DEFAULT", plugin::TableFunction::BOOLEAN, 0,
false);
36 add_field(
"IS_COMPILED", plugin::TableFunction::BOOLEAN, 0,
false);
37 add_field(
"SORTLEN", plugin::TableFunction::NUMBER, 0,
false);
40 CollationsTool::Generator::Generator(
Field **arg) :
42 is_collation_primed(false)
47 bool CollationsTool::Generator::end()
49 return collation_iter == all_charsets+255;
53 bool CollationsTool::Generator::check()
59 not (tmp_cl->state & MY_CS_AVAILABLE) ||
60 not my_charset_same(tmp_cs, tmp_cl))
66 bool CollationsTool::Generator::nextCollationCore()
74 if (not isCharacterSetPrimed())
77 collation_iter= all_charsets;
91 bool CollationsTool::Generator::next()
93 while (not nextCollationCore())
96 if (isPrimed() && not end())
99 if (not nextCharacterSet())
108 bool CollationsTool::Generator::populate()
118 void CollationsTool::Generator::fill()
126 assert(tmp_cs->name);
131 assert(tmp_cl->name);
135 push(tmp_cl->csname);
138 push(static_cast<int64_t>(tmp_cl->number));
141 push((
bool)(tmp_cl->state & MY_CS_PRIMARY));
144 push((
bool)(tmp_cl->state & MY_CS_COMPILED));
147 push(static_cast<int64_t>(tmp_cl->strxfrm_multiply));
TODO: Rename this file - func.h is stupid.