1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

feat(ddl,partitions): better partition-related commands logging

This commit is contained in:
drrtuy
2024-08-23 18:24:48 +00:00
committed by Leonid Fedorov
parent 7979c8b0ca
commit 148063e07a
7 changed files with 35 additions and 6 deletions

View File

@ -863,6 +863,32 @@ bool from_string(T& t, const std::string& s, std::ios_base& (*f)(std::ios_base&)
return !(iss >> f >> t).fail();
}
class FormatStatementString
{
public:
FormatStatementString() = default;
~FormatStatementString() = default;
std::string formatStatementString(const std::string& cmd, const std::string& schema,
const std::string& table,
const std::set<BRM::LogicalPartition>& partitions)
{
std::ostringstream stmt;
stmt << cmd << "(" << schema << "," << table << ",";
// There must be at least one partition to drop.
for (auto& p : partitions)
{
stmt << p << ",";
}
auto res = stmt.str();
res.back() = ')';
return res;
}
};
} // namespace ddlpackageprocessor
#undef EXPORT