82
82
** List all table types supported
83
83
***************************************************************************/
85
static int make_version_string(char *buf, int buf_length, uint version)
87
return snprintf(buf, buf_length, "%d.%d", version>>8,version&0xff);
90
85
static bool show_plugins(THD *thd, plugin_ref plugin,
94
89
struct st_mysql_plugin *plug= plugin_decl(plugin);
95
90
struct st_plugin_dl *plugin_dl= plugin_dlib(plugin);
96
91
CHARSET_INFO *cs= system_charset_info;
99
93
restore_record(table, s->default_values);
101
95
table->field[0]->store(plugin_name(plugin)->str,
102
96
plugin_name(plugin)->length, cs);
104
table->field[1]->store(version_buf,
105
make_version_string(version_buf, sizeof(version_buf), plug->version),
100
table->field[1]->store(plug->version, strlen(plug->version), cs);
101
table->field[1]->set_notnull();
104
table->field[1]->set_null();
109
106
switch (plugin_state(plugin)) {
110
107
/* case PLUGIN_IS_FREED: does not happen */
124
121
table->field[3]->store(plugin_type_names[plug->type].str,
125
122
plugin_type_names[plug->type].length,
127
table->field[4]->store(version_buf,
128
make_version_string(version_buf, sizeof(version_buf),
129
*(uint *)plug->info), cs);
133
table->field[5]->store(plugin_dl->dl.str, plugin_dl->dl.length, cs);
127
table->field[4]->store(plugin_dl->dl.str, plugin_dl->dl.length, cs);
128
table->field[4]->set_notnull();
132
table->field[4]->set_null();
137
table->field[5]->store(plug->author, strlen(plug->author), cs);
134
138
table->field[5]->set_notnull();
135
table->field[6]->store(version_buf,
136
make_version_string(version_buf, sizeof(version_buf),
141
table->field[5]->set_null();
145
table->field[6]->store(plug->descr, strlen(plug->descr), cs);
139
146
table->field[6]->set_notnull();
143
table->field[5]->set_null();
144
149
table->field[6]->set_null();
150
table->field[7]->store(plug->author, strlen(plug->author), cs);
151
table->field[7]->set_notnull();
154
table->field[7]->set_null();
158
table->field[8]->store(plug->descr, strlen(plug->descr), cs);
159
table->field[8]->set_notnull();
162
table->field[8]->set_null();
164
151
switch (plug->license) {
165
152
case PLUGIN_LICENSE_GPL:
166
table->field[9]->store(PLUGIN_LICENSE_GPL_STRING,
153
table->field[7]->store(PLUGIN_LICENSE_GPL_STRING,
167
154
strlen(PLUGIN_LICENSE_GPL_STRING), cs);
169
156
case PLUGIN_LICENSE_BSD:
170
table->field[9]->store(PLUGIN_LICENSE_BSD_STRING,
157
table->field[7]->store(PLUGIN_LICENSE_BSD_STRING,
171
158
strlen(PLUGIN_LICENSE_BSD_STRING), cs);
174
table->field[9]->store(PLUGIN_LICENSE_PROPRIETARY_STRING,
161
table->field[7]->store(PLUGIN_LICENSE_PROPRIETARY_STRING,
175
162
strlen(PLUGIN_LICENSE_PROPRIETARY_STRING), cs);
178
table->field[9]->set_notnull();
165
table->field[7]->set_notnull();
180
167
return schema_table_store_record(thd, table);
4640
4627
ST_FIELD_INFO plugin_fields_info[]=
4642
{"PLUGIN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name",
4629
{"PLUGIN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name",
4643
4630
SKIP_OPEN_TABLE},
4644
4631
{"PLUGIN_VERSION", 20, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
4645
4632
{"PLUGIN_STATUS", 10, MYSQL_TYPE_STRING, 0, 0, "Status", SKIP_OPEN_TABLE},
4646
4633
{"PLUGIN_TYPE", 80, MYSQL_TYPE_STRING, 0, 0, "Type", SKIP_OPEN_TABLE},
4647
{"PLUGIN_TYPE_VERSION", 20, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
4648
4634
{"PLUGIN_LIBRARY", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, "Library",
4649
4635
SKIP_OPEN_TABLE},
4650
{"PLUGIN_LIBRARY_VERSION", 20, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
4651
4636
{"PLUGIN_AUTHOR", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
4652
4637
{"PLUGIN_DESCRIPTION", 65535, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
4653
4638
{"PLUGIN_LICENSE", 80, MYSQL_TYPE_STRING, 0, 1, "License", SKIP_OPEN_TABLE},