|
|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
#include "proxysql_config.h"
|
|
|
|
|
#include "re2/re2.h"
|
|
|
|
|
#include "proxysql.h"
|
|
|
|
|
#include "cpp.h"
|
|
|
|
|
|
|
|
|
|
@ -108,6 +109,10 @@ int ProxySQL_Config::Write_MySQL_Users_to_configfile(std::string& data) {
|
|
|
|
|
data += "mysql_users:\n(\n";
|
|
|
|
|
bool isNext = false;
|
|
|
|
|
for (auto r : sqlite_resultset->rows) {
|
|
|
|
|
// Prepare fields
|
|
|
|
|
std::string attributes { r->fields[12] };
|
|
|
|
|
RE2::GlobalReplace(&attributes, "\"", "\\\\\"");
|
|
|
|
|
|
|
|
|
|
if (isNext)
|
|
|
|
|
data += ",\n";
|
|
|
|
|
data += "\t{\n";
|
|
|
|
|
@ -123,7 +128,7 @@ int ProxySQL_Config::Write_MySQL_Users_to_configfile(std::string& data) {
|
|
|
|
|
addField(data, "backend", r->fields[9], "");
|
|
|
|
|
addField(data, "frontend", r->fields[10], "");
|
|
|
|
|
addField(data, "max_connections", r->fields[11], "");
|
|
|
|
|
addField(data, "attributes", r->fields[12]);
|
|
|
|
|
addField(data, "attributes", attributes.c_str());
|
|
|
|
|
addField(data, "comment", r->fields[13]);
|
|
|
|
|
data += "\t}";
|
|
|
|
|
isNext = true;
|
|
|
|
|
|