本文整理汇总了C++中CMySQLQuery::setEmitMessages方法的典型用法代码示例。如果您正苦于以下问题:C++ CMySQLQuery::setEmitMessages方法的具体用法?C++ CMySQLQuery::setEmitMessages怎么用?C++ CMySQLQuery::setEmitMessages使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMySQLQuery
的用法示例。
在下文中一共展示了CMySQLQuery::setEmitMessages方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: flush
void CAdministrationWindow::flush(CMySQLServer *m, int flush_type)
{
QString f = QString::null;
switch (flush_type)
{
case FLUSH_HOSTS: f = "HOSTS";
break;
case FLUSH_LOGS: f = "LOGS";
break;
case FLUSH_PRIVILEGES: f = "PRIVILEGES";
break;
case FLUSH_TABLES: f = "TABLES";
break;
case FLUSH_STATUS: f = "STATUS";
break;
case FLUSH_TABLES_RL: f = "TABLES WITH READ LOCK";
break;
case FLUSH_DES_KEY_FILE: f = "DES_KEY_FILE";
break;
case FLUSH_QUERY_CACHE: f = "QUERY CACHE";
break;
case FLUSH_USER_RESOURCES: f = "USER_RESOURCES";
break;
}
CMySQLQuery *qry = new CMySQLQuery(m->mysql());
qry->setEmitMessages(false);
if (qry->execStaticQuery("FLUSH " + f))
m->messagePanel()->information("Flush " + capitalize(f) + " " + tr("successful"));
delete qry;
}
示例2: refresh
void CInnoDBStatus::refresh()
{
clear();
CMySQLQuery *qry = new CMySQLQuery(mysql->mysql());
qry->setEmitMessages(false);
qry->setEmitErrors(false);
if (qry->exec("SHOW INNODB STATUS"))
{
qry->next();
setText(qry->row(0));
}
delete qry;
}
示例3: CMySQLQuery
void CAdministrationWindow::CShowServerVariables::insertData()
{
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";
if (qry->exec(sql))
while (qry->next())
insertItem(qry->row(0), qry->row(1));
delete qry;
}
示例4: hasInnoDB
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;
}
示例5: displayUsers
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;
}