Documentation Home
MySQL Internals Manual

MySQL Internals Manual  /  Writing a Custom Storage Engine  /  Defining Filename Extensions

23.7 Defining Filename Extensions

Storage engines are required to provide the MySQL server with a list of extensions used by the storage engine with regard to a given table, its data and indexes.

Extensions are expected in the form of a null-terminated string array. The following is the array used by the CSV engine:

static const char *ha_tina_exts[] = {

This array is returned when the [custom-engine.html#custom-engine-api-reference-bas_ext bas_ext()] method is called:

const char **ha_tina::bas_ext() const
  return ha_tina_exts;

By providing extension information you can also omit implementing DROP TABLE functionality as the MySQL server will implement it for you by closing the table and deleting all files with the extensions you specify.