Handling Handler Instantiation MySQL

The first method call your storage engine needs to support is the call for a new handler instance.

Before the handlerton is defined in the storage engine source file, a method header for the instantiation method must be defined. Here is an example from the CSV engine:

static handler* tina_create_handler(TABLE *table);

As you can see, the method accepts a pointer to the table the handler is intended to manage, and returns a handler object.

After the method header is defined, the method is named with a method pointer in the create() handlerton element, identifying the method as being responsible for generating new handler in-stances.

Here is an example of the MyISAM storage engine's instantiation method:

This call then works in conjunction with the storage engine's constructor. Here is an example from the FEDERATED storage engine:

And here's one more example from the EXAMPLE storage engine:

The additional elements in the FEDERATED example are extra initializations for the handler. The minimum implementation required is the handler()initialization shown in the EXAMPLE version.

Face Book Twitter Google Plus Instagram Youtube Linkedin Myspace Pinterest Soundcloud Wikipedia

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

MySQL Topics