1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

feat(plugin): All InnoDB queries are pushed down to Columnstore if columnstore_innodb_queries_uses_mcs = ON in the configuration before server start

This commit is contained in:
drrtuy
2025-05-19 18:42:23 +00:00
parent 11e5e481ab
commit 9038f0df09
4 changed files with 61 additions and 36 deletions

View File

@ -4077,9 +4077,9 @@ int ha_mcs_impl_pushdown_init(mcs_handler_info* handler_info, TABLE* table, bool
boost::shared_ptr<CalpontSystemCatalog> csc = CalpontSystemCatalog::makeCalpontSystemCatalog(sessionID);
csc->identity(CalpontSystemCatalog::FE);
if (!get_fe_conn_info_ptr())
if (!get_fe_conn_info_ptr())
{
set_fe_conn_info_ptr(reinterpret_cast<void*>(new cal_connection_info(), thd));
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -4127,33 +4127,33 @@ int ha_mcs_impl_pushdown_init(mcs_handler_info* handler_info, TABLE* table, bool
bool localQuery = (get_local_query(thd) > 0 ? true : false);
{
// ci->stats.reset(); // reset query stats
// ci->stats.setStartTime();
// if (thd->main_security_ctx.user)
// {
// ci->stats.fUser = thd->main_security_ctx.user;
// }
// else
// {
// ci->stats.fUser = "";
// }
ci->stats.reset(); // reset query stats
ci->stats.setStartTime();
if (thd->main_security_ctx.user)
{
ci->stats.fUser = thd->main_security_ctx.user;
}
else
{
ci->stats.fUser = "";
}
// if (thd->main_security_ctx.host)
// ci->stats.fHost = thd->main_security_ctx.host;
// else if (thd->main_security_ctx.host_or_ip)
// ci->stats.fHost = thd->main_security_ctx.host_or_ip;
// else
// ci->stats.fHost = "unknown";
if (thd->main_security_ctx.host)
ci->stats.fHost = thd->main_security_ctx.host;
else if (thd->main_security_ctx.host_or_ip)
ci->stats.fHost = thd->main_security_ctx.host_or_ip;
else
ci->stats.fHost = "unknown";
// try
// {
// ci->stats.userPriority(ci->stats.fHost, ci->stats.fUser);
// }
// catch (std::exception& e)
// {
// string msg = string("Columnstore User Priority - ") + e.what();
// ci->warningMsg = msg;
// }
try
{
ci->stats.userPriority(ci->stats.fHost, ci->stats.fUser);
}
catch (std::exception& e)
{
string msg = string("Columnstore User Priority - ") + e.what();
ci->warningMsg = msg;
}
// if the previous query has error, re-establish the connection
if (ci->queryState != 0)