|
|
|
|
@ -89,7 +89,6 @@ int main(int argc, char** argv) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MYSQL_STMT* stmt_param = nullptr;
|
|
|
|
|
MYSQL* proxysql_mysql = mysql_init(NULL);
|
|
|
|
|
MYSQL* proxysql_admin = mysql_init(NULL);
|
|
|
|
|
|
|
|
|
|
@ -103,12 +102,6 @@ int main(int argc, char** argv) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stmt_param = mysql_stmt_init(proxysql_mysql);
|
|
|
|
|
if (!stmt_param) {
|
|
|
|
|
diag("mysql_stmt_init(), out of memory");
|
|
|
|
|
goto exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Insert the row to be queried with the prepared statement.
|
|
|
|
|
// *************************************************************************
|
|
|
|
|
MYSQL_QUERY(proxysql_mysql, "CREATE DATABASE IF NOT EXISTS test");
|
|
|
|
|
@ -132,6 +125,13 @@ int main(int argc, char** argv) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
MYSQL_STMT* stmt_param = nullptr;
|
|
|
|
|
stmt_param = mysql_stmt_init(proxysql_mysql);
|
|
|
|
|
if (!stmt_param) {
|
|
|
|
|
diag("mysql_stmt_init(), out of memory");
|
|
|
|
|
goto exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the number of maximum connections for servers in the writer hostgroup
|
|
|
|
|
std::string t_update_mysql_servers {
|
|
|
|
|
"UPDATE mysql_servers SET max_connections=1 WHERE hostgroup_id=%d"
|
|
|
|
|
@ -246,10 +246,11 @@ int main(int argc, char** argv) {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mysql_stmt_close(stmt_param);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
exit:
|
|
|
|
|
if (stmt_param) { mysql_stmt_close(stmt_param); }
|
|
|
|
|
mysql_close(proxysql_mysql);
|
|
|
|
|
mysql_close(proxysql_admin);
|
|
|
|
|
|
|
|
|
|
|