Skip to content

Commit

Permalink
Fix boost::string_view compilation error of MysqlConnection class (#530)
Browse files Browse the repository at this point in the history
  • Loading branch information
an-tao authored Aug 10, 2020
1 parent 960309e commit 857cacf
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions orm_lib/src/mysql_impl/MysqlConnection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -426,13 +426,15 @@ void MysqlConnection::execSqlInLoop(
seekPos = sql.find("?", pos);
if (seekPos == std::string::npos)
{
sql_.append(sql.substr(pos));
auto sub = sql.substr(pos);
sql_.append(sub.data(), sub.length());
pos = seekPos;
break;
}
else
{
sql_.append(sql.substr(pos, seekPos - pos));
auto sub = sql.substr(pos, seekPos - pos);
sql_.append(sub.data(), sub.length());
pos = seekPos + 1;
switch (format[i])
{
Expand Down Expand Up @@ -473,12 +475,13 @@ void MysqlConnection::execSqlInLoop(
}
if (pos < sql.length())
{
sql_.append(sql.substr(pos));
auto sub = sql.substr(pos);
sql_.append(sub.data(), sub.length());
}
}
else
{
sql_ = sql;
sql_ = std::string(sql.data(), sql.length());
}
LOG_TRACE << sql_;
int err;
Expand Down

0 comments on commit 857cacf

Please sign in to comment.