22#include <plugin/collation_dictionary/dictionary.h>
28CollationsTool::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);
40CollationsTool::Generator::Generator(
Field **arg) :
43 is_collation_primed(false)
48bool CollationsTool::Generator::end()
50 return collation_iter == all_charsets+255;
54bool CollationsTool::Generator::check()
56 const charset_info_st *tmp_cs= character_set();
57 const charset_info_st *tmp_cl= collation();
60 not (tmp_cl->state & MY_CS_AVAILABLE) ||
61 not my_charset_same(tmp_cs, tmp_cl))
67bool CollationsTool::Generator::nextCollationCore()
75 if (not isCharacterSetPrimed())
78 collation_iter= all_charsets;
92bool CollationsTool::Generator::next()
94 while (not nextCollationCore())
97 if (isPrimed() && not end())
100 if (not nextCharacterSet())
109bool CollationsTool::Generator::populate()
119void CollationsTool::Generator::fill()
121 const charset_info_st *tmp_cs= character_set();
122 const charset_info_st *tmp_cl= collation_iter[0];
127 assert(tmp_cs->name);
132 assert(tmp_cl->name);
136 push(tmp_cl->csname);
139 push(
static_cast<int64_t
>(tmp_cl->number));
142 push((
bool)(tmp_cl->state & MY_CS_PRIMARY));
145 push((
bool)(tmp_cl->state & MY_CS_COMPILED));
148 push(
static_cast<int64_t
>(tmp_cl->strxfrm_multiply));
TODO: Rename this file - func.h is stupid.