mcsSetConfig QueryStats Enabled Y
systemctl stop mariadb-columnstore
systemctl stop mariadb
systemctl start mariadb
systemctl start mariadb-columnstore
mcsGetConfig -a | grep -i Cross
cej=$(mcsGetConfig CrossEngineSupport User)
pwd=$(mcsGetConfig CrossEngineSupport Password)
host=$(mcsGetConfig CrossEngineSupport Host)
# Make sure you have these grants
# GRANT SELECT,PROCESS ON *.* TO 'cross_engine'@'127.0.0.1';
# GRANT INSERT on `infinidb_querystats`.* TO 'cross_engine'@'127.0.0.1';
mariadb -h $host -u $cej -p$pwd -qse "select * from infinidb_querystats.querystats;"
# Confirm grants are good
# mariadb -h $host -u $cej -p$pwd -e "insert into infinidb_querystats.querystats (queryID)  values (1);"
mariadb -e "CREATE DATABASE IF NOT EXISTS test; USE test; CREATE TABLE IF NOT EXISTS t3 (a int) engine=columnstore;INSERT INTO t3 VALUES(1);INSERT INTO t3 VALUES(2);"
mariadb -h $host -u $cej -p$pwd test -e "SELECT * FROM t3 WHERE a=1;"
mariadb -h $host -u $cej -p$pwd -qse "select * from infinidb_querystats.querystats;"
# Notice queries dont automatically enter infinidb_querystats.querystats until you manually run "select calSetTrace(1);"
# Work around - add to /etc/my.cnf.d/server.cnf - init-connect='select calSetTrace(1);'
# However work around still doesnt work for root user


