1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

[MCOL-4944] Automatically enable stats collection

if it is enabled in the config
This commit is contained in:
Alexey Antipovsky
2021-12-21 10:54:44 +03:00
parent 6c31f105ec
commit 683a6b3d19

View File

@ -279,13 +279,26 @@ struct cal_connection_info
delimiter('\7'),
affectedRows(0)
{
auto* cf = config::Config::makeConfig();
if (checkQueryStats(cf))
traceFlags |= execplan::CalpontSelectExecutionPlan::TRACE_LOG;
// check if this is a slave mysql daemon
isSlaveNode = checkSlave();
isSlaveNode = checkSlave(cf);
}
static bool checkSlave()
bool checkQueryStats(config::Config* cfg)
{
config::Config* cf = config::Config::makeConfig();
std::string qsVal = cfg->getConfig("QueryStats", "Enabled");
if (qsVal == "Y" || qsVal == "Y")
return true;
return false;
}
static bool checkSlave(config::Config* cf = nullptr)
{
if (!cf)
cf = config::Config::makeConfig();
std::string configVal = cf->getConfig("Installation", "MySQLRep");
bool isMysqlRep = (configVal == "y" || configVal == "Y");