| 1055 | */ |
| 1056 | |
| 1057 | static handler *create_handler(THD *thd, MEM_ROOT *mem_root, |
| 1058 | LEX_CSTRING *name) |
| 1059 | { |
| 1060 | handlerton *hton; |
| 1061 | handler *file; |
| 1062 | plugin_ref plugin= my_plugin_lock_by_name(thd, name, |
| 1063 | MYSQL_STORAGE_ENGINE_PLUGIN); |
| 1064 | if (!plugin) |
| 1065 | { |
| 1066 | my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(ME_ERROR_LOG), name->str); |
| 1067 | return 0; |
| 1068 | } |
| 1069 | hton= plugin_hton(plugin); |
| 1070 | if (!ha_storage_engine_is_enabled(hton)) |
| 1071 | { |
| 1072 | my_error(ER_STORAGE_ENGINE_DISABLED, MYF(ME_ERROR_LOG), name->str); |
| 1073 | return 0; |
| 1074 | } |
| 1075 | if ((file= hton->create(hton, (TABLE_SHARE*) 0, mem_root))) |
| 1076 | file->init(); |
| 1077 | return file; |
| 1078 | } |
| 1079 | |
| 1080 | |
| 1081 | /* |
no test coverage detected