diff --git a/dbcon/mysql/ha_mcs.cpp b/dbcon/mysql/ha_mcs.cpp index 655f6001d..3a6af6f1e 100644 --- a/dbcon/mysql/ha_mcs.cpp +++ b/dbcon/mysql/ha_mcs.cpp @@ -1826,6 +1826,13 @@ static int columnstore_init_func(void* p) fprintf(stderr, "Columnstore: Started; Version: %s-%s\n", columnstore_version.c_str(), columnstore_release.c_str()); + LEX_CSTRING name = {STRING_WITH_LEN("INNODB")}; + auto* plugin_innodb = ha_resolve_by_name(0, &name, 0); + if (!plugin_innodb || (*plugin_innodb)->state != PLUGIN_IS_READY) + { + DBUG_RETURN(HA_ERR_RETRY_INIT); + } + strncpy(cs_version, columnstore_version.c_str(), sizeof(cs_version) - 1); cs_version[sizeof(cs_version) - 1] = 0; @@ -1851,6 +1858,17 @@ static int columnstore_init_func(void* p) mcs_hton->create_unit = create_columnstore_unit_handler; mcs_hton->db_type = DB_TYPE_AUTOASSIGN; +{ + auto* innodb_hton = plugin_hton(plugin_innodb); + int error = innodb_hton == nullptr; // Engine must exists! + if (error) + { + my_error(HA_ERR_INITIALIZATION, MYF(0), "Could not find storage engine %s", name.str); + } + innodb_hton->create_select = create_columnstore_select_handler; + innodb_hton->create_unit = create_columnstore_unit_handler; +} + #ifdef HAVE_PSI_INTERFACE uint count = sizeof(all_mutexes) / sizeof(all_mutexes[0]); mysql_mutex_register("ha_mcs_cache", all_mutexes, count);