28
28
CollationsTool::CollationsTool() :
29
plugin::TableFunction("DATA_DICTIONARY", "COLLATIONS")
29
CharacterSetsTool("COLLATIONS")
31
31
add_field("CHARACTER_SET_NAME");
32
32
add_field("COLLATION_NAME");
40
40
CollationsTool::Generator::Generator(Field **arg) :
41
plugin::TableFunction::Generator(arg)
41
CharacterSetsTool::Generator(arg),
42
is_collation_primed(false)
47
bool CollationsTool::Generator::end()
49
return collation_iter == all_charsets+255;
53
bool CollationsTool::Generator::check()
55
const CHARSET_INFO *tmp_cs= character_set();
56
const CHARSET_INFO *tmp_cl= collation();
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())
47
108
bool CollationsTool::Generator::populate()
49
for (; cs < all_charsets+255 ; cs++)
51
const CHARSET_INFO *tmp_cs= cs[0];
53
if (! tmp_cs || ! (tmp_cs->state & MY_CS_AVAILABLE) ||
54
(tmp_cs->state & MY_CS_HIDDEN) ||
55
!(tmp_cs->state & MY_CS_PRIMARY))
58
for (; cl < all_charsets+255 ;cl ++)
60
const CHARSET_INFO *tmp_cl= cl[0];
62
if (! tmp_cl || ! (tmp_cl->state & MY_CS_AVAILABLE) ||
63
!my_charset_same(tmp_cs, tmp_cl))
67
/* CHARACTER_SET_NAME */
70
/* "COLLATION_NAME" */
77
push((int64_t) tmp_cl->number);
80
push((bool)(tmp_cl->state & MY_CS_PRIMARY));
83
push((bool)(tmp_cl->state & MY_CS_COMPILED));
86
push((int64_t) tmp_cl->strxfrm_multiply);
118
void CollationsTool::Generator::fill()
120
const CHARSET_INFO *tmp_cs= character_set();
121
const CHARSET_INFO *tmp_cl= collation_iter[0];
126
fprintf(stderr, "CHAR %s\n", tmp_cs->name);
127
assert(tmp_cs->name);
128
/* CHARACTER_SET_NAME */
131
/* "COLLATION_NAME" */
132
assert(tmp_cl->name);
136
push(tmp_cl->csname);
139
push((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((int64_t) tmp_cl->strxfrm_multiply);