32
32
using namespace std;
34
int CharSetISMethods::fillTable(Session *session, TableList *tables, COND *)
37
const char *wild= session->lex->wild ? session->lex->wild->ptr() : NULL;
38
Table *table= tables->table;
39
const CHARSET_INFO * const scs= system_charset_info;
41
for (cs= all_charsets ; cs < all_charsets+255 ; cs++)
43
const CHARSET_INFO * const tmp_cs= cs[0];
44
if (tmp_cs && (tmp_cs->state & MY_CS_PRIMARY) &&
45
(tmp_cs->state & MY_CS_AVAILABLE) &&
46
!(tmp_cs->state & MY_CS_HIDDEN) &&
48
wild_case_compare(scs, tmp_cs->csname,wild)))
51
table->restoreRecordAsDefault();
52
table->field[0]->store(tmp_cs->csname, strlen(tmp_cs->csname), scs);
53
table->field[1]->store(tmp_cs->name, strlen(tmp_cs->name), scs);
54
comment= tmp_cs->comment ? tmp_cs->comment : "";
55
table->field[2]->store(comment, strlen(comment), scs);
56
table->field[3]->store((int64_t) tmp_cs->mbmaxlen, true);
57
if (schema_table_store_record(session, table))
64
int CharSetISMethods::oldFormat(Session *session, InfoSchemaTable *schema_table)
67
int fields_arr[]= {0, 2, 1, 3, -1};
68
int *field_num= fields_arr;
69
const ColumnInfo *column;
70
Name_resolution_context *context= &session->lex->select_lex.context;
72
for (; *field_num >= 0; field_num++)
74
column= schema_table->getSpecificColumn(*field_num);
75
Item_field *field= new Item_field(context,
76
NULL, NULL, column->getName());
79
field->set_name(column->getOldName(),
80
strlen(column->getOldName()),
82
if (session->add_item_to_list(field))
34
89
int ProcessListISMethods::fillTable(Session* session, TableList* tables, COND*)
36
91
Table *table= tables->table;