Databases Reference
In-Depth Information
That's all. It was not too difficult. Now we only need to set the idx_field1 in the
initialization function and declare the plugin:
int cond_push_init(void *p)
{
ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE*) p;
schema->fields_info = cond_push_fields;
schema->fill_table = fill_cond_push;
schema->idx_field1 = 1;
return 0;
}
struct st_mysql_information_schema cond_push=
{ MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION };
mysql_declare_plugin(cond_push)
{
MYSQL_INFORMATION_SCHEMA_PLUGIN,
&cond_push,
"COND_PUSH",
"Andrew Hutchings (Andrew.Hutchings@Sun.COM)",
"A simple condition pushdown demo table",
PLUGIN_LICENSE_GPL,
cond_push_init,
NULL,
0x0010,
NULL,
NULL,
NULL
}
mysql_declare_plugin_end;
If we compile and install this plugin, we should see:
mysql> select * from information_schema.cond_push;
+-----------+-------+
| INCREMENT | TEXT |
+-----------+-------+
| 1 | hello |
| 2 | world |
| 3 | this |
| 4 | is |
| 5 | a |
| 6 | test |
+-----------+-------+
6 rows in set (0.01 sec)
 
Search WWH ::




Custom Search