bool CInnoDBStatus::hasInnoDB(CMySQLServer *mysql) { bool has_innodb = false; CMySQLQuery *qry = new CMySQLQuery(mysql->mysql()); bool notnew = mysql->mysql()->version().major <= 3; if (!notnew) notnew = mysql->mysql()->version().major == 4 && mysql->mysql()->version().minor == 0 && mysql->mysql()->version().relnum <= 2; qry->setEmitMessages(false); QString sql = "SHOW "; if (!notnew) sql += "GLOBAL "; sql += "VARIABLES LIKE 'have_innodb'"; if (qry->exec(sql)) { if (qry->numRows() >= 1) { qry->next(); QString tmp = qry->row(1); if (tmp.lower() == "yes") { if (mysql->mysql()->version().major >= 3) { if (mysql->mysql()->version().major == 3 && mysql->mysql()->version().minor >= 23 && mysql->mysql()->version().relnum >= 53) has_innodb = true; else if (mysql->mysql()->version().major == 4 && mysql->mysql()->version().minor == 0) { if (mysql->mysql()->version().relnum >= 4) has_innodb = true; } else has_innodb = true; } } } } delete qry; return has_innodb; }
bool CUserAdminItem::displayUsers() { #ifdef DEBUG qDebug("CUserAdminItem::displayUsers()"); #endif //TODO: This needs to be modified to NOT use mysql.user for the users list. SHOW GRANTS FOR % is needed in the server. while (this->childCount() > 0) deleteChilds(); bool hasAccess = false; CMySQLQuery *q = new CMySQLQuery(mysql()->mysql()); q->setEmitMessages(false); q->setEmitErrors(false); if (q->exec("SELECT User, Host FROM mysql.user ORDER BY User")) { hasAccess = true; while (q->next()) new CUserItem(this, mysql(), q->row(0), q->row(1), userIcon); } delete q; return hasAccess; }