Flashback
As we have seen in a previous chapter, a storage engine needs to declare a plugin and an initialization function that fills a handlerton
structure. Again, the only handlerton
method that we need here is a create()
method.
#include "ha_html.h" static handler* html_create_handler(handlerton *hton, TABLE_SHARE *table, MEM_ROOT *mem_root) { return new (mem_root) ha_html(hton, table); } static int html_init(void *p) { handlerton *html_hton = (handlerton *)p; html_hton->create = html_create_handler; return 0; } struct st_mysql_storage_engine html_storage_engine = { MYSQL_HANDLERTON_INTERFACE_VERSION }; mysql_declare_plugin(html) { MYSQL_STORAGE_ENGINE_PLUGIN, &html_storage_engine, "HTML", "Sergei Golubchik", "An example HTML storage engine", PLUGIN_LICENSE_GPL, html_init, NULL, 0x0001, NULL, NULL, NULL } mysql_declare_plugin_end;
Now we need to implement all of the required handler
class methods, as described in the previous chapter. Let's start with simple ones:
const char...