1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

feat(plugin): unconditional innodb into MCS pushdown

This commit is contained in:
drrtuy
2025-05-05 19:06:45 +00:00
parent dc4ca8d588
commit 7b02299f50

View File

@ -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);