Fix boost::string_view compilation error of MysqlConnection class (#530)
This commit is contained in:
parent
960309e615
commit
857cacfda7
|
@ -426,13 +426,15 @@ void MysqlConnection::execSqlInLoop(
|
||||||
seekPos = sql.find("?", pos);
|
seekPos = sql.find("?", pos);
|
||||||
if (seekPos == std::string::npos)
|
if (seekPos == std::string::npos)
|
||||||
{
|
{
|
||||||
sql_.append(sql.substr(pos));
|
auto sub = sql.substr(pos);
|
||||||
|
sql_.append(sub.data(), sub.length());
|
||||||
pos = seekPos;
|
pos = seekPos;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sql_.append(sql.substr(pos, seekPos - pos));
|
auto sub = sql.substr(pos, seekPos - pos);
|
||||||
|
sql_.append(sub.data(), sub.length());
|
||||||
pos = seekPos + 1;
|
pos = seekPos + 1;
|
||||||
switch (format[i])
|
switch (format[i])
|
||||||
{
|
{
|
||||||
|
@ -473,12 +475,13 @@ void MysqlConnection::execSqlInLoop(
|
||||||
}
|
}
|
||||||
if (pos < sql.length())
|
if (pos < sql.length())
|
||||||
{
|
{
|
||||||
sql_.append(sql.substr(pos));
|
auto sub = sql.substr(pos);
|
||||||
|
sql_.append(sub.data(), sub.length());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sql_ = sql;
|
sql_ = std::string(sql.data(), sql.length());
|
||||||
}
|
}
|
||||||
LOG_TRACE << sql_;
|
LOG_TRACE << sql_;
|
||||||
int err;
|
int err;
|
||||||
|
|
Loading…
Reference in New Issue